Data Source Name (DSN)

Sentry automatically assigns you a Data Source Name (DSN) when you create a project to start monitoring events in your app.

What the DSN Does

The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the SENTRY_DSN environment variable. If that variable also does not exist, the SDK will just not send any events.

Where to Find Your DSN

If you forget your DSN, view Settings -> Projects -> Client Keys (DSN) in sentry.io.

The Parts of the DSN

The DSN configures the protocol, public key, server address, and project identifier. It is composed of the following parts:

{PROTOCOL}://{PUBLIC_KEY}:{SECRET_KEY}@{HOST}{PATH}/{PROJECT_ID}

For example:

Copied
Sentry.init({ dsn: "https://public@sentry.example.com/1" });

Has the following settings:

The resulting POST request for a plain JSON payload would then transmit to https://sentry.example.com/api/1/store/.

You can edit this page on GitHub.