Missions
A Mission is a goal a user can complete. Every mission has:
- A
MissionCriteria— which event counts, how many, and (optionally) a time window or payload filter. - A
Reward— currency, badge, or item granted on claim. - An optional
campaignIdandexpiresAtso missions can be grouped into time-bounded promotions.
The QuestKit rule engine listens to incoming events, evaluates each criterion against the user's history, and writes a MissionProgress row. When progress.status transitions to completed, the user can call POST /v1/missions/:id/claim to mint the reward.
event ─┐ ┌─ locked (not unlocked yet)
│ │
▼ ▼
┌──────────────┐ matches ┌──────────────┐ threshold
│ rule engine │──────────────►│ active │──reached────► completed ──claim──► claimed
└──────────────┘ criteria └──────────────┘ │
│
reward minted
Statuses
| Status | Meaning |
|---|---|
locked | Prerequisites not met (e.g. mission belongs to a future campaign window) |
active | Counting toward the threshold |
completed | Threshold reached, reward not yet claimed |
claimed | Reward minted, balance updated |
Windows
Criteria can specify a window:
daily— resets every UTC midnightweekly— resets every Monday UTClifetime— never resets
Filters
criteria.filter accepts a map of payload-path → FilterClause (eq, gte, lte, gt, lt, in). Events that don't match every clause are ignored.
See the Mission and MissionCriteria types for the authoritative TypeScript surface.