Install
Install the React SDK
Embed checkout
CheckoutPage.tsx
Display modes
Use
style or className to style the component’s wrapper. The SDK also exports LOCUS_BRAND_COLORS, LOCUS_CTA_GRADIENT, and LOCUS_FONT_FAMILY for surrounding UI.
Payment callbacks
onSuccess receives sessionId, amount, currency, txHash, payerAddress, and paidAt. Use it to show confirmation.
Use onCancel for cancelled checkouts and onError to report failures.
Use callbacks to update the UI. Verify payment on your server before fulfilling an order.
Webhooks
SetwebhookUrl when creating the session. Locus sends a POST request when a payment confirms or a session expires:
Payload
Payment confirmation event
Signature verification
VerifyX-Signature-256 against the raw request body before fulfilling the order. Use the whsec_ secret returned when you create a session with a webhook URL.
verify-webhook.ts
X-Webhook-Event and X-Session-Id.
Hook: useLocusCheckout
Use the hook for your own payment buttons:
PayButton.tsx
Merchant dashboard
The dashboard tracks revenue, session count, conversion, and payment methods. Filter by time range or checkout instance, then open a session for payment details. Use an instance ID to group sessions by integration point. Instances are created on first use. Buyers can find receipts in Purchases.
Checkout analytics by instance