Skip to main content
Primer Checkout uses platform-specific configuration to control checkout behavior, appearance, and payment handling.
Primer Checkout Web uses two types of configuration: component properties (HTML attributes) and SDK options (JavaScript object).

Configuration Overview

Don’t mix them up. Component properties must use setAttribute(). SDK options must be assigned directly to .options.

Component Properties / Client Token

The client token authenticates your checkout session. Obtain this by creating a client session.

client-token (required)

Updating the client token

To start a new session, set a new client token on the existing component. The checkout tears down the current session and initializes the new one in place, so you don’t need to reload the page or recreate the component.
This is a full re-initialization: the loader shows again, entered card details are cleared, payment methods are reloaded, and primer:ready fires again with a new PrimerJS instance. Don’t change the token while a payment is in progress.If you updated the existing client session on your server and the token hasn’t changed, call primer.refreshSession() instead. It syncs the checkout with the session without re-initializing.

custom-styles

JSON string containing CSS variables for theming.
See Styling Guide for available properties.

loader-disabled

Disables the default loading spinner.

SDK Options / Settings

SDK options configure checkout behavior. Assign a JavaScript object directly to the options property.
For the complete list of available options, see the SDK Options Reference.

Common Patterns

Set Locale

Supported locales

Enable Specific Payment Methods

Pre-fill Cardholder Name

For runtime updates after initialization, use primer.setCardholderName() instead.

Enable Vault (Saved Payment Methods)

Configure Apple Pay Button

Configure Google Pay Button

Configure Klarna

Configure Klarna via Adyen


Complete Example


Framework-Specific Patterns


Advanced Configuration

Build custom vault UIs while retaining full vault functionality. Enable headless mode:
Then use onVaultedMethodsUpdate, vault.createCvvInput(), and vault.startPayment() to build your custom UI.
Headless Vault Implementation Guide
Use your own submit button instead of the built-in one:
External Submit Button Recipe
Display the payment amount on the submit button:

See also

Web SDK Options Reference

Complete list of all available Web options

Android SDK Reference

Android SDK API documentation

Events Guide

Handle payment success, failure, and state changes

Styling

Customize colors, fonts, and spacing