Key features
- Type-safe: Complete TypeScript definitions ship with the package.
- Dynamic pricing: Switch the price point without reloading the page.
- Event-driven: Handle success, errors, and state changes with events or callbacks.
- Taxes: Get the total with tax as the buyer’s location changes.
- Decline codes: Tell an insufficient-funds decline apart from other failures.
- On-demand loading: The SDK loads Primer and Stripe only when a checkout needs them.
- Browser support: Chrome 60+, Firefox 55+, Safari 12+, Edge 79+. Internet Explorer is not supported.
Choose your integration
The SDK offers three ways to build a checkout:Drop-in checkout
createCheckout() renders every available payment method in one
container. Runs on Primer.Individual methods
Billing.initMethod() renders the card form and each payment button into
your own layout. Runs on Primer.Stripe
Billing.stripe renders a Stripe card form and opens Apple Pay or Google
Pay. Runs on Stripe directly.Get started
1. Install
Install the SDK from a CDN or from npm.- CDN
- NPM
Include the SDK script. It adds a global
Billing object to the page:sdk.primer.io when a checkout needs it.
2. Create your first checkout
Create a checkout for a price point and a customer, and render it on your page:string
required
Your organization’s ID.
string
required
The price point identifier.
object
required
Customer information (requires
externalId and email).string
required
A CSS selector for the DOM element where the checkout form will be mounted.
createCheckout(), the checkout form appears in the
container, ready for the buyer to pay.
If FunnelFox Payments Taxes is on for your organization, the checkout doesn’t
show tax. Update your prices from
onTaxChange. Learn more about
taxes in the Web SDK.Your checkout is live, and buyers can now pay on your page.
