@unseen_fi/sdk and handed to the modal via createPaymentSession. When it works once, continue to Architecture so every hop has a label.
Prerequisites
- Merchant API key (
usk_test_*orusk_live_*) - Node 18+ for server code; React 18+ for UI
1. Install packages
2. Create a payment on the server
UseUnseenClient with your secret key. Default API hosts follow the network you pass (see Environments).
server.ts
id, checkoutUrl, reference, amount, and paymentToken if your API returns one).
3. Wire the React checkout
Wrap your app withUnseenProvider and pass a createPaymentSession that calls your endpoint (not Unseen directly from the browser with a live secret).
app.tsx
<UnseenProvider> defaults baseUrl to https://unseen.finance if omitted. It must match the deployment your front end should call for /api/... routes.
4. Confirm fulfillment
- Client: the built-in modal polls verify after the user taps I have paid (hooks).
- Server: call
unseen.payments.verify(paymentId)or handle signed webhooks.
