Your organization’s ID.
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.
Parameters
Section titled “Parameters”orgIdstringrequiredbaseUrlstringdefault: https://billing.funnelfox.comCustom API base URL if you are pointing to a non-default backend.
regionstringdefault: defaultDeployment region to use (if applicable).
Returns
Section titled “Returns”This function does not return a value. The configuration is stored globally and applied to all subsequent SDK operations that use it.
Override per call
Section titled “Override per call”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.
Example
Section titled “Example”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")});