Skip to main content
Directly invokes Primer’s Universal Checkout UI using an existing client token. This is an advanced method to manually control when and how the checkout appears (for example, if you created a client token via createClientSession or received one from your backend).

Parameters

clientToken
string
required
A client token previously obtained from createClientSession or your backend.
options
object
required
Configuration options for the Primer Universal Checkout.

Returns

A Promise that resolves when the Primer checkout is displayed (and typically yields a Primer checkout instance or result, depending on usage).

Example

import { showUniversalCheckout } from '@funnelfox/billing';

const primerCheckout = await showUniversalCheckout(clientToken, {
  container: '#checkout',
  onTokenizeSuccess: async (data, handler) => {
    // Handle payment...
    handler.handleSuccess();
  },
});
I