# Sentry (sync issues into your inbox)

Sync your Sentry issues into the Usero feedback inbox, where they cluster alongside the rest of your feedback and can become
AI-authored pull requests. A crash that Sentry groups into one issue lands as a single feedback item, deduped, with a link back to
the Sentry issue. Resolve it in Sentry and the linked feedback resolves here too.

Connection is a Sentry webhook, not an OAuth app. You create a Sentry "Internal Integration" with a single issue webhook pointed
at a per-project URL that Usero generates for you. The URL carries an unguessable secret that both routes the issue to your
project and signs the request, so Usero only accepts issues meant for you.

## What it does

- **Import issues as feedback.** When Sentry creates an issue, Usero records it as a feedback item with the title, the culprit,
  the level (error, fatal, warning), the project, and the event and user counts, plus a "View in Sentry" link back to the issue.
- **Dedupe.** Each issue is keyed by its Sentry issue id, so redelivered webhooks and repeat events never create duplicate
  feedback.
- **Two-way resolve.** Resolve an issue in Sentry and the linked feedback resolves in Usero. Unresolve it and the feedback
  reopens. The sync is idempotent, so replays are safe.
- **Feed the AI-PR step.** Because Sentry issues land as normal feedback, a clustered issue can become a GitHub pull request the
  same way any other feedback item can. See the [GitHub integration](/docs/integrations/github) for the PR flow.

## Prerequisites

- A Usero account and a project. Anonymous visitors can browse but cannot connect Sentry.
- A Sentry organization where you can create an Internal Integration (Settings, then Developer Settings).
- For an issue to become a PR, a [connected GitHub repository](/docs/integrations/github). Without one the issue still imports; it
  just skips the PR step.

## Connect (generate the webhook URL)

1. Open your project, then go to **Integrations** (the URL is `usero.io/YOUR_CLIENT_ID/integrations`). To open your own
   integrations page, [go here](/integrations).
2. Find the **Sentry** card and open it. Click **Connect Sentry**. Usero generates a signed webhook URL of the form
   `https://usero.io/api/sentry/webhook/SECRET` and shows it in the card.
3. Copy the webhook URL. You will paste it into Sentry next.

## Set up the Sentry Internal Integration

1. In Sentry, go to **Settings**, then **Developer Settings**, then **Internal Integrations**, and create a new internal
   integration (name it "Usero", for example).
2. Set the **Webhook URL** to the URL Usero generated for you.
3. Under **Permissions**, grant **Issue & Event** read access.
4. Under **Webhooks**, enable the **issue** resource.
5. Save. Sentry signs each webhook with the integration's Client Secret. The secret in your Usero webhook URL is that signing key,
   so signature verification works without any extra configuration.

Once saved, new issues flow into your Usero inbox automatically. There is nothing to run on a schedule.

## What happens after connect

- **Created.** A new Sentry issue arrives as a feedback item, deduped by issue id, with the Sentry metadata and a "View in Sentry"
  link attached.
- **Resolved / unresolved.** Resolving an issue in Sentry resolves the linked feedback; unresolving reopens it. State changes are
  idempotent, so Sentry redelivering a webhook never double-applies.
- **Other actions** (assigned, archived) are ignored.

## Disconnect

Open the Sentry card and click **Disconnect Sentry**. Usero clears the webhook secret, so the old URL stops being accepted. Remove
the webhook from your Sentry Internal Integration as well. Reconnecting generates a fresh URL.

## Troubleshooting

**Issues are not arriving.** Confirm the webhook URL in Sentry exactly matches the one in the Usero card, and that the **issue**
webhook resource is enabled in the Internal Integration. A truncated or stale URL is the most common cause.

**Sentry shows a webhook delivery failure.** Usero rejects requests whose signature does not match the per-project secret
(HTTP 401) or whose URL secret is unknown (HTTP 404). If you rotated the connection in Usero (disconnect then reconnect), the old
URL is no longer valid; re-paste the new URL into Sentry.

**A resolve in Sentry did not resolve the feedback.** Two-way resolve only applies to issues that were imported as feedback after
you connected. Issues created before connecting are not retroactively linked.

## Next

- [Integrations overview](/docs/integrations)
- [GitHub integration (turn a Sentry issue into a PR)](/docs/integrations/github)
- [Find your clientId](/docs/find-your-client-id)
