TL-M0-22 · The Sentry project for apps/web
Why: v2 reports its errors to Sentry, with one project for each deployed app, and staging and production as that project's environments (D24). This step makes the Sentry organization and the opleet-web project, and puts the values the SDK will read into the Vercel project from TL-M0-21. The Frontend Engineer wires the SDK into apps/web in FE pack F (row 34a). Until then nothing reads these values, so this step changes nothing a user sees.
Errors can carry personal data (D15), so the organization scrubs it before storing anything: no IP addresses, and no field named like a NIK, phone or SIM number. The Vercel integration in Sentry's marketplace isn't used here: it makes its own token, hidden in an internal integration, and sets it for every environment. Here each value is set by hand, where you can see it, and the token reaches production builds only. Everything is set in the dashboards (L0).
ID TL-M0-22 · Level L0 · Run order row 34 · Issue #24
A Sentry organization, with two-factor sign-in on your account, scrubs personal data and doesn't store IP addresses. Its project opleet-web (platform Next.js) has a DSN and has received one test event. An organization token for uploading source maps sits in the password manager, and nowhere else but Vercel. The Vercel project from TL-M0-21 holds five Sentry variables: the DSN, the environment staging, the organization and project slugs on Production and Preview, and the token on Production only.
Before
Section titled “Before”- Row 33, TL-M0-21, is Done: the Vercel project deploys apps/web.
- A password manager entry named "Opleet v2 Sentry", empty for now.
- An authenticator app on your phone, for Sentry's two-factor sign-in.
- Decide the data region before block 1. Sentry keeps an organization's data in the US or in the EU (Frankfurt), and the choice can't be changed later: moving means a new organization. Neither is near Indonesia, and nothing decided so far requires one or the other. US is the default, and this page assumes it. Choose EU only if the lawyer's review of personal data (D15) asks for it.
1 · An account and the organization
Section titled “1 · An account and the organization”In the browser: sentry.io › Get Started. Sign up with your work email, or with GitHub as zuki. Then, under Create a New Organization:
- Organization name: Opleet. Keep the slug it suggests. Below, <SENTRY_ORG> is that slug.
- Data Storage Location: United States, unless you chose otherwise above.
- Plan: the free Developer plan. It allows one member, which is you, and is enough until staff testing. The plan is reviewed before cutover.
If Sentry starts a guided setup, leave it at its first screen. Block 4 creates the project.
2 · Two-factor sign-in on your account
Section titled “2 · Two-factor sign-in on your account”User settings (your avatar at the bottom left) › Account › Security › Two-Factor Authentication › Authenticator App. Scan the code with the authenticator app, then enter the six-digit code. Save the recovery codes in the "Opleet v2 Sentry" entry. Sentry shows them only once.
3 · The organization scrubs personal data
Section titled “3 · The organization scrubs personal data”Settings › Organization (Opleet) › Security & Privacy. Set these, then save. Projects inherit them, the backend's later project included (D24).
- Require Data Scrubber: on.
- Require Using Default Scrubbers: on. These remove passwords, tokens, card numbers and similar values from every event.
- Prevent Storing of IP Addresses: on.
- Global Sensitive Fields: add each of these, one per line. A field whose name contains one of these words has its value replaced before it is stored.
nikphonesim_numberaddressemergency_contactaccount_number- Allow Shared Issues: off. An issue then can't be opened by a public link.
4 · The project opleet-web
Section titled “4 · The project opleet-web”Projects › Create Project.
- Platform: Next.js.
- Alert frequency: Alert me on high priority issues. Sentry sends you an email for those.
- Project name: opleet-web. Team: the one Sentry made for the organization.
Select Create Project. Sentry opens its setup instructions, with a command that starts with npx @sentry/wizard. Don't run it: FE pack F wires the SDK in apps/web through a pull request, and the wizard would write files into your checkout. Leave the page.
5 · The DSN, into the password manager
Section titled “5 · The DSN, into the password manager”Settings › Projects › opleet-web › Client Keys (DSN). Copy the DSN and save it in the "Opleet v2 Sentry" entry. Below, it is <SENTRY_DSN>. It starts with https:// and ends with / and the project's number.
The DSN isn't a secret. It only lets an app send events to this project, and the browser sees it in every page. It still goes nowhere but the password manager and Vercel, so the only events that arrive are v2's.
6 · An organization token for source maps
Section titled “6 · An organization token for source maps”Settings › Organization (Opleet) › Developer Settings › Organization Tokens › Create New Token.
- Name: vercel-source-maps.
Sentry shows the token once. Copy it into the "Opleet v2 Sentry" entry. Below, it is <SENTRY_AUTH_TOKEN>. An organization token can only create releases and upload source maps, so it can't read errors or change settings. It is still a secret: never paste it into a terminal command, a file, an issue or a chat.
7 · The five variables in Vercel
Section titled “7 · The five variables in Vercel”In Vercel: the project from TL-M0-21 › Settings › Environment Variables. Add each one with the environments in the last column. For SENTRY_AUTH_TOKEN, turn on Sensitive, so Vercel never shows the value again.
| Key | Value | Environments |
|---|---|---|
NEXT_PUBLIC_SENTRY_DSN |
<SENTRY_DSN> | Production, Preview |
NEXT_PUBLIC_SENTRY_ENVIRONMENT |
staging |
Production, Preview |
SENTRY_ORG |
<SENTRY_ORG> | Production, Preview |
SENTRY_PROJECT |
opleet-web |
Production, Preview |
SENTRY_AUTH_TOKEN |
<SENTRY_AUTH_TOKEN>, Sensitive | Production |
- The environment is staging on Production too, because until cutover the production address points at staging (TL-M0-21). Cutover changes Production's value to
production, along with the Supabase values. - The token is on Production only. Preview builds run the code of any pull request, an agent's included (D28), so they don't get it. Their errors still arrive in Sentry, without readable stack traces.
- Development stays off for all five, and neither the Mac nor CI gets a DSN. With no DSN the SDK sends nothing, so local runs and CI never report to Sentry.
- Don't redeploy. Nothing reads these values until FE pack F merges, and that merge deploys with them.
8 · A test event
Section titled “8 · A test event”This sends one event from your Mac to the project, through Sentry's command-line tool, so you can see the DSN works before any code uses it. zsh asks for the DSN and doesn't echo it.
read -rs 'SENTRY_DSN?Paste the DSN, then press Enter: ' && echoSENTRY_DSN="$SENTRY_DSN" pnpm dlx @sentry/cli send-event -m "TL-M0-22: a test event from zuki's Mac"unset SENTRY_DSNThen open Sentry › Issues, with the project filter set to opleet-web and the time range set to the last hour.
Expect
Section titled “Expect”- Block 1: the organization's home page, with Opleet at the top left.
- Block 2: Two-Factor Authentication shows Authenticator App as enabled.
- Block 3: after saving, each setting shows the value you set, and Global Sensitive Fields lists the six names.
- Block 4: the project opleet-web, platform Next.js, under Projects.
- Block 6: the token listed by name under Organization Tokens. Only its last characters show.
- Block 7: five Sentry variables, with the environments in the table. SENTRY_AUTH_TOKEN shows as Sensitive and Production only.
- Block 8: pnpm downloads @sentry/cli, which then prints one line with an event id. Within a minute, Issues shows "TL-M0-22: a test event from zuki's Mac".
- Sentry › Issues shows the test event in opleet-web. Open it: the event has no IP address, and its User section shows none.
- Vercel › Settings › Environment Variables: search for SENTRY. Exactly five variables show, with the environments in block 7's table.
- Settings › Organization › Security & Privacy still shows the scrubber settings on and the six sensitive fields.
Then select the test event and choose Resolve. Log the run on #24: the date, the region you chose, the organization slug and the event id from block 8. Never log the DSN or the token.
If it fails
Section titled “If it fails”- Block 1 shows no Data Storage Location choice: you joined or created an organization some other way, such as through an invitation or Vercel's marketplace. Stop. Delete that organization (Settings › Organization › Remove Organization) only if it holds nothing else, then start block 1 again from sentry.io.
- Block 3's Global Sensitive Fields isn't there: it sits under Organization › Security & Privacy › Data Scrubbing on some plans. If neither page has it, set the same six names under Projects › opleet-web › Security & Privacy › Additional Sensitive Fields after block 4, and note that on #24.
- Block 8 prints "No DSN provided" or "invalid DSN": the DSN was pasted with a space or is cut short. Copy it again from Client Keys and rerun block 8.
- Block 8 fails while installing @sentry/cli, for example because a build script was ignored: paste the output into #24. The tool then can't send the event. The DSN still gets proven by FE pack F's first deployment, so you can carry on with the Check and log that block 8 didn't run.
- No event after five minutes: check the Issues page's filters (project opleet-web, all environments, last hour), then Stats › Usage for dropped events. If events were dropped, paste the reason into #24.
- The token was pasted somewhere it shouldn't be: revoke it under Organization Tokens and make a new one (block 6), then replace the value in Vercel (block 7).
- The Vercel variables: delete the five in Settings › Environment Variables.
- The token: Organization Tokens › the token's menu › Revoke.
- The project: Settings › Projects › opleet-web › General Settings › Remove Project.
- The organization, if it was made here: Settings › Organization › Remove Organization. Its data region goes with it.
Log each run as a comment on #24: the date, the region, the organization slug, the test event's id, and the five variables' names with their environments. Never the DSN or the token.