Key features
- TypeScript-first: Full type definitions and JSDoc coverage out of the box.
- Dynamic pricing: Update prices on the fly without page reloads.
- Event-driven: Subscribe to lifecycle events for success, errors, and state changes.
- Production-ready: Built-in validation, retries, and structured errors.
- Lightweight: ~15KB minified with minimal dependencies.
- Browser support: Chrome 60+, Firefox 55+, Safari 12+, Edge 79+. Internet Explorer is not supported.
Get started
1. Install
You can install the Billing SDK either by including it via a CDN or by using NPM.- CDN
- NPM
Include Primer’s Universal Checkout scripts and styles, then include the FunnelFox Billing SDK script:
2. Configure
Configure the SDK once at startup with your organization info and any custom settings. Use theconfigure() function to set global options that apply to all subsequent checkout operations.
Your organization’s ID (required for all operations). Must be provided either in
configure() or in each API call.Custom API base URL if you are pointing to a non-default backend.
Deployment region to use (if applicable).
configure() once with your orgId so you don’t need to pass it every time.
If configure() is not called, you must include orgId in the options of each createCheckout or session creation call.
3. Create your first checkout
After configuring the SDK, you can create a checkout in just a few lines. For example, to create a checkout for a given price and customer and render it on your page:The price identifier for the subscription or product.
Customer information (requires
externalId and email).A CSS selector for the DOM element where the checkout form will be mounted.
createCheckout(), the Primer-powered checkout form will appear in the specified container, ready for the user to complete payment.
