Using @turnkey/react-wallet-kit
Setting up Fiat Onramp with @turnkey/react-wallet-kit is straightforward.handleOnRamp
ThehandleOnRamp() helper abstracts the process of initializing and launching a fiat on-ramp flow as well as polling transaction status.
White Label Implementation
If you prefer a more white label approach, you can replicate the behavior ofhandleOnRamp() directly in your own app.This allows full control over how you open the provider’s UI, manage state, and poll transaction status. The general flow is:
- Call
initFiatOnRamp()with your desired parameters to receive theonRampUrlandonRampTransactionId. - Open the
onRampUrlin a popup or new tab for the user to complete their purchase. - Poll
getOnRampTransactionStatus()periodically until the transaction isCOMPLETED,FAILED, orCANCELLED. - Handle cleanup and UI updates accordingly.
handleOnRamp() implementation:
- Full control over the UI and provider window handling.
- The ability to customize polling intervals, completion logic, and error handling.
- A foundation for integrating custom analytics, logging, or notifications.
Example
See our example app leveraginghandleOnRamp here and the code here