Set up Relia
One command, or let your AI assistant do it. Relia finds what your app is made of and sets it up. About five minutes.
The SDK is relia-sdk on npm and PyPI, and tryrelia/relia on Packagist for PHP. You need a free Relia account (create one, or sign up from the terminal during setup) and Node.js 18+, Python 3 or PHP 8.1+.
- In your terminalOne commandSigns you in, finds your API and web app, asks two questions, writes the files.
npx relia-sdk@latest init # Python: python -m relia # PHP: composer require tryrelia/relia - In Claude Code, Cursor or VS CodeYour AI assistant does itConnect Relia once, then say one sentence. It shows every change before writing it.
“Set up Relia”
One command
Open a terminal in your app's folder.
Run the setup
Terminal npx relia-sdk@latest initPython apps:
pip install relia-sdk, thenpython -m relia. Laravel apps are found by the same command; without Node.js usecomposer require tryrelia/relia, thenphp artisan relia:install. Run it once per app: in a repository with a separate API and web app folder, run it in each.Pick your project, press Enter, answer two questions
What you see ? What should Relia set up? ❯ Everything Relia found here: Express API + React app (Vite) ? Project: › My shop ? Also record screen replays for this app? (y/N) Relia learns from clicks, pages and errors; it doesn't need screen recordings. ? Tell Relia who your users are? (Y/n) Incidents then say "3 customers on Pro" instead of "3 visitors". ✔ relia.tracing.js loaded first in server.js ✔ src/relia.ts imported in src/main.tsx ✔ vite.config.ts source maps upload on every build ✔ .env.local RELIA_TOKEN (can only upload source maps)It sets up everything it found: your API (Express, Fastify, NestJS, Koa, Hapi, Hono), your web app (React, Vue, Svelte, Solid, Preact) or your Next.js app with its AI calls. Want only one part? Pick it instead of “Everything”. If you said yes to users, it prints the two lines to add where sign-in finishes.
Restart your app and use it once
Open a page or call an endpoint. Then see what arrived (next section).
With your AI assistant
Claude Code, Cursor or VS Code edits your code for you, with your approval. Relia only gives it the steps and checks the result.
Create a token in Relia
Your project's Settings, Advanced, Integrations, Use Relia in your AI assistant. One token is for one project.
Connect it inside this project's folder
Claude Code, in your project's folder claude mcp add --transport http relia https://devreliaapi.tryrelia.com/mcp --header "Authorization: Bearer relia_mcp_…"Connect it per project, not globally: a global setup would show this project's incidents in every other repository. Cursor and VS Code: the per-project files.
Say “Set up Relia”
Your assistant asks you the same two questions (screen replays, your users), shows every change, then asks you to start the app and checks that data arrives. With yes to users, it also finds your sign-in code and adds the lines there.
Check it worked
Your project's Setup tab answers “Is Relia receiving everything?” and updates by itself.
- Every API request, error and slow call, per service
- What people do in your web app: clicks, pages, forms, where they get stuck
- Database calls, outgoing calls and AI-agent runs
- Browser errors that point at your own files (source maps)
- Alerts by e-mail from the start; Slack and others when you add them
Each part turns green as its first data arrives, and anything missing says the one step left. Your AI assistant can check the same: “Is Relia receiving everything?”.
Hosted builds: one value to copy
Only if Vercel, Netlify, Render or a CI builds your web app.
The setup wrote RELIA_TOKEN to .env.local (kept out of git). Your host builds without that file, so add RELIA_TOKEN with the same value in its environment variables. It can only upload source maps for this one project. Until then hosted builds still succeed; they skip the upload and keep your source private. Lost the value? Run npx relia tokenin the app's folder.
Know who your users are
Optional. Incidents then say “3 customers on Pro” instead of “3 visitors”.
In the browser
Where sign-in finishes, and on sign-out import { Relia } from "relia-sdk" Relia.identify(user.id, { email: user.email, name: user.name, plan: user.plan }) // on sign-out, so the next person on this browser isn't mixed up with them Relia.reset()Call
identifyagain with the same id when a plan, e-mail or name changes (for example right after a checkout): only what you pass changes, the rest is kept, and the People page keeps the plan history. Sessions this browser had before signing in are added to the same person. Anything that looks like a password, token or card number is dropped on the device and again on our servers.On your server
Node.js (Express reads req.user.id by itself) require("relia-sdk/node").setUser(req, { id: user.id, plan: user.plan })Python import relia relia.set_user(user.id, plan=user.plan)PHP (Laravel sends the signed-in user's id by itself) \Relia\Relia::setUser(auth()->id(), $user->plan);Servers send only the id and the plan, never an e-mail. Identities never go to the AI, alert e-mails or Slack, and an owner can export or erase anyone from the People page.
Source maps by hand
The setup does this for Vite and for apps with a build script. Otherwise:
npx relia sourcemaps upload ./dist --project-id your-project-idMaps are matched by the bundle's file name, so no release setup is needed, and they are removed from the output after the upload. Next.js: turn on productionBrowserSourceMaps and run the command after next build.
Already using OpenTelemetry
Relia adds itself to the tracer provider you already run instead of starting a second one. If it can't (Node), it prints the OTLP endpoint and project id to add to your own exporter.
Turning an instrumentation off
List the ones to skip in an environment variable, separated by commas.
RELIA_DISABLE_INSTRUMENTATIONS=fastify,bullmqNode.js APIs
Express, Fastify, NestJS, Koa, Hapi, Hono and anything else on Node.
The setup writes relia.tracing.js, loads it first in your entry file and, for Express, adds the middleware that records errors with their stack traces. Fastify, BullMQ, NestJS, Koa, Kafka, GraphQL, outgoing HTTP calls and database clients are traced with no extra code.
require("relia-sdk/node").start({
serviceName: "my-api",
projectId: "your-project-id",
key: "relia_live_…",
})Next.js
The setup writes instrumentation.ts (in src/ when your app lives there), which starts Relia in the Node.js runtime; one you already have is never overwritten, the setup prints the lines to add instead. With the Vercel AI SDK, every streamText and generateText call is recorded too. Next.js 13 and 14 also need experimental.instrumentationHook in next.config.
Web apps
Clicks, pages, forms, errors and page speed from real visitors.
import { Relia } from "relia-sdk"
Relia.init({
project_id: "your-project-id",
key: "relia_live_…",
service_name: "my-app-web",
captureText: false,
replay: false,
})What people type or read is not captured, and screen replay stays off unless you say yes during setup.
Python
FastAPI, Django, Flask, Celery, requests and httpx.
from relia_tracing import init_tracing, setup_fastapi
init_tracing()
from fastapi import FastAPI
app = FastAPI()
setup_fastapi(app) # for Flask: setup_flask(app)python -m relia writes relia_tracing.py and patches your entry file when it can; the lines above are what it adds.
PHP and Laravel
Laravel, plain PHP and shared hosting: pure PHP 8.1+, no extension to install.
composer require tryrelia/relia
php artisan relia:installrelia:install asks for your project id and key and writes the RELIA_* lines to .env. There is no middleware or provider to add: every request (with its route, like /orders/{id}), the error behind a 500, database queries (values removed), calls made with Laravel's HTTP client, queue jobs and warning or error logs reach Relia after each response. For the browser part, npx relia-sdk@latest init wires your Vite app, or put @reliaScript in your main Blade layout.
\Relia\Relia::start(["projectId" => "your-project-id", "serviceName" => "shop"]);Go, Rust, Java and other languages
Through OpenTelemetry, the open standard: a few lines of setup instead of one command, and nothing in your code tied to Relia.
OTEL_EXPORTER_OTLP_ENDPOINT=https://devotel.tryrelia.com
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=x-relia-key=relia_live_…
OTEL_RESOURCE_ATTRIBUTES=relia.project_id=your-project-id,deployment.environment.name=production
OTEL_SERVICE_NAME=api
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=noneAlready using OpenTelemetry(with Datadog, Honeycomb, Grafana…)? These settings are all you change. Otherwise add your language's official setup: Go with otelhttp and otelsql, Rust with tracing-opentelemetry and an axum middleware, Java and Kotlin with no code change through the OpenTelemetry Java agent (-javaagent:opentelemetry-javaagent.jar), .NET and Rubywith their OpenTelemetry packages. Go, Rust and Java are tested end to end; the exact code for each, with your project's values filled in, is in the app's Setup guide, and your AI assistant can write it for you. Incidents, the APIs page, database queries and fix plans then work the same as with the one-command setups.
Supabase, Firebase and edge functions
Apps with no server of their own: the browser talks to Supabase or Firebase, and the logic runs in functions.
The web app is set up like any web app, with npx relia-sdk@latest init. Every Supabase table read and write then shows on the Database page as a statement without its values (SELECT id FROM orders WHERE email = ?), a write refused by a row level security policy is named as such, sign-ins are counted, and Firebase errors (security rules, quotas) are said in plain words.
import { withRelia } from "npm:relia-sdk/edge" // Workers: from "relia-sdk/edge"
Deno.serve(withRelia(async (req) => {
// your handler, unchanged
}))require("relia-sdk/node").start({ serviceName: "shop-functions", projectId: "your-project-id" })Each function call is a request named after the function, its database calls (Supabase, Firestore) are database calls, and the data is sent before the function finishes, so nothing is lost when the platform stops it. Inside your Supabase database(optional): slow queries as Postgres measures them, scheduled jobs (pg_cron) that fail or stop running, and connections running out, read with a statistics-only login that can't see your data.
AI agents
Each model call is recorded as an agent run, linked to the request it ran in.
Next.js with the Vercel AI SDK
Found and set up by npx relia-sdk@latest init. Every streamText and generateText call is recorded, with no code change.
Other Node apps
Run npx relia-sdk@latest init and choose Agent monitoring. It writes relia.agent.js; call reportRun(…) from it after each model call.