Swipelux
Client-side integration/Web SDKs

React SDK

The @swipelux/onramp-react package provides a simple way to embed the Swipelux on-ramp widget into your React application.

This package was designed to work with Next.js and other server-side rendering frameworks out of the box as well.

Integration steps

Install the package

Run the following command to install the SDK:

npm install @swipelux/onramp-react

Add the component to your app

The Swipelux On-Ramp widget is rendered using the <SwipeluxWidget/> component.

App.tsx
import React from "react";
import { SwipeluxWidget } from "@swipelux/onramp-react"; 
 
export default function App() {
  return (
    <SwipeluxWidget
      // Make sure to replace `apiKey` with your own publishable API key
      apiKey="YOUR_PUBLISHABLE_API_KEY"
    />
  );
}

You're all set!

You've now integrated the Swipelux On-Ramp widget into your React app.

Visit your app and confirm that the widget is displayed correctly.

Next steps

We've only covered the basics of how to integrate the Swipelux On-Ramp widget into your React application.

If you're using a server-side integration and create orders using our REST API, then you should use the orderToken prop in the SwipeluxWidget component to initiate the widget with a prepared order.

To learn more about orderToken and other supported widget settings, please refer to the Supported widget settings article.

On this page