showUniversalCheckout(
    clientToken: string,
    options: UniversalCheckoutOptions
): Promise<PrimerCheckout>

Showing Drop-in Checkout is the simplest way to integrate with Primer. With just a few lines of code, you can display a fully in-context checkout UI with all your payment methods.

Availing Drop-In Checkout is as easy as implementing one line of code.

import { Primer } from "@primer-io/checkout-web";

const checkout = await Primer.showUniversalCheckout(clientToken, {
  container: "#container",
  onCheckoutComplete(...args) {
    console.log("onCheckoutComplete", ...args);
  },
});

Note that there are more options which can be passed to Drop-In Checkout. Please refer to the section below for more information.

Parameters

Returns