Leveling
Setup
Activity XP and a level ladder for a Planeward community. Members see their level and the leaderboard in an app channel; staff edit the ladder and XP rules in the dashboard. Each level is a Planeward badge.
Run it in the local emulator
A local Planeward host, API and webhooks. No account or tunnel needed.
- Start Postgres with
pnpm db:upand runpnpm --filter @repo/leveling db:migrate. - Stop this server and run
pnpm --filter @repo/leveling dev:emulatorfrom the repo root. It starts the app with localPLANEWARD_*credentials and opens the emulator. - Trigger
community.message.createdfrom the Activity panel, then watch XP, levels and badges change.
Environment
Read from this app’s .env locally, or the Worker’s secrets when deployed. Postgres is the HYPERDRIVE binding in wrangler.jsonc, not a variable. Values are never shown. Everything is set.
PLANEWARD_APP_IDSetPLANEWARD_APP_SECRETSetPLANEWARD_WEBHOOK_SECRETSetPLANEWARD_BASE_URLSet
Register in Planeward
In Planeward: Apps › All apps › Create app. Built from this request’s host. Use your public HTTPS domain in production. Steps, browsers and webhooks:
docs/going-live.md.Scopes to request
The same scopes as
planeward.json, which the emulator grants.COMMUNITY_MEMBERS_READMembership webhooks (hide lapsed members), names and the dashboard member listCOMMUNITY_MESSAGES_READMessage and reaction webhooks for chat XPCOMMUNITY_MESSAGES_WRITEPost level-up messages in a chat channelCOURSES_READLesson and course completion webhooksEVENTS_READEvent attendance webhooksCOMMUNITY_BADGES_WRITEOne level badge per member (level-1, level-2…)COMMUNITY_NOTIFICATIONS_WRITETell a member when they reach a new level