SoloPay Client SDK
SoloPay provides client-side SDKs to easily integrate the payment widget.
Package choice
@solo-pay/widget-js— Framework-agnostic (Vanilla JS), works in any environment@solo-pay/widget-react— React hook wrapper for React projects
widget-js install and usage
bash
npm install @solo-pay/widget-jstypescript
import { SoloPay } from '@solo-pay/widget-js';
const solopay = new SoloPay({
publicKey: 'pk_xxxxx', // Your issued Public Key
});
solopay.requestPayment({
orderId: 'order-001',
amount: '10.5',
tokenAddress: '0xE4C687167705Abf55d709395f92e254bdF5825a2',
successUrl: 'https://yourshop.com/payment/success',
failUrl: 'https://yourshop.com/payment/fail',
});widget-react install and usage
bash
npm install @solo-pay/widget-reacttypescript
import { useWidget } from '@solo-pay/widget-react';
const { openWidget } = useWidget({
publicKey: 'pk_xxxxx',
defaultPaymentRequest: {
tokenAddress: '0xE4C687167705Abf55d709395f92e254bdF5825a2',
successUrl: 'https://yourshop.com/payment/success',
failUrl: 'https://yourshop.com/payment/fail',
},
});
openWidget({ orderId: 'order-001', amount: '10.5' });Next steps
- Widget Integration Guide - Full usage guide
- Client-Side Integration - How to handle payment results