If you're looking for information on how to integrate the SDK, check out our
Universal Checkout integration guide.
With npm (recommended)
Our Web SDK is available on npm under the name @primer-io/checkout-web
.
This package includes TypeScript definitions.
12345
# with yarnyarn add @primer-io/checkout-web # with npmnpm i @primer-io/checkout-web
bash
copy
Then import Primer
in your application
123456
import { Primer } from '@primer-io/checkout-web' // for examplePrimer.showUniversalCheckout(clientToken, { /* options */})
ts
copy
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.0.0
:
123
<link rel="stylesheet" href="https://sdk.primer.io/web/v2.0.0/Checkout.css" /> <script src="https://sdk.primer.io/web/v2.0.0/Primer.min.js" crossorigin="anonymous"></script>
html
copy
Primer.min.js
will add the Primer
object to the global scope.
123456
const { Primer } = window // for examplePrimer.showUniversalCheckout(clientToken, { /* options */})
ts
copy