Available widgets
Offers
Browse and search the cashback offers available to your property, and send shoppers to retailers via tracked links.Uses:
offers.list(), offers.get(), openOffer(), trackingUrl()Activate
Let a visitor sign in as a Cashback Hive member so their purchases earn cashback, and show their balances and activity.Uses:
auth.*, member.*, the auth:change eventReference implementations
Each widget page includes a complete, copy-pasteable implementation in two flavours:- Vanilla JavaScript — framework-free, for static sites, CMS templates and tag managers.
- React / Next.js — a Client Component built on the
useCashbackHive()hook.
Common structure
Every widget follows the same three steps:- Wait for the SDK. Use the
cbh:readyevent orinitializedcheck described in Lifecycle. Never call the SDK before this. - Call the SDK and render. Fetch data (
offers.list(),member.get()) and render it. Handle the loading, empty and error states — in particular a403from the API means the current origin isn’t allowed. - Subscribe to changes. Use
sdk.on("auth:change", …)so the widget reflects sign-in/sign-out that happens elsewhere on the page (another widget, another tab, or the SDK’s background token check on load).