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.

1. Set up your app in the dashboard

  1. Create an app and choose the Productivity category. The starter sends to-do activity, which matches that category's schema.
  2. Publish the consent screen on the app's Consent tab.
  3. Under Environments & keys, add http://localhost:3000 to the development environment's allowed addresses.
  4. 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 dev

JavaScript

terminal
cp .env.example .env
npm install
npm start

You need Node.js 20.6 or newer.

3. Send your first event

  1. Open http://localhost:3000, press Choose, then Contribute.
  2. Add a couple of items, tick one off and press Finish.
  3. 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.