Coinfat

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).

PropertyTypeDescription
environment"production" | "development"Maps to a backend base URL. Defaults to development.
apiBasestringOverrides 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().

PropertyTypeDescription
invoicerequiredstringThe invoice ulid from your server.
displayrequired"inline" | "modal"How the widget is presented.
mountstring | HTMLElementA CSS selector or element. Required for inline; ignored for modal.
layout"wide" | "narrow"Defaults to narrow. wide is a two-column, responsive-collapsing layout.
themeCheckoutThemeAccent color and light/dark mode. See Appearance.
localestringA BCP-47 tag. See Appearance & localization.
stringsCheckoutStringsOverrideOverride individual payer-facing strings. See Appearance & localization.
redirectOnCompletebooleanDefaults to false. Redirect to the invoice's success_url on completion.
callbacksfunctionsonReady, onCompleted, and the other lifecycle callbacks. See Events.

button(params)

Renders a self-contained button that opens the modal. Returns an object with destroy().

PropertyTypeDescription
invoicerequiredstringThe invoice ulid from your server.
mountrequiredstring | HTMLElementWhere the button renders.
labelstringDefaults to a localized "Pay with crypto".
themeCheckoutThemeAccent and mode for the button and modal.
checkoutOmit<CheckoutParams, …>Everything checkout() takes except invoice, display, and mount: callbacks, layout, locale, strings, redirectOnComplete for the modal it opens.