If you’re looking for information on how to integrate the SDK, check out our

Universal Checkout integration guide.

Please review the Content Security Policy (CSP) recommendations before installing!

Our Web SDK is available on npm under the name @primer-io/checkout-web.

This package includes TypeScript definitions.

BASH
# with yarn
yarn add @primer-io/checkout-web

# with npm
npm i @primer-io/checkout-web

Then import Primer in your application

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

// for example
Primer.showUniversalCheckout(clientToken, {
  /* options */
});

With our CDN

Include the Primer.min.js script on the page where you want the checkout to be rendered. Ensure that you’re providing the desired version in the script tag. For example, using v2.54.0:

HTML
<link rel="stylesheet" href="https://sdk.primer.io/web/v2.54.0/Checkout.css" />
<script
  src="https://sdk.primer.io/web/v2.54.0/Primer.min.js"
  integrity="sha384-0B3ueZFxmu2UUoySWqoIfdHcyMpJX4tMQNztZRSTNUuGlKtTYK/EAbdt+6uSbxos"
  crossorigin="anonymous"
></script>

Primer.min.js will add the Primer object to the global scope.

TS
const { Primer } = window;

// for example
Primer.showUniversalCheckout(clientToken, {
  /* options */
});