Skip to content

configure(config)

Sets global SDK configuration options

Sets global SDK configuration options: your organization ID, API base URL, and region. Call it once during initialization so you don’t pass these values to every call.

createCheckout(), createClientSession(), and the Billing.stripe methods use this configuration. Billing.initMethod(), getAvailablePaymentMethods(), and Billing.silentPurchase() don’t, so pass orgId in their options.

orgIdstringrequired

Your organization’s ID.

baseUrlstringdefault: https://billing.funnelfox.com

Custom API base URL if you are pointing to a non-default backend.

regionstringdefault: default

Deployment region to use (if applicable).

This function does not return a value. The configuration is stored globally and applied to all subsequent SDK operations that use it.

Values you pass to a method take priority over configure(). Pass orgId and apiConfig: { baseUrl, region } to createCheckout(), createClientSession(), or a Billing.stripe method to override the global values for that call.

import { configure } from '@funnelfox/billing';
configure({
orgId: 'your-org-id', // Required: your organization ID
baseUrl: 'https://custom.api', // Optional: custom API endpoint (default is https://billing.funnelfox.com)
region: 'us-east-1', // Optional: region identifier (default is "default")
});