# Magic Sentry

**Know what broke before your users tell you.**

Sentry error and performance monitoring for the Magic framework: a web-safe boot, the HTTP failures `Http` swallows, the signed-in user and breadcrumbs from your events.

## Wired into Magic. Nothing to glue.

Sentry knows nothing about the Magic `Http` facade, its auth state or its router. Magic Sentry connects them so the reports carry the context you need.

### Web-safe boot

`MagicSentry.run` opens one guarded zone and starts Sentry before `Magic.init`, so a failure during boot is reported.

[Learn more about Web-safe boot](https://anilcancakir.com/magic/docs/sentry/basics/boot-and-provider.md)

### HTTP failures

The `Http` facade never throws, so Magic Sentry reports a 5xx or a dead connection as an event and a 4xx as a breadcrumb.

[Learn more about HTTP failures](https://anilcancakir.com/magic/docs/sentry/basics/http-reporting.md)

### Signed-in user

The Sentry scope user follows `Auth.stateNotifier`, with your own id, email and extras.

[Learn more about Signed-in user](https://anilcancakir.com/magic/docs/sentry/basics/user-context.md)

### Event breadcrumbs

Any Magic event that implements `ReportsBreadcrumb` becomes a breadcrumb.

[Learn more about Event breadcrumbs](https://anilcancakir.com/magic/docs/sentry/basics/event-breadcrumbs.md)

### Navigation trail

A navigator observer on `MagicRouter` records where the user was and, with named routes, feeds release health.

[Learn more about Navigation trail](https://anilcancakir.com/magic/docs/sentry/getting-started/installation.md)

### Token scrubbing

`SentryTokenScrubber` masks tokens that travel in URLs before an event leaves the app.

[Learn more about Token scrubbing](https://anilcancakir.com/magic/docs/sentry/guides/token-scrubbing.md)

## Your agent speaks Magic Sentry.

The Magic Sentry skill teaches your coding assistant to wire the service provider and the boot the way the framework expects, before the first line. One command wires it up.

```bash
npx skills add anilcancakir/ai --skill magic-sentry
```

[other editors](https://github.com/anilcancakir/ai)

## And checks the docs.

Skills teach the wiring. The MCP server at `mcp.anilcancakir.com/magic_sentry` gives your agent live docs lookup while it edits, so it never guesses a signature.

```bash
claude mcp add --transport http magic_sentry https://mcp.anilcancakir.com/magic_sentry
```

```bash
npx -y mcp-remote https://mcp.anilcancakir.com/magic_sentry
```

## Add it in seconds

```bash
flutter pub add magic_sentry
```

Or add to `pubspec.yaml`:

```yaml
dependencies:
  magic_sentry: ^1.0.1
```

Or give your AI agent this prompt:

```text
Read https://anilcancakir.com/magic/docs/sentry/llms.txt and install the Magic Sentry package in this project.
```

## Docs

### Getting Started

- [Installation](https://anilcancakir.com/magic/docs/sentry/getting-started/installation.md)

### The Basics

- [Boot and the Provider](https://anilcancakir.com/magic/docs/sentry/basics/boot-and-provider.md)
- [HTTP Reporting](https://anilcancakir.com/magic/docs/sentry/basics/http-reporting.md)
- [User Context](https://anilcancakir.com/magic/docs/sentry/basics/user-context.md)
- [Event Breadcrumbs](https://anilcancakir.com/magic/docs/sentry/basics/event-breadcrumbs.md)

### Guides

- [Token Scrubbing](https://anilcancakir.com/magic/docs/sentry/guides/token-scrubbing.md)
- [Testing](https://anilcancakir.com/magic/docs/sentry/guides/testing.md)
