Native JavaScript/TypeScript support support for Bolt Web Payments. A programmatic way to for out-of-app purchases and subscriptions.
We also support other platforms:
JavaScript
This Repo |
Unity Unity SDK |
Unreal Engine Unreal SDK |
iOS Coming Soon π§ |
Android Coming Soon π§ |
For documentation and API reference visit our quick start guide.
Only with Bolt you get 2.1% + $0.30 on all transactions. That's 10x better than traditional app stores which take 30% of your revenue! That's the fair and transparent pricing you get with using Bolt.
Disclaimer: Fees are subject to change but will continue to remain highly competitive. See bolt.com/pricing for up to date rates and visit bolt.com/end-user-terms for end user terms and conditions.
You need 3 things to get started:
- Existing Web App: You will need a web application (React, Vue, Angular, or vanilla JavaScript)
- Backend Server: You will need to bring your own backend server (any language)
- Bolt Merchant Account: Dashboard access to manage your gaming store (signup or login)
The SDK can be installed with either npm, pnpm, bun or yarn package managers.
npm install @boltpay/bolt-js
pnpm install @boltpay/bolt-js
bun install @boltpay/bolt-js
yarn add @boltpay/bolt-js
There is a sample integration in the examples/
folder.
- main.ts: will showcase how to initialize the client and open links
You will need to bring your own backend server to complete integration.
- Quick Start: View our quickstart guide to get the API running
- Example Server: We also have a sample server in NodeJS for your reference during implementation
For TypeScript projects, the SDK provides full type definitions:
import { Charge, BoltTransactionSuccess } from '@boltpay/bolt-js'
// Transaction result type
interface BoltTransactionSuccess {
reference: string // Unique transaction reference
}
import { Charge } from '@boltpay/bolt-js'
import { useState } from 'react'
function CheckoutButton({ checkoutUrl }: { checkoutUrl: string }) {
const [loading, setLoading] = useState(false)
const handlePayment = async () => {
setLoading(true)
const transaction = await Charge.checkout(checkoutUrl)
console.log('Payment completed:', transaction.reference)
// Redirect to success page or update UI
setLoading(false)
}
return (
<button onClick={handlePayment} disabled={loading}>
{loading ? 'Processing...' : 'Pay with Bolt'}
</button>
)
}
<template>
<button @click="handlePayment" :disabled="loading">
{{ loading ? 'Processing...' : 'Pay with Bolt' }}
</button>
</template>
<script setup>
import { ref } from 'vue'
import { Charge } from '@boltpay/bolt-js'
const props = defineProps(['checkoutUrl'])
const loading = ref(false)
const handlePayment = async () => {
loading.value = true
const transaction = await Charge.checkout(props.checkoutUrl)
console.log('Payment completed:', transaction.reference)
loading.value = false
}
</script>
Get help and chat with us about anything on Discord
This project is licensed under the MIT License - see the LICENSE file for details.