AdQuest ships as a lottery-first SDK with quests inside the same experience. Hosts never put the platform secret in the browser. Instead, your backend mints a short-lived participant token and the client initializes with the public platform key.
The two integration paths
Hosted embed
Open https://sdk.adquest.io/{publicId} in an iframe or WebView. Branding loads from public config. After adquest:ready, send adquest:init with apiKey, externalUserId, and participantToken.
React widget
Install @adquest/sdk, import @adquest/sdk/styles.css, and render AdQuestWidget with the same credentials. Use QuestWidget when you only need quests.
Participant sessions
On your server:
POST /api/v1/platform/participant-sessions
X-AdQuest-Platform-Secret: YOUR_PLATFORM_SECRET
Content-Type: application/json
{
"external_user_id": "host-user-123",
"display_name": "Ada"
}
Return participant_token to the client. Refresh it when the SDK emits onAuthRequired.
Bridge events that matter
onReady— embed is liveonComplete— quest finished; tokens may have been awardedonEntry— lottery entry purchasedonClaim— reward claim submittedonNavigate—{ view, canGoBack }for chrome that mirrors SDK navigationonClose— user asked to dismiss
Security checklist
- Keep
ADQUEST_PLATFORM_SECRETon the server only - Scope tokens per external user id
- Prefer HTTPS everywhere
- Treat client API keys as public identifiers, not secrets
Full reference lives in Developer Docs under Embed and Authentication.
