React SDK

npm version GitHub Pre-built React components for integrating Reevit payments with beautiful, customizable checkout UI.

Installation

Quick Start

The simplest way to integrate Reevit is using the ReevitCheckout component.
Note: Always import the styles CSS file to get the built-in checkout modal styling.

Props Reference


Theming

Customize the checkout widget to match your brand:

Theme Options


Controlled Mode

If you prefer to create the payment intent on your backend before opening the checkout, you can use Controlled Mode.
In this mode, the SDK skips the initial intent creation step and proceeds directly to payment method selection or provider confirmation.
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


Troubleshooting

CORS Errors

If you see CORS errors when connecting to your local backend:
  1. Ensure your backend includes your frontend origin in FRONTEND_ALLOWED_ORIGINS
  2. Check that the apiBaseUrl prop points to the correct backend URL
  3. 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:
  1. Check your apiBaseUrl is correct
  2. Ensure the backend is running
  3. For test keys (pfk_test_*), the SDK defaults to sandbox API unless apiBaseUrl is set

Browser Support

  • Chrome, Firefox, Safari, Edge (latest 2 versions)
  • Mobile Safari and Chrome on Android/iOS