@adquest/sdk
v1.0.6
Published
AdQuest lottery-first SDK with headless client and React UI components
Readme
AdQuest SDK
Publishable TypeScript SDK for integrating AdQuest lotteries and quests into host applications.
Version 1.0.0 is lottery-first. Participant balances, lottery entries, and claims require a short-lived participantToken issued by your host backend.
The integration guides, API reference and SDK reference live in the AdQuest documentation, which is the single public source:
Install
npm install @adquest/sdkFor local development in this monorepo:
npm install ../adquest-sdkUsage
import { AdQuestWidget } from "@adquest/sdk/react";
import "@adquest/sdk/styles.css";
<AdQuestWidget
apiKey={process.env.NEXT_PUBLIC_ADQUEST_PLATFORM_API_KEY!}
baseUrl={process.env.NEXT_PUBLIC_ADQUEST_API_URL!}
externalUserId={session.externalUserId}
participantToken={session.participantToken}
/>The participant token comes from your backend, which creates it with the Secret Key. Never put the Secret Key in browser code. See Participant sessions, React & Next.js, Headless JavaScript, Hosted iframe & WebView, Language and country and the changelog (including migration from 0.3.x).
Bridge helpers
@adquest/sdk also exports the versioned bridge used by the hosted embed (BRIDGE_VERSION, createReadyMessage, installBridgeGlobal, postToHost, receiveBridgeMessage, subscribeBridge). Hosts that use the hosted embed URL do not need them. See Bridge messages.
Package Exports
@adquest/sdk@adquest/sdk/react@adquest/sdk/styles.css
Scripts
npm run typecheck
npm test
npm run build
npm pack --dry-run