Skip to main content
The @rampnow/sdk package opens the Rampnow widget inside your web app with a few lines of code. It is a typed wrapper around the Widget: the same buy and sell flow, the same parameters, plus browser events, programmatic open and close, and a React hook.

Overlay Mode

Full-screen modal overlay. Quickest setup, no container needed

Embedded Mode

Mount the widget inside any DOM element in your layout

Redirect Mode

Generate a URL to open in a new tab, for native apps or email links

React Hook

First-class React support via useRampnowSdk
Try the SDK live at demo.rampnow.io.

How it works

1

Create an SDK instance

Pass your partner key and any order details you already know (direction, asset, amount, wallet address). See Configuration.
2

Subscribe to events

React in your UI as the order moves, for example when it is created or completed. See Events & commands.
3

Open the widget

Call init(). The user completes sign-in, KYC and payment inside the Rampnow widget. See Display modes.
4

Confirm on your backend

Browser events are for UI only. Use webhooks as the source of truth for order status.

Your partner API key

Every widget session, whether opened by URL, iframe or the SDK, carries your partner API key as apiKey. That key is what makes the order yours:
  • Orders placed through your integration are attributed to your account in the Partner Dashboard
  • Order status webhooks go to your endpoint
  • The partner fee agreed with Rampnow for your account applies to each order. It can be zero if you integrate for visibility only
Use the public key from the Partner Dashboard under API Hub. Sandbox and production keys are different, and each only works against its own environment.
The public key is safe to ship in client-side code. You don’t need a backend, an API secret or request signing to open the widget. The API key and secret pair (with X-RAMPNOW-SIGN) is only for the Onramp & Offramp Intent REST API.

When to use the SDK

  • Web apps that need event callbacks as the order moves
  • Programmatic control: open and close the widget from your own buttons
  • React apps, through the useRampnowSdk hook
  • Type-safe configuration with TypeScript
  • You only need a link or an iframe: the Widget needs no JavaScript
  • You want to build the pre-checkout journey yourself and create orders server-to-server: use Onramp & Offramp Intent
See Integrations Overview for a side-by-side comparison.

Next: Installation & setup

Install the package and open your first widget session