Documentation Index
Fetch the complete documentation index at: https://lyelpay.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
react-lyel-pay-js provides ready-made React components that embed the full Lyel Pay checkout experience — phone number entry, OTP validation, and payment confirmation — without you building the UI from scratch.
Installation
Basic usage
The simplest integration is two lines: initialize Lyel Pay withloadLyelPay, then drop in <LyelPayElements />.
LyelPayElements automatically renders:
- A checkout form asking for the user’s phone number and password
- An OTP validation form after the payment intent is created
loadLyelPay(apiKey, amount, clientSecret)
Initializes the Lyel Pay instance asynchronously. Returns a Promise that resolves to a LyelPayInstance.
| Parameter | Type | Description |
|---|---|---|
apiKey | string | Your merchant API key |
amount | number | Amount to charge (e.g. 5000 for 5,000 XAF) |
clientSecret | string | Your client secret from the dashboard |
<LyelPayElements options={promise} />
The main checkout component. Pass the promise returned by loadLyelPay as the options prop.
Using the provider directly
For advanced use cases — custom styling, multi-step flows, or accessing the Lyel Pay context in nested components — you can useLyelPayProvider and useLyelPay directly:
useLyelPay()
React hook that returns the current LyelPayContextData from the nearest LyelPayProvider.
undefined if used outside a LyelPayProvider.
Customization
The React SDK is intentionally minimal. For full UI control:- Use the JavaScript SDK to drive the flow manually
- Build your own form components and call
createIntention,initOtp,verifyOtp, andchargedirectly
Next steps
JavaScript SDK
Build a fully custom checkout UI.
Webhooks
Confirm payments server-side with webhooks.