nexora-chai-react
v1.0.0
Published
Official React SDK for Nexora Chai - The simplest way to accept M-Pesa tips in your React app.
Readme
nexora-chai-react
The official Nexora Chai React SDK. The simplest way to accept M-Pesa and Card tips in your React or Next.js application.
🚀 Installation
npm install nexora-chai-react
# or
yarn add nexora-chai-react🛠️ Usage
import { ChaiButton } from 'nexora-chai-react';
function App() {
return (
<ChaiButton
username="nexora"
amount={100}
theme="amber"
onSuccess={() => console.log("Tip received!")}
/>
);
}🎨 Props
| Prop | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| username | string | Required | Your Nexora Chai username. |
| amount | number | undefined | Pre-set tip amount in KES. |
| message | string | "" | Pre-set message for the creator. |
| theme | 'amber' \| 'dark' \| 'light' | 'amber' | Button color theme. |
| size | 'sm' \| 'md' \| 'lg' | 'md' | Button size. |
| label | string | "Buy me a Chai" | Custom button text. |
| onSuccess | function | undefined | Callback after successful payment. |
