Skip to main content

Report errors with Sentry

The shell can send uncaught JavaScript errors and unhandled promise rejections to Sentry in production builds. shellui start never initializes Sentry, so local errors do not hit your project.

You do not have to put Sentry in shellui.config.json. The CLI merges sentry from environment variables when it loads config. You may still write "dsn": "${SENTRY_DSN}" and use env substitution; the dedicated merge still applies when SENTRY_DSN is set.

Environment variables​

VariableRequiredDescription
SENTRY_DSNyes to enableProject DSN (Sentry → Project → Settings → Client Keys). Enables Sentry unless disabled below
SENTRY_ENABLEDnofalse or 0 disables even when DSN is set
SENTRY_ENVIRONMENTnoShown in Sentry. Defaults to production if unset
SENTRY_RELEASEnoRelease id (git SHA or app version) for grouping

At build time the CLI injects the full config (including sentry) via @shellui/config. Core reads that module when import.meta.env.DEV is false and a DSN is present, then initializes @sentry/react.

Local .env (gitignored):

SENTRY_DSN=https://your_key@your_org.ingest.sentry.io/project_id
SENTRY_ENVIRONMENT=production
SENTRY_RELEASE=1.0.0

The CLI loads dotenv. CI example:

env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ENVIRONMENT: production
SENTRY_RELEASE: ${{ github.sha }}

A DSN in the frontend bundle is expected for browser Sentry. It is not a secret with write access to your infra.

When Sentry runs​

ContextInitialized
shellui start (dev)No
Production build, SENTRY_DSN set, SENTRY_ENABLED not false/0Yes
Production build, no DSNNo
Production build, SENTRY_ENABLED=false or 0No

If you also declare sentry.io in cookie consent, gate extra client SDKs you initialize yourself. The shell's own production init still follows the table above.