Checkout SDK
Configuration
Every option the client, the checkout call, and the drop-in button accept.
Coinfat(options)
Creates the client. Returns an object with .checkout(params) and .button(params).
| Property | Type | Description |
|---|---|---|
| environment | "production" | "development" | Maps to a backend base URL. Defaults to development. |
| apiBase | string | Overrides environment with a custom host. Must already include the /api/v1 path. |
checkout(params)
Renders a checkout and returns a session with open(), close(), and destroy().
| Property | Type | Description |
|---|---|---|
| invoicerequired | string | The invoice ulid from your server. |
| displayrequired | "inline" | "modal" | How the widget is presented. |
| mount | string | HTMLElement | A CSS selector or element. Required for inline; ignored for modal. |
| layout | "wide" | "narrow" | Defaults to narrow. wide is a two-column, responsive-collapsing layout. |
| theme | CheckoutTheme | Accent color and light/dark mode. See Appearance. |
| locale | string | A BCP-47 tag. See Appearance & localization. |
| strings | CheckoutStringsOverride | Override individual payer-facing strings. See Appearance & localization. |
| redirectOnComplete | boolean | Defaults to false. Redirect to the invoice's success_url on completion. |
| callbacks | functions | onReady, onCompleted, and the other lifecycle callbacks. See Events. |
button(params)
Renders a self-contained button that opens the modal. Returns an object with destroy().
| Property | Type | Description |
|---|---|---|
| invoicerequired | string | The invoice ulid from your server. |
| mountrequired | string | HTMLElement | Where the button renders. |
| label | string | Defaults to a localized "Pay with crypto". |
| theme | CheckoutTheme | Accent and mode for the button and modal. |
| checkout | Omit<CheckoutParams, …> | Everything checkout() takes except invoice, display, and mount: callbacks, layout, locale, strings, redirectOnComplete for the modal it opens. |
Success behavior: on completion onCompleted fires; the widget redirects to the invoice's success_url only when redirectOnComplete: true is set.