Skip to main content

Using @turnkey/react-wallet-kit

Setting up Fiat Onramp with @turnkey/react-wallet-kit is straightforward.

handleOnRamp

The handleOnRamp() 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 of handleOnRamp() 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:
  1. Call initFiatOnRamp() with your desired parameters to receive the onRampUrl and onRampTransactionId.
  2. Open the onRampUrl in a popup or new tab for the user to complete their purchase.
  3. Poll getOnRampTransactionStatus() periodically until the transaction is COMPLETED, FAILED, or CANCELLED.
  4. Handle cleanup and UI updates accordingly.
Below is a simplified example inspired by the internal handleOnRamp() implementation:
This approach gives you:
  • 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 leveraging handleOnRamp here and the code here