Docs Start here

Set up Relia with your AI assistant

Ask your AI assistant to "Set up Relia in this repository". It reads your code, asks you two questions, shows every change before writing, and checks that data arrives.

This is the fastest way to set Relia up: your AI assistant (Claude Code, Cursor, Codex, VS Code and others) does the work in your editor, and you approve each change.

Before you start

Steps

  1. Ask your assistant:

    Set up Relia in this repository
    
  2. Pick or create the project. If you have several Relia projects, the assistant picks the one for this code or asks you. If the app has no project yet, it asks whether to create one. Nothing is created until you say yes.

  3. Answer two questions.

    • Record screen replays? Usually no. Relia learns from clicks, pages and errors and doesn't need recordings.
    • Tell Relia who your users are? Usually yes, so incidents can say which customers were hit. See Identify your users.
  4. Review the changes. The assistant reads your code (for example an Express API and a React app), then shows every file it will add or change before it writes anything.

  5. Run one command yourself for readable browser errors:

    npx relia-sdk@latest token
    

    It creates an upload-only token so error stack traces map back to your real files and lines. It is written to .env.local as RELIA_TOKEN and your assistant never sees it.

  6. When you deploy, copy the Relia values from .env.local into your hosting settings (environment variables on Vercel, Render, Railway and so on).

Check it worked

Start your app and click around, then ask:

Check my Relia setup

The assistant reports what has arrived: requests, visits, source maps and signed-in users. The same checklist turns green on your project's Setup tab in Relia. The first data usually shows within a minute.

What to do next

  • Teach Relia what your product does and what must never break, like checkout. Problems there go straight to the top.
  • Choose how Relia reaches you: urgent problems right away, plus a short daily summary. Add Slack if your team lives there.
  • From now on, ask your assistant "what needs me?", "how do I fix it?", and after deploying a fix, "mark it fixed" so Relia confirms it on real traffic.

If something's wrong

Instructions for AI assistants

If you are an AI assistant setting Relia up for a user, follow this order:

  1. Connect to Relia's MCP server (https://devreliaapi.tryrelia.com/mcp, OAuth sign-in) if it isn't connected. Ask the user to run npx -y relia-sdk@latest mcp install if needed.
  2. Call relia_projects. Use the project whose id is in this repository (RELIA_PROJECT_ID in .env.local, or project_id in src/relia.ts / relia.tracing.js). If there is none, ask the user whether to use an existing project or create one with relia_create_project (only after they say yes, with confirm: true).
  3. Call relia_setup with the project. It returns this project's exact steps for the code in the repository, including its id and ingest key.
  4. Ask the user the two questions from relia_setup (screen replays, identifying users) before changing anything.
  5. Show every change before writing it. Never commit on the user's behalf.
  6. Never ask for, read or print the upload token. The user runs npx relia-sdk@latest token themselves.
  7. After the user has started the app and used it, call relia_check_setup and report what has arrived and what is left.

Without MCP, the same setup runs from a terminal with npx relia-sdk@latest init (Node.js and browser apps) or pip install relia-sdk then python -m relia (Python). For other stacks see Set up your stack.

Last checked against the product: 1 Nov 2026