Getting Started
Two paths. Pick the one that matches your host.
30-second React quick-start
-
Install.
pnpm add @questkit/react @questkit/core -
Wrap your tree with
<QuestKitProvider>. The provider owns a singleQuestKitClientfor the lifetime of your app.// src/main.tsximport "@questkit/react/styles.css";import { QuestKitProvider } from "@questkit/react";const token = "<JWT from your backend>"; // see /v1/auth/tokenexport function App() {return (<QuestKitProviderconfig={{baseUrl: "https://api.questkit.jairukchan.com",appId: "your-app-id",getToken: () => token,}}><YourApp /></QuestKitProvider>);} -
Drop in a widget.
import { MissionList } from "@questkit/react";export function YourApp() {return <MissionList limit={10} />;}
That's it. The hook subscribes to Server-Sent Events automatically, so progress and reward updates flow into the UI in real time. See the React Guide for the full component catalogue.
30-second embed quick-start
Drop two tags into any HTML page. No build step.
-
Mint a JWT on your backend (see POST /v1/auth/token) and inject it as a meta tag.
-
Add the embed script and a widget mount point.
<!doctype html><html><head><meta name="questkit-token" content="<JWT from your backend>" /></head><body><div data-questkit="MissionList" data-questkit-prop-limit="5"></div><scriptsrc="https://play.questkit.jairukchan.com/questkit.iife.js"data-questkit-app-id="your-app-id"data-questkit-user-id="usr_demo_123"data-questkit-base-url="https://api.questkit.jairukchan.com"></script></body></html>
The embed:
- Scans the DOM for
[data-questkit="<Widget>"]elements onDOMContentLoaded. - Mounts each widget inside an isolated Shadow DOM so host CSS can't leak in (and your widgets can't leak out).
- Exposes
window.QuestKitfor imperative calls (fireEvent,claim,mount,unmount,on,off).
See Embed → Quick Start for the full whitelist of 9 widgets and every data-questkit-* attribute.
What's next
- Build out your UI → React components
- Customise the look → Theming
- Wire inbound webhooks (Stripe etc.) → Webhooks
- Run it on your own Cloudflare account → Self-Hosting