> ## Documentation Index
> Fetch the complete documentation index at: https://docs.busha.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Stablecoin with SDK Integration

> Add Busha checkout to your website and start receiving stablecoin payments faster

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.

> [!TIP]
>
> **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](https://docs.busha.io/guides/getting-started/quick-start.md)).
* 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:

[Busha Commerce SDK Demo](https://payment-link-demo-chi.vercel.app)

> [!TIP]
>
> The SDK gives you a hosted payment experience with currency conversion,
> multiple crypto payment options, and built-in payment confirmation handling.

## Install the SDK

> [card] [Busha Commerce SDK (commerce-js)](https://github.com/bushaHQ/commerce-js)
>
> View the source code and release history on GitHub.

Choose one installation method:

**Option 1: CDN**

```html theme={null}
<script src="https://cdn.jsdelivr.net/npm/@busha/commerce-js@1.0.17/dist/index.min.js"></script>
```

**Option 2: npm or yarn**

```bash theme={null}
npm i @busha/commerce-js
# or
yarn add @busha/commerce-js
```

```javascript theme={null}
import BushaCommerce from '@busha/commerce-js'
```

## Add the payment button

Use this example to launch the Busha checkout from your storefront:

```html theme={null}
<!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 **Settings** → **Developer Tools**.
3. Copy your **Public Key** (it starts with `pub_`).

![Public key highlighted in settings](https://mintcdn.com/busha-36f167ef/TPgq_F3PIb361nQH/images/get-public-key.png?fit=max\&auto=format\&n=TPgq_F3PIb361nQH\&q=85\&s=749d739ec8fe0724763e8e5518bf2fc8)

> [!TIP]
>
> 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.

```javascript theme={null}
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

| Parameter | Type | Description |
| - | - | - |
| `public_key` | string | Your Busha Business public key (starts with `pub_`) |
| `quote_amount` | string | Amount to charge, for example `10000` |
| `quote_currency` | string | Currency for the quoted amount, for example `NGN` |
| `source_currency` | string | Asset the customer pays with, for example `USDT` |
| `target_currency` | string | Currency the payment settles into |
| `onSuccess` | function | Runs when the payment succeeds |
| `onClose` | function | Runs when the checkout modal closes |

### Useful optional settings

| Parameter | Type | Description |
| - | - | - |
| `meta.name` | string | Customer or order name shown in your integration |
| `meta.email` | string | Customer email for order context |
| `devMode` | boolean | Set to `true` for sandbox testing |
| `reference` | string | Your custom transaction reference |
| `callback_url` | string | URL to receive payment notifications |
| `source` | string | Source label for the payment, for example `website` |
| `source_id` | string | Internal ID tied to the payment source in your app |

## What's Next?

* [Accept Stablecoin with Payment Links](https://docs.busha.io/guides/accepting-stablecoin-payments/payment-links.md) - Use a hosted checkout when you do not want to build a website flow yet.
* [Quick Start Guide](https://docs.busha.io/guides/getting-started/quick-start.md) - Set up your Busha Business account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.