# Connect Sentry to StoreScope Analytics

> Errors and crash-free sessions per app, so a bad release shows next to its reviews.

## What it unlocks in StoreScope Analytics

- Errors and crash-free sessions per app, so a bad release shows next to its reviews.

## The access it needs

| For | Least role or permission |
|---|---|
| Error and session stats | A personal token with Organization: Read and Project: Read |

- sentry.io US or DE only; self-hosted Sentry is not supported yet. An organization token (sntrys_) only uploads releases and cannot read stats.
- Each app gets the Sentry projects named like it (the app slug, or the slug followed by a dash, such as web or ios).

## Steps

1. In Sentry, User settings, Personal Tokens, create a token with read access to Organization and Project. (An organization token only uploads releases, it cannot read stats.) [Open Sentry tokens](https://sentry.io/settings/account/api/auth-tokens/)
2. Name each Sentry project like its app, or <app>-web, <app>-ios... Each app gets its projects by itself.
3. In StoreScope Analytics, open Connections, choose Sentry, fill in the form and save. The connection is checked live with the store first; a connection that fails the check is never saved.

## What the form asks for

- Sentry region (required): us (sentry.io) or de (de.sentry.io); self-hosted Sentry is not supported yet
- Personal token (required)
- Organization slug (optional)

## Errors the check can show

The exact sentence the Connections page shows (<angle brackets> are your own values), then what to do.

- "Region must be us or de (sentry.io)."
  Type us for sentry.io or de for de.sentry.io.
- "Personal token is required."
  Create one in Sentry, User settings, Personal Tokens.
- "That is an organization token, which only uploads releases. Create a personal token (sntryu_) with Organization and Project read."
  Create a personal token.
- "That does not look like a Sentry personal token (sntryu_...)."
  Copy the whole token, with no spaces.
- "The organization slug is the part after /organizations/ in a Sentry URL."
  Leave it empty, or type only the slug.
- "Sentry refused the token: check the region and that it is a personal token."
  The token belongs to the other region, or it was revoked.
- "The token has no Organization read access."
  Create a token with Organization: Read.
- "The token cannot see the organization "<slug>"."
  Check the slug, or leave it empty when the token sees one organization.
- "The token sees <n> organizations: type the one to read."
  Type the organization slug.
- "The token sees no organization."
  The token's user is not a member of an organization.
- "Sentry answered <status>."
  Sentry answered something unexpected. Try again in a few minutes.

Errors any connection can show: https://storescope.devino.ca/docs/connect.md
