Skip to main content
Use the Busha Commerce SDK when you want customers to start a crypto payment flow from your website or web app. It gives you a ready-made checkout experience, so you can launch faster without building your own payment modal from scratch.
What You’ll Achieve:
  1. Install the Busha Commerce SDK.
  2. Add a pay button to your store or checkout page.
  3. Test the integration with your sandbox public key before going live.

Prerequisites

Before you begin, ensure you have:
  • A Busha Business account (from the Quick Start Guide).
  • Basic HTML and JavaScript knowledge.
  • A website or web application where you want the payment button to appear.

Live demo

Try the widget below to see the checkout flow before you integrate it:
The SDK gives you a hosted payment experience with currency conversion, multiple crypto payment options, and built-in payment confirmation handling.

Install the SDK

Busha Commerce SDK (commerce-js)

View the source code and release history on GitHub.
Choose one installation method: Option 1: CDN
<script src="https://cdn.jsdelivr.net/npm/@busha/commerce-js@1.0.17/dist/index.min.js"></script>
Option 2: npm or yarn
npm i @busha/commerce-js
# or
yarn add @busha/commerce-js
import BushaCommerce from '@busha/commerce-js'

Add the payment button

Use this example to launch the Busha checkout from your storefront:
<!DOCTYPE html>
<html>
  <head>
    <title>Kemi Stores</title>
    <script src="https://cdn.jsdelivr.net/npm/@busha/commerce-js@1.0.17/dist/index.min.js"></script>
  </head>
  <body>
    <button id="payButton">Pay with Crypto</button>

    <script>
      const BushaCommerce = window.BushaCommerce

      document.getElementById('payButton').addEventListener('click', function () {
        BushaCommerce({
          public_key: 'pub_your_public_key_here',
          quote_amount: '10000',
          quote_currency: 'NGN',
          target_currency: 'NGN',
          source_currency: 'USDT',
          devMode: true,
          meta: {
            name: 'Kemi Stores',
            email: 'orders@kemistore.com',
          },
          onSuccess: (data) => {
            console.log('Payment successful!', data)
          },
          onClose: () => {
            console.log('Payment cancelled')
          },
        })
      })
    </script>
  </body>
</html>

Find your public key

Your public key is available in the Busha Business dashboard:
  1. Log in to your Busha Business account.
  2. Go to SettingsDeveloper Tools.
  3. Copy your Public Key (it starts with pub_).
Public key highlighted in settings
Use your sandbox public key for testing and your production public key for live payments.

Test before going live

Before you switch to production:
  1. Set devMode: true.
  2. Use your sandbox public key.
  3. Test a complete payment flow with a small amount.
  4. Confirm your onSuccess callback runs as expected.
  5. Check that the payment appears in your Busha dashboard.
BushaCommerce({
  public_key: 'pub_sandbox_key_here',
  quote_amount: '1000',
  quote_currency: 'NGN',
  target_currency: 'NGN',
  source_currency: 'USDT',
  devMode: true,
  meta: {
    name: 'Kemi Stores',
    email: 'orders@kemistore.com',
  },
  onSuccess: (data) => {
    console.log('Payment successful!', data)
  },
  onClose: () => {
    console.log('Payment cancelled')
  },
})

Configuration reference

Required settings

ParameterTypeDescription
public_keystringYour Busha Business public key (starts with pub_)
quote_amountstringAmount to charge, for example 10000
quote_currencystringCurrency for the quoted amount, for example NGN
source_currencystringAsset the customer pays with, for example USDT
target_currencystringCurrency the payment settles into
onSuccessfunctionRuns when the payment succeeds
onClosefunctionRuns when the checkout modal closes

Useful optional settings

ParameterTypeDescription
meta.namestringCustomer or order name shown in your integration
meta.emailstringCustomer email for order context
devModebooleanSet to true for sandbox testing
referencestringYour custom transaction reference
callback_urlstringURL to receive payment notifications
sourcestringSource label for the payment, for example website
source_idstringInternal ID tied to the payment source in your app

What’s Next?