Starter templates
Two small working apps with a complete Relay integration: consent, tasks, events and an outcome your server confirms. About 10 minutes from download to your first event.
Both are the same to-do app. A person opts in, adds and ticks off items, then presses Finish. Relay receives each step and how the task ended, never the text of the items.
Next.js
App Router and TypeScript.
Download .zip
JavaScript
Plain JavaScript in the browser and a small Node server. No build step.
Download .zip
1. Set up your app in the dashboard
- Create an app and choose the Productivity category. The starter sends to-do activity, which matches that category's schema.
- Publish the consent screen on the app's Consent tab.
- Under Environments & keys, add
http://localhost:3000to the development environment's allowed addresses. - Create a backend key for development. It's shown once, so copy it straight away.
2. Add your keys and run it
Unzip the starter, paste your development public key and backend key into the env file, then:
Next.js
terminal
cp .env.example .env.local
npm install
npm run devJavaScript
terminal
cp .env.example .env
npm install
npm startYou need Node.js 20.6 or newer.
3. Send your first event
- Open http://localhost:3000, press Choose, then Contribute.
- Add a couple of items, tick one off and press Finish.
- In the dashboard, the getting-started checklist ticks off Send your first event, and the task appears under Trajectories, marked verified.
Making it yours
- Users. The starters give each browser a random id in place of sign-in. Pass your real user id or session id to
relay.attest(). - Events. If your app is in another category, copy its task types and actions from the app's Collection schema tab. See Tasks and outcomes.
- Outcomes. Confirm how each task ended from data your server trusts, such as an order being placed.
Both starters use development keys. Data collected with them is for testing and is never included in a dataset.