React SDK
The @swipelux/onramp-react
package provides a simple way to embed Swipelux OnRamp into your React application with full TypeScript support.
This package was designed to work with Next.js and other server-side rendering frameworks out of the box.
Integration Steps
Add the Component to Your App
Swipelux OnRamp is rendered using the <SwipeluxWidget/>
component.
You're All Set!
You've now integrated Swipelux OnRamp into your React app.
Visit your app and confirm that the widget is displayed correctly.
Advanced Configuration
Event Handling
Handle widget events using callback props:
Widget Configuration
Configure Swipelux OnRamp with props:
TypeScript Support
The React SDK includes full TypeScript definitions:
Integration Patterns
Modal Integration
Embed the widget in a modal for overlay experiences:
Server-side Order Integration
When creating orders programmatically, use the orderToken
prop:
Next Steps
You've successfully integrated Swipelux OnRamp into your React application. Consider these next steps:
- Server-side integration: Create orders programmatically using our REST API
- Webhook handling: Set up webhooks for real-time order updates
- Widget customization: Learn about advanced customization options
If you're using a server-side integration and create orders using our REST API, use the orderToken
prop in the SwipeluxWidget
component to initiate the widget with a prepared order.