Skip to main content
Payments require handling sensitive data. The code examples below demonstrate the integration pattern and should not be used in production as-is. In production, store sensitive information such as API keys and private keys in a secrets manager or vault.
Stripe’s crypto on-ramp requires a US domicile (excluding Hawaii) and a registered business. Once registration is approved, the Crypto/Onramp_sessions API is enabled on your account. The examples below use Stripe’s Sandbox environment.

Prerequisites

Create an on-ramp session on the server

Create the session server-side and return only the client_secret to the frontend. Never expose your STRIPE_SECRET_KEY to the client. Using cURL:
A successful response returns a client_secret:
Using the Stripe Node SDK:

Mount the on-ramp widget on the frontend

Pass the client_secret from your server response to the Stripe on-ramp widget: