Skip to content
DocsGitHub

wizard

Set up the Sentry SDK in your project interactively

sentry wizard [<org>/<project>] [<integration>]

Section titled “sentry wizard [<org>/<project>] [<integration>]”

Set up the Sentry SDK in your project interactively

Arguments:

Argument Description
[<org>/<project>] [<integration>] <org>/<project> to set up (skips the project picker), then the integration (skips the integration picker)

Options:

Option Description
-f, --force Change a project with uncommitted changes without asking, and install the SDK even when the package manager's checks fail
--app-target <app-target> Xcode app target that SnapshotPreviews uses, instead of picking one (appleSnapshots only)
--hosted-test-target <hosted-test-target> Hosted XCTest target that renders the snapshots, instead of picking one (appleSnapshots only)
--tracing Answer yes to "Do you want to enable Tracing to track the performance of your application?" instead of asking; --no-tracing answers no
--replay Answer yes to "Do you want to enable Session Replay to get a video-like reproduction of errors during a user session?" instead of asking; --no-replay answers no
--logs Answer yes to "Do you want to enable Logs to send your application logs to Sentry?" instead of asking; --no-logs answers no
--profiling Answer yes to "Do you want to enable Profiling to track application performance in detail?" instead of asking; --no-profiling answers no
--instrumentation-api Answer yes to "Do you want to use the Instrumentation API for automatic tracing of loaders, actions, and middleware?" instead of asking; --no-instrumentation-api answers no (reactRouter only)
--example-page Answer yes to "Do you want to create an example page to test your Sentry setup?" instead of asking; --no-example-page answers no
--example-component Answer yes to "Do you want to create an example component to test your Sentry setup?" instead of asking; --no-example-component answers no (angular, nuxt only)
--mcp Answer yes to "Do you want to add a project-scoped MCP server configuration for the Sentry MCP?" instead of asking; --no-mcp answers no

Examples:

Terminal window
# Pick an integration and a project, then set it up
sentry wizard
# Set up Next.js, picking the project
sentry wizard nextjs
# Set up Next.js for a known org and project
sentry wizard my-org/my-project nextjs
# Set up Next.js for Spotlight, without a Sentry account
SENTRY_SPOTLIGHT=1 sentry wizard nextjs

All commands support --json for machine-readable output and --fields to select specific JSON fields.

sentry wizard sets up the Sentry SDK in the project in the current directory. It asks a few questions, installs the SDK for your framework, writes its configuration, and sets up source map or debug file uploads. It takes an optional <org>/<project> first, then an optional integration:

  • Pass an integration, such as nextjs, to skip the integration picker.
  • Pass <org>/<project> first to skip the org and project pickers, or <org>/ to pick only the project. Without it, the wizard asks; it doesn't detect a project from your files.
  • An integration id is never read as a project or org, and a single bare word is always read as an integration. Write a project or org with a /: my-org/my-project, my-org/, or /my-project. For a project spelled like an integration, write my-org/nextjs.
  • -f/--force changes a project with uncommitted changes without asking, and installs the SDK even when the package manager's checks fail.
  • --tracing, --replay, --logs, --profiling, --example-page, and the other flags --help lists answer yes to their question instead of asking it, in every wizard that asks it, and their --no- forms, such as --no-replay, answer no. The wizard still asks the questions no flag answers.
  • For appleSnapshots, --app-target and --hosted-test-target name the Xcode app target and hosted XCTest target to use instead of picking them. Without a terminal, the wizard uses the only target or stops with the list, so pass these when the project has several.

Without a terminal, the wizard skips the questions that its arguments and flags answer, such as <org>/<project>, the integration, or --app-target. When it reaches a question that nothing answered and its input has ended (/dev/null or a closed pipe, as in CI or a coding agent's shell), it stops there with exit code 1 instead of finishing as if it had succeeded. Changes it made before that question stay. Every wizard ends by asking whether to add a project-scoped MCP server configuration, after all its changes are made, so pass --no-mcp to let such a run finish with exit code 0.

It logs in with your sentry auth login account, or starts a login when you have none, on the Sentry instance the rest of the CLI uses: SENTRY_URL, or the stored login's. To use a self-hosted instance, log in to it first with sentry auth login --url.

Set SENTRY_SPOTLIGHT=1 to set up Spotlight for local development instead, with no Sentry account or login. Telemetry follows the CLI's settings (SENTRY_CLI_NO_TELEMETRY, DO_NOT_TRACK, sentry cli defaults), and the global --verbose flag shows the wizard's debug output.

sentry wizard changes your project's files. To have a coding agent set up Sentry instead, run sentry init, which prints the agent's setup guide and changes nothing.

sentry wizard takes the same integration ids as npx @sentry/wizard -i, but not most of its flags or its SENTRY_WIZARD_* environment variables:

@sentry/wizard sentry wizard
-i nextjs nextjs
--org my-org --project my-project my-org/my-project, before the integration
--url, -u, --saas sentry auth login --url, or SENTRY_URL
--spotlight SENTRY_SPOTLIGHT=1
--force-install, --ignore-git-changes -f/--force
--disable-telemetry SENTRY_CLI_NO_TELEMETRY=1 or DO_NOT_TRACK=1
--debug --verbose or --log-level debug
--app-target, --hosted-test-target The same flags
--non-interactive Automatic when stdin is not a terminal
--xcode-project-dir Run the wizard in that directory
--signup, --promo-code, --coming-from Sign up at https://sentry.io/signup/ first

The Cordova and Electron wizards were retired. Follow their setup guides in the Sentry docs instead.

Flows that uploaded source maps with @sentry/cli, such as Angular, now install the sentry package instead. The sentry:sourcemaps script they add to package.json runs sentry sourcemap upload on your build output, which injects debug IDs before it uploads. The wizard writes your org, project and, on self-hosted Sentry, URL to the [defaults] section of the project's .sentryclirc, next to the auth token, and adds the file to .gitignore. In CI, set SENTRY_AUTH_TOKEN. On self-hosted Sentry, also set SENTRY_ORG, SENTRY_PROJECT and SENTRY_URL.

The Android wizard writes the auth token to sentry.properties and adds the file to .gitignore. The Sentry Android Gradle plugin uploads during Release builds, so those builds fail on machines without the file: set SENTRY_AUTH_TOKEN in CI, or create a sentry.properties on each machine. On self-hosted Sentry, the file also holds the server URL, so set SENTRY_URL in CI too.