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

# Cashback SDK

> Add cashback offers, member sign-in and tracked affiliate links to your website with the Cashback Hive SDK — a 10 KB script tag for publishers.

The Cashback Hive SDK is a small (\~10 KB) browser script that lets publishers surface cashback offers to their audience, let members sign in, and send shoppers to retailers through tracked links so purchases are attributed to you.

You load it once with a script tag, and it exposes a single global, `window.CashbackHive`.

```html theme={null}
<script
  src="https://sdk.cashbackhive.com/sdk.js"
  data-key="cbh_pk_your_publishable_key"
  async
></script>
```

## What you can build

> [card] [Offers](https://developer.cashbackhive.com/widgets/offers.md)
>
> List and search the cashback offers available to your property, with logos, categories and rates.

> [card] [Activate](https://developer.cashbackhive.com/widgets/activate.md)
>
> Let visitors sign in as Cashback Hive members so their purchases earn cashback, and show their balances.

> [card] [Click tracking](https://developer.cashbackhive.com/guides/click-tracking.md)
>
> Send shoppers to retailers through tracked links with your own click IDs and sub-IDs.

> [card] [Events](https://developer.cashbackhive.com/reference/events.md)
>
> React to sign-in changes and clicks from anywhere on your page.

## How it works

1. You add the script tag with your **publishable key** (`cbh_pk_…`). The key is bound to the origins you register in the publisher portal, so it is safe to ship to browsers.
2. The SDK reads the key from the script tag, initialises itself, and dispatches a `cbh:ready` event on `window`.
3. Your code waits for `cbh:ready`, then calls methods such as `offers.list()`, `auth.signIn()` or `openOffer()`.

> [!NOTE]
>
> The SDK is framework-agnostic. It works with plain HTML, React, Next.js, Vue, Svelte, or any site that can load a script tag — including through Google Tag Manager.

## Next steps

> [card] [Quickstart](https://developer.cashbackhive.com/quickstart.md)
>
> Get offers rendering on a page in five minutes.

> [card] [Keys and allowed origins](https://developer.cashbackhive.com/concepts/keys-and-origins.md)
>
> Understand publishable keys and where the SDK is allowed to run.

> [card] [Installation](https://developer.cashbackhive.com/installation/html.md)
>
> Framework-specific install guides.

> [card] [API reference](https://developer.cashbackhive.com/reference/configuration.md)
>
> Every method, option, event and type.


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