React SDK
Installation
Quick Start
The simplest way to integrate Reevit is using theReevitCheckout component.
Note: Always import the styles CSS file to get the built-in checkout modal styling.
Props Reference
| Prop | Type | Required | Description |
|---|---|---|---|
publicKey | string | ✅ | Your project’s public key (pfk_test_...secret or pfk_live_...secret) |
amount | number | ✅ | Amount in smallest unit (e.g., 500 for 5.00) |
currency | string | ✅ | 3-letter ISO currency code (GHS, NGN, USD, etc.) |
email | string | Customer’s email address | |
phone | string | Customer’s phone (recommended for Mobile Money) | |
reference | string | Your own unique transaction reference | |
metadata | object | Optional key-value pairs for your own tracking | |
paymentMethods | string[] | Enabled methods: ['card', 'mobile_money', 'bank_transfer'] | |
theme | ReevitTheme | Customization options | |
apiBaseUrl | string | Custom API URL (for self-hosted or testing) | |
initialPaymentIntent | PaymentIntent | Pre-created intent for controlled mode | |
onSuccess | function | Called when payment is successful | |
onError | function | Called when an error occurs | |
onClose | function | Called when user dismisses the widget |
Theming
Customize the checkout widget to match your brand:Theme Options
| Property | Type | Description |
|---|---|---|
primaryColor | string | Primary button and accent color |
backgroundColor | string | Modal background color |
textColor | string | Text color |
borderRadius | string | Border radius for buttons and inputs |
fontFamily | string | Custom font family |
darkMode | boolean | Enable dark mode styling |
Controlled Mode
If you prefer to create the payment intent on your backend before opening the checkout, you can use Controlled Mode.For full control over the payment flow, use the
useReevit hook to build your own custom UI.
PSP Bridges
For advanced use cases, use individual PSP bridges directly.Paystack Bridge
The default bridge for card and mobile money payments in Ghana/Nigeria:Stripe Bridge
For card payments including Apple Pay and Google Pay:Monnify Bridge (Nigeria)
For bank transfers and cards in Nigeria:M-Pesa Bridge (Kenya/Tanzania)
M-Pesa uses STK Push - the customer receives a prompt on their phone:Supported Providers
| Provider | Countries | Payment Methods |
|---|---|---|
| Paystack | NG, GH, ZA, KE | Card, Mobile Money, Bank |
| Flutterwave | NG, GH, KE, ZA+ | Card, Mobile Money, Bank |
| Hubtel | GH | Mobile Money |
| Stripe | Global (50+) | Card, Apple Pay, Google Pay |
| Monnify | NG | Card, Bank Transfer, USSD |
| M-Pesa | KE, TZ | Mobile Money (STK Push) |
Troubleshooting
CORS Errors
If you see CORS errors when connecting to your local backend:- Ensure your backend includes your frontend origin in
FRONTEND_ALLOWED_ORIGINS - Check that the
apiBaseUrlprop points to the correct backend URL - Verify your API key is valid and registered in the database
Styles Not Loading
Make sure you import the styles:Payment Failed: Network Error
This usually means the SDK cannot reach the backend:- Check your
apiBaseUrlis correct - Ensure the backend is running
- For test keys (
pfk_test_*), the SDK defaults to sandbox API unlessapiBaseUrlis set
Browser Support
- Chrome, Firefox, Safari, Edge (latest 2 versions)
- Mobile Safari and Chrome on Android/iOS

