Keys / Sentry
SENTRY_DSN
The address your app sends errors and traces to in one Sentry project. Sentry says it's safe to make public: it can only send events.
- Expires
- no expiry setting
- API
- create, disable and delete client keys, with an auth token
Get it
Create one on sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys. The steps aren't recorded yet.
Set it
SENTRY_DSN=...
The Python, Node.js, Go, Ruby, PHP and .NET SDKs read it from this variable when you don't pass a DSN. Java reads it when you call Sentry.init() with no options. Browser SDKs don't. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- In the project's Client Keys (DSN) settings, create a new key.
- Deploy its DSN everywhere that reads
SENTRY_DSN. - Check that nothing still sends with the old key, then disable or delete it.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.
Sources, checked 2026-11-16
- Sentry: Data Source Name (DSN)
- Sentry API: List a project's client keys
- Sentry API: Update a client key
- Sentry OpenAPI schema
- sentry-python: reads SENTRY_DSN
- sentry-javascript (Node.js): reads SENTRY_DSN
- sentry-go: reads SENTRY_DSN
- sentry-ruby: reads SENTRY_DSN
- sentry-php: reads SENTRY_DSN
- sentry-java: reads SENTRY_ variables
- sentry-dotnet: reads SENTRY_DSN