Skip to main content
Authenticate with Sentry using OAuth device flow or an API token.

Usage

Description

Log in to Sentry using OAuth or an API token. The OAuth flow uses a device code - you’ll be given a code to enter at a URL. Alternatively, use --token to authenticate with an existing API token. The command will:
  • Check if you’re already authenticated (and skip if so)
  • Start an OAuth device flow (default) or validate the provided token
  • Fetch and cache your user information
  • Save credentials to your local configuration file
If authentication is provided via environment variable (SENTRY_AUTH_TOKEN or SENTRY_TOKEN), you’ll need to unset it to use OAuth-based login instead.

Options

string
Authenticate using an API token instead of OAuth. The token will be validated by fetching user regions from the Sentry API.
number
default:"900"
Timeout for OAuth flow in seconds. The default is 900 seconds (15 minutes).

Examples

OAuth login (default)

Expected output:

Login with API token

Expected output:

OAuth with custom timeout

For self-hosted Sentry instances (26.1.0+), set SENTRY_URL and SENTRY_CLIENT_ID environment variables before running the login command. You’ll need to create a public OAuth app in Settings → Developer Settings.