npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aro-wolo/react-paystack

v1.0.1

Published

React hooks and components for integrating Paystack payments.

Readme

React Paystack

A modern React library for integrating the Paystack payment gateway into your React applications.

This package supports React 18 and React 19 and is built with modern React and TypeScript.

Features

  • ⚡ Simple Paystack integration
  • ⚛️ React 18 & React 19 support
  • 🪝 Hook-based API
  • 🔘 Ready-to-use payment button
  • 🧩 Context consumer API
  • 📦 TypeScript support
  • 🚀 Lightweight with zero unnecessary dependencies

Installation

Using npm:

npm install @aro-wolo/react-paystack

Using Yarn:

yarn add @aro-wolo/react-paystack

Using pnpm:

pnpm add @aro-wolo/react-paystack

Quick Start

All examples below use the same configuration object.

const config = {
	reference: new Date().getTime().toString(),
	email: "[email protected]",
	amount: 20000, // Amount in the lowest currency unit (20000 Kobo = ₦200)
	publicKey: "pk_test_xxxxxxxxxxxxxxxxxxxxx",
};

Usage

This library can be used in three different ways:

  1. usePaystackPayment Hook
  2. PaystackButton Component
  3. PaystackConsumer Component

All three approaches provide the same payment experience.


1. Using the Hook

import { usePaystackPayment } from "@aro-wolo/react-paystack";

const config = {
	reference: new Date().getTime().toString(),
	email: "[email protected]",
	amount: 20000,
	publicKey: "pk_test_xxxxxxxxxxxxxxxxxxxxx",
};

export default function App() {
	const initializePayment = usePaystackPayment(config);

	const onSuccess = (reference: any) => {
		console.log(reference);
	};

	const onClose = () => {
		console.log("Payment cancelled");
	};

	return (
		<button onClick={() => initializePayment(onSuccess, onClose)}>
			Pay Now
		</button>
	);
}

2. Using the Button Component

import { PaystackButton } from "@aro-wolo/react-paystack";

const componentProps = {
	reference: new Date().getTime().toString(),
	email: "[email protected]",
	amount: 20000,
	publicKey: "pk_test_xxxxxxxxxxxxxxxxxxxxx",

	text: "Pay Now",

	onSuccess(reference: any) {
		console.log(reference);
	},

	onClose() {
		console.log("Payment cancelled");
	},
};

export default function App() {
	return <PaystackButton {...componentProps} />;
}

3. Using the Consumer Component

import { PaystackConsumer } from "@aro-wolo/react-paystack";

const componentProps = {
	reference: new Date().getTime().toString(),
	email: "[email protected]",
	amount: 20000,
	publicKey: "pk_test_xxxxxxxxxxxxxxxxxxxxx",

	onSuccess(reference: any) {
		console.log(reference);
	},

	onClose() {
		console.log("Payment cancelled");
	},
};

export default function App() {
	return (
		<PaystackConsumer {...componentProps}>
			{({ initializePayment }) => (
				<button onClick={() => initializePayment()}>Pay Now</button>
			)}
		</PaystackConsumer>
	);
}

Transaction Metadata

Additional transaction metadata can be sent using the metadata property.

const config = {
	reference: new Date().getTime().toString(),
	email: "[email protected]",
	amount: 20000,
	publicKey: "pk_test_xxxxxxxxxxxxxxxxxxxxx",

	metadata: {
		custom_fields: [
			{
				display_name: "Description",
				variable_name: "description",
				value: "Funding Wallet",
			},
		],
	},
};

Refer to the official Paystack documentation for all available metadata options.


Configuration

| Property | Required | Description | | ----------- | :------: | ---------------------------------- | | email | ✅ | Customer email address | | amount | ✅ | Amount in the lowest currency unit | | publicKey | ✅ | Your Paystack public key | | reference | ✅ | Unique payment reference | | currency | ❌ | Currency code | | label | ❌ | Label displayed on checkout | | metadata | ❌ | Additional transaction metadata | | channels | ❌ | Allowed payment channels | | split | ❌ | Split payment configuration |


Testing

Use your Paystack Test Public Key while developing.

Before deploying your application, replace it with your Live Public Key.


Documentation

For more information about Paystack Inline, visit:

https://paystack.com/docs/payments/accept-payments/


Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a feature branch.
git checkout -b feature/my-feature
  1. Commit your changes.
git commit -m "Add my feature"
  1. Push your branch.
git push origin feature/my-feature
  1. Open a Pull Request.

Roadmap

  • React 19 improvements
  • Improved TypeScript typings
  • Better examples
  • Additional customization options
  • More comprehensive tests

Credits

This project is based on the original work by Ayeni Olusegun.


License

Licensed under the MIT License.

See the LICENSE file for details.