Key features
- Type-Safe: Complete TypeScript definitions and type safety.
- 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 Headless Checkout scripts and styles, then include the FunnelFox Billing SDK script:
2. Create your first checkout
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:Your organization’s ID (required for all operations). Must be provided either globally in configure() or in each API call.
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.
