> ## 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.

# Plain HTML

> Install the Cashback Hive SDK on a static or server-rendered HTML site with a single script tag, then call the API once the cbh:ready event fires.

Add the script tag to every page that needs the SDK — typically in a shared layout or footer include.

```html theme={null}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My site</title>
  </head>
  <body>
    <!-- your page -->

    <script
      src="https://sdk.cashbackhive.com/sdk.js"
      data-key="cbh_pk_your_publishable_key"
      async
    ></script>
    <script>
      window.addEventListener("cbh:ready", ({ detail: { sdk } }) => {
        // use sdk
      });
    </script>
  </body>
</html>
```

## Placement

The tag can go in `<head>` or at the end of `<body>`; because it's `async`, it won't block rendering either way. Putting it in `<head>` starts the download slightly earlier.

## Attributes

| Attribute | Required | Description |
| - | - | - |
| `src` | Yes | Always `https://sdk.cashbackhive.com/sdk.js`. Don't self-host the file — you'd miss updates. |
| `data-key` | Yes\* | Your publishable key. Triggers auto-initialisation. |
| `async` | Recommended | Don't block HTML parsing while the script downloads. |
| `data-mock` | No | Enable [mock mode](https://developer.cashbackhive.com/guides/local-development.md) for offline development. |
| `data-debug` | No | Log SDK activity to the console. |

\* Omit `data-key` only if you plan to call [`CashbackHive.init()`](https://developer.cashbackhive.com/reference/configuration#manual-initialisation) yourself.

## Subresource integrity

The SDK is updated in place at the same URL so publishers receive fixes without redeploying. Because of this, **don't** add an `integrity` attribute — it would break on every SDK release.

## Content Security Policy

If your site sets a CSP, allow the SDK host in `script-src` and `connect-src`. See [Content Security Policy](https://developer.cashbackhive.com/guides/content-security-policy.md).


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