Skip to main content

Prerequisites

You’ll need your clientToken to initialize Primer Checkout. See our Client Session guide on how to create a client session and retrieve a clientToken first.

Environment Requirements

Before diving into the implementation, ensure your environment meets these requirements:

Minimum Browser Versions

The SDK requires ES2020 support. Minimum supported browser versions:
Legacy browsers like Internet Explorer 11 aren’t officially supported due to their non-standard DOM behavior and lack of support for modern Web Component features and ES2020 syntax that this SDK is built on.

Install the SDK

Install the Primer SDK using your preferred package manager:
@primer-io/primer-js is installed via a package manager. Pick whichever you use. npm, yarn, and pnpm are all supported.

Load and initialize

Import and initialize Primer in your application:

Add the checkout component

Create a basic checkout by adding the primer-checkout component to your page:

Verify installation

Check that components are registered correctly in your browser console:

Framework-specific setup

Server-Side RenderingIf you’re using Next.js, Nuxt, SvelteKit, or any SSR framework, you must load Primer only on the client side. The Web Components API doesn’t exist in Node.js.
See the SSR Guide for complete patterns.

See also

First Payment

Accept your first payment

Styling

Customize the appearance

Layout

Control component arrangement

Core Concepts

Understand the architecture