CoverPay Link
CoverPay Link is a drop-in module that provides a secure, elegant authentication flow for your users to connect to BNPL providers. Similar to Plaid Link, it handles the entire checkout experience — provider selection, eligibility, and payment confirmation — so you don't have to build it yourself.
How Link Works
CoverPay Link abstracts the complexity of multi-provider BNPL into four steps. Your app initializes the SDK, opens the modal, and receives a payment token on success.
Configure SDK with your client ID and environment
Call open() with amount, merchant name, and callbacks
User picks from Klarna, Affirm, Afterpay, and more
Get a payment token to confirm server-side
Link Flow
┌─────────────────────────────────────────────────┐
│ Your App │
│ │
│ 1. CoverPay.create({ clientId, env }) │
│ 2. coverpay.open({ amount, merchant }) │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ CoverPay Link Modal │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Klarna │ │ Affirm │ │ Afterpay │ ... │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ │ │ │
│ │ Smart Router selects best provider │ │
│ │ User confirms plan → payment token returned │ │
│ └─────────────────────────────────────────────┘ │
│ │
│ 3. onSuccess({ paymentToken, provider }) │
│ 4. POST /v1/checkout/confirm { token } │
└─────────────────────────────────────────────────┘
Platform Support
CoverPay Link is available on web and iOS. Each platform provides a native integration that matches the platform's conventions.
| Platform | Package | Status | Min Version |
|---|---|---|---|
| Web / JavaScript | @coverpay/sdk | Stable | ES2018+ |
| React | @coverpay/react | Stable | React 18+ |
| iOS / Swift | CoverPaySDK | Beta | iOS 16+ |
Configuration Options
These options are shared across all platforms. See platform-specific pages for additional options.
| Parameter | Type | Required | Description |
|---|---|---|---|
clientId | string | Required | Your CoverPay API client ID from the dashboard |
environment | "sandbox" | "production" | Required | API environment. Use sandbox for testing. |
amount | number | Required | Checkout amount in cents (e.g., 9999 = $99.99) |
merchantName | string | Required | Your business name, displayed in the checkout modal |
customerEmail | string | Optional | Pre-fill the customer email for faster checkout |
onSuccess | function | Required | Callback when payment is authorized. Receives payment token. |
onError | function | Optional | Callback when an error occurs during checkout |
theme | "light" | "dark" | "auto" | Optional | UI theme for the checkout modal. Defaults to auto. |
Quick Example
import { CoverPay } from '@coverpay/sdk';
const coverpay = CoverPay.create({
clientId: 'your_client_id',
environment: 'sandbox',
});
const result = await coverpay.open({
amount: 9999,
merchantName: 'My Store',
customerEmail: 'user@example.com',
onSuccess: (result) => {
console.log('Payment token:', result.paymentToken);
console.log('Provider:', result.provider);
},
onError: (error) => {
console.error('Checkout failed:', error);
},
});Platform Guides
Web / JavaScript
Vanilla JS SDK for any web app
@coverpay/sdkReact
React components and hooks
@coverpay/reactiOS / Swift
Native Swift Package for iOS
CoverPaySDKNeed server-side integration?
CoverPay Link handles the client-side checkout. To confirm payments and receive webhooks, see the API Reference and Webhooks guide.