27/07/2026
๐ Paystack Integration in React 19 โ The Complete Setup (Free Tier Included)
Every Nigerian web app eventually needs to collect payments. Paystack is the answer โ and it's easier to integrate than most developers think.
Here's the complete React 19 setup:
๐ฆ Step 1: Install the package
npm install react-paystack
๐ง Step 2: Set up your config
```jsx
const config = {
reference: new Date().getTime().toString(),
email: userEmail,
amount: 500000, // Amount in KOBO (โฆ5,000 = 500000 kobo)
publicKey: import.meta.env.VITE_PAYSTACK_PUBLIC_KEY,
};
```
โก Step 3: Trigger payment
```jsx
import { usePaystackPayment } from 'react-paystack';
const initializePayment = usePaystackPayment(config);
initializePayment(onSuccess, onClose)}>
Pay โฆ5,000
```
โ
Step 4: Handle success
```jsx
const onSuccess = (reference) => {
console.log('Payment successful:', reference);
// Update your database, send email, etc.
};
```
๐ก Pro tips:
- Always store your secret key server-side only โ never in your React frontend
- Use Paystack's test keys during development (no real money moves)
- Verify transactions server-side using Paystack's verification endpoint
- The free tier has zero monthly fees โ Paystack takes 1.5% per transaction
Save this post. Your next client will definitely ask for payment integration. ๐