Bolt JavaScript SDK
Open Bolt checkout links and reward ads from a web game built with React, Vue, or plain JavaScript.
@boltpay/bolt-js is the browser client for Bolt Gaming. Your backend creates a payment link, and the SDK opens it for the player without sending them away from your game. It also opens reward ads.
This package is for games. It does not provide the browser client for Custom Cart, which loads Bolt's hosted scripts instead.
What you need
- A web game or web app built with React, Vue, Angular, or plain JavaScript.
- Your own backend server, in any language, to create payment links and receive webhooks.
- A Bolt merchant account with gaming enabled. Create a sandbox account to build against.
What it does
Call BoltSDK.initialize({ gameId, publishableKey, environment }) once before anything else. BoltSDK is the package's only export.
| Capability | Call | Use it for |
|---|---|---|
| Checkout | BoltSDK.gaming.openCheckout(checkoutLink) | Opening a payment link you created on your backend. Resolves with a PaymentLinkSession. |
| Reward ads | BoltSDK.gaming.openAd({ onClaim }) | Showing an ad and granting a reward when the player claims it. Resolves with a status of success or error. |
The SDK does not create payment links. That is a server call your backend makes with your API key. See Create payment link.
Next steps
- JavaScript SDK quickstart: install the package and open your first checkout link.
- Checkout quickstart: create the sandbox account, API keys, payment link, and webhook your client depends on.
- bolt-frontend-sdk on GitHub: source, sample integration, and release history.