diff --git a/src/docs/product/cli/configuration.mdx b/src/docs/product/cli/configuration.mdx index 3d2ce76b571f3..150a107e85947 100644 --- a/src/docs/product/cli/configuration.mdx +++ b/src/docs/product/cli/configuration.mdx @@ -26,9 +26,9 @@ By default, `sentry-cli` will connect to sentry.io, but for self-hosted you can sentry-cli --url https://myserver.invalid/ login ``` -## To authenticate manually: +## To Authenticate Manually: -Visit your [auth token user settings page](https://sentry.io/settings/account/api/auth-tokens/) and create or copy an existing token. Then either: +Visit the [Organization Auth Token Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) and create a new token. Then either: - add it to `~/.sentryclirc`: diff --git a/src/docs/product/sentry-basics/integrate-frontend/configure-scms.mdx b/src/docs/product/sentry-basics/integrate-frontend/configure-scms.mdx index d94e5460c570a..ec275a5cef2fd 100644 --- a/src/docs/product/sentry-basics/integrate-frontend/configure-scms.mdx +++ b/src/docs/product/sentry-basics/integrate-frontend/configure-scms.mdx @@ -54,6 +54,16 @@ The Sentry webpack plugin can automatically configure release information and se 1. Go back to your `frontend-tutorial` project and stop it with `Ctrl + C`. +1. Create a sentry auth token: + + + + ```bash {filename:.env} + SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ + ``` + +You'll need to pass your auth token to your build command later on. We recommend storing it inside an environment variable. Auth tokens should always stay secret, so avoid storing yours inside your version control. + 1. To start associating commits and releases, add the following lines of code to `webpack.config.js` in your Sentry webpack plugin config: ```javascript {filename:webpack.config.js} @@ -61,9 +71,8 @@ The Sentry webpack plugin can automatically configure release information and se org: "", project: "", - // Auth tokens can be obtained by creating an internal integration - // at https://.sentry.io/settings/developer-settings/ - // and need "Release: Admin" and "Organization: Read & Write" permissions + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, // Enable automatically creating releases and associating commits diff --git a/src/includes/sentry-cli-sourcemaps.mdx b/src/includes/sentry-cli-sourcemaps.mdx index fae8bed8e3268..e0616640c1679 100644 --- a/src/includes/sentry-cli-sourcemaps.mdx +++ b/src/includes/sentry-cli-sourcemaps.mdx @@ -10,18 +10,12 @@ For more info on `sentry-cli` configuration visit the [Sentry CLI configuration Make sure `sentry-cli` is configured for your project. For that you can use environment variables: - - -Visit the [auth token user settings page](https://sentry.io/settings/account/api/auth-tokens/) to find your auth tokens. - - - - + ```bash {filename:.env.local} -SENTRY_AUTH_TOKEN=your-auth-token SENTRY_ORG=___ORG_SLUG___ SENTRY_PROJECT=___PROJECT_SLUG___ +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ ``` ### 3. Inject Debug IDs Into Artifacts diff --git a/src/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx b/src/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx index e1410ee4cbede..e269829b69174 100644 --- a/src/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx +++ b/src/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx @@ -76,8 +76,8 @@ module.exports = { // Specify the directory containing build artifacts include: "./dist", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and needs the `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, // Optionally uncomment the line below to override automatic release name detection @@ -129,7 +129,7 @@ module.exports = { org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ + // Auth tokens can be obtained from your User Settings // and need `project:releases` and `org:read` scopes authToken: process.env.SENTRY_AUTH_TOKEN, @@ -159,8 +159,8 @@ export default defineConfig({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from your User Settings + // and need `project:releases` and `org:read` scopes authToken: process.env.SENTRY_AUTH_TOKEN, release: { @@ -186,7 +186,7 @@ require("esbuild").build({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ + // Auth tokens can be obtained from your User Settings // and need `project:releases` and `org:read` scopes authToken: process.env.SENTRY_AUTH_TOKEN, @@ -211,7 +211,7 @@ export default { org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ + // Auth tokens can be obtained from your User Settings // and need `project:releases` and `org:read` scopes authToken: process.env.SENTRY_AUTH_TOKEN, diff --git a/src/platform-includes/sourcemaps/overview/javascript.remix.mdx b/src/platform-includes/sourcemaps/overview/javascript.remix.mdx index 9b6b4ed76bf2b..395cb6616d13a 100644 --- a/src/platform-includes/sourcemaps/overview/javascript.remix.mdx +++ b/src/platform-includes/sourcemaps/overview/javascript.remix.mdx @@ -16,27 +16,21 @@ Under the hood, it uses the Sentry CLI. This script requires some configuration, which can either be done through a `.sentryclirc` file in the root of your project or through environment variables: - - -Visit the [auth token user settings page](https://sentry.io/settings/account/api/auth-tokens/) to find your auth tokens. - - - - + ```ini {filename:.sentryclirc} -[auth] -token=your-auth-token - [defaults] org=___ORG_SLUG___ project=___PROJECT_SLUG___ + +[auth] +token=___ORG_AUTH_TOKEN___ ``` ```bash -export SENTRY_AUTH_TOKEN=your-auth-token export SENTRY_ORG=___ORG_SLUG___ export SENTRY_PROJECT=___PROJECT_SLUG___ +export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ ``` Next, run the upload script with the following command: diff --git a/src/platform-includes/sourcemaps/overview/javascript.svelte.mdx b/src/platform-includes/sourcemaps/overview/javascript.svelte.mdx index 5678fb0534009..22b6ab2b82d75 100644 --- a/src/platform-includes/sourcemaps/overview/javascript.svelte.mdx +++ b/src/platform-includes/sourcemaps/overview/javascript.svelte.mdx @@ -45,6 +45,16 @@ npm install @sentry/vite-plugin --save-dev yarn add @sentry/vite-plugin --dev ``` +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with a `.env.sentry-build-plugin` file in the working directory when building your project. +You likely want to add the auth token as an environment variable to your CI/CD environment. + + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Configure Vite to emit source maps and use the Sentry Vite plugin: @@ -66,8 +76,8 @@ export default defineConfig({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platform-includes/sourcemaps/overview/javascript.vue.mdx b/src/platform-includes/sourcemaps/overview/javascript.vue.mdx index 8370b9a0e379c..ff99550389a3d 100644 --- a/src/platform-includes/sourcemaps/overview/javascript.vue.mdx +++ b/src/platform-includes/sourcemaps/overview/javascript.vue.mdx @@ -25,6 +25,16 @@ yarn add @sentry/vite-plugin --dev Learn more about configuring the plugin in our [Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin). +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with a `.env.sentry-build-plugin` file in the working directory when building your project. +You likely want to add the auth token as an environment variable to your CI/CD environment. + + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Example: @@ -47,8 +57,8 @@ export default defineConfig({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx b/src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx index 108532228d057..bf51742b68d88 100644 --- a/src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx +++ b/src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx @@ -30,8 +30,18 @@ yarn add @sentry/esbuild-plugin --dev ### Configure +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. + Learn more about configuring the plugin in our [Sentry esbuild Plugin documentation](https://www.npmjs.com/package/@sentry/esbuild-plugin). + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Example: @@ -47,8 +57,8 @@ require("esbuild").build({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platform-includes/sourcemaps/upload/rollup/javascript.mdx b/src/platform-includes/sourcemaps/upload/rollup/javascript.mdx index 882c643f2034d..5f982ba494a13 100644 --- a/src/platform-includes/sourcemaps/upload/rollup/javascript.mdx +++ b/src/platform-includes/sourcemaps/upload/rollup/javascript.mdx @@ -30,8 +30,18 @@ yarn add @sentry/rollup-plugin --dev ### Configuration +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. + Learn more about configuring the plugin in our [Sentry Rollup Plugin documentation](https://www.npmjs.com/package/@sentry/rollup-plugin). + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Example: @@ -49,8 +59,8 @@ export default { org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platform-includes/sourcemaps/upload/vite/javascript.mdx b/src/platform-includes/sourcemaps/upload/vite/javascript.mdx index fdf79fb90ab81..e9ca0db23451a 100644 --- a/src/platform-includes/sourcemaps/upload/vite/javascript.mdx +++ b/src/platform-includes/sourcemaps/upload/vite/javascript.mdx @@ -30,8 +30,18 @@ yarn add @sentry/vite-plugin --dev ### Configuration +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. + Learn more about configuring the plugin in our [Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin). + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Example: @@ -50,8 +60,8 @@ export default defineConfig({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platform-includes/sourcemaps/upload/webpack/javascript.mdx b/src/platform-includes/sourcemaps/upload/webpack/javascript.mdx index ca6031fcfbba1..f3dd96fedcf6f 100644 --- a/src/platform-includes/sourcemaps/upload/webpack/javascript.mdx +++ b/src/platform-includes/sourcemaps/upload/webpack/javascript.mdx @@ -30,20 +30,22 @@ yarn add @sentry/webpack-plugin --dev ### Configuration -Learn more about configuring the plugin in our [Sentry webpack plugin documentation](https://www.npmjs.com/package/@sentry/webpack-plugin). - - +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. -You'll have to setup your environment variables first. In most cases, you'll either want to add the env. variables to a `.env` file (e.g. when deploying locally), or you'll have to add them to your CI/CD environment. +Learn more about configuring the plugin in our [Sentry webpack plugin documentation](https://www.npmjs.com/package/@sentry/webpack-plugin). -```bash {filename:.env} -SENTRY_ORG=___ORG_SLUG___ -SENTRY_PROJECT=___PROJECT_SLUG___ +```bash {filename:.env.sentry-build-plugin} SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ ``` + + + + And the following webpack config: ```javascript {filename:webpack.config.js} @@ -55,8 +57,8 @@ module.exports = { devtool: "source-map", // Source map generation must be turned on plugins: [ sentryWebpackPlugin({ - org: process.env.SENTRY_ORG, - project: process.env.SENTRY_PROJECT, + org: "___ORG_SLUG___", + project: "___PROJECT_SLUG___", authToken: process.env.SENTRY_AUTH_TOKEN, }), ], @@ -67,6 +69,8 @@ module.exports = { +Add the following to your `gatsby-node.js` file: + ```javascript {filename:gatsby-node.js} @@ -78,9 +82,6 @@ exports.onCreateWebpackConfig = ({ actions }) => { sentryWebpackPlugin({ org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need `project:releases` and `org:read` scopes authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platforms/javascript/common/sourcemaps/uploading/angular-nx.mdx b/src/platforms/javascript/common/sourcemaps/uploading/angular-nx.mdx index d9671baf96e11..a380c1342e791 100644 --- a/src/platforms/javascript/common/sourcemaps/uploading/angular-nx.mdx +++ b/src/platforms/javascript/common/sourcemaps/uploading/angular-nx.mdx @@ -60,6 +60,16 @@ If you are on an older version and you want to upload source maps we recommend u +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. + + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Register the Sentry webpack plugin in your `webpack.config.js`: @@ -76,8 +86,8 @@ module.exports = { org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need the `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platforms/javascript/common/sourcemaps/uploading/angular-webpack.mdx b/src/platforms/javascript/common/sourcemaps/uploading/angular-webpack.mdx index 82b2e4744d662..f4c82d762fa40 100644 --- a/src/platforms/javascript/common/sourcemaps/uploading/angular-webpack.mdx +++ b/src/platforms/javascript/common/sourcemaps/uploading/angular-webpack.mdx @@ -77,6 +77,16 @@ If you are on an older version and you want to upload source maps we recommend u +To upload source maps you have to configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. +We recommend you add the auth token to your CI/CD environment as an environment variable. + + + +```bash {filename:.env.sentry-build-plugin} +SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ +``` + Register the Sentry Webpack plugin in your `webpack.config.js`: @@ -93,8 +103,8 @@ module.exports = { org: "___ORG_SLUG___", project: "___PROJECT_SLUG___", - // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // and need the `project:releases` and `org:read` scopes + // Auth tokens can be obtained from + // https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index 2704526b9b145..43eb4bde426d7 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -149,8 +149,7 @@ const sentryWebpackPluginOptions = { project: "___PROJECT_SLUG___", // An auth token is required for uploading source maps. - // You can get an auth token from https://sentry.io/settings/account/api/auth-tokens/ - // The token must have `project:releases` and `org:read` scopes for uploading source maps + // You can get an auth token from https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/ authToken: process.env.SENTRY_AUTH_TOKEN, silent: true, // Suppresses all logs @@ -237,9 +236,11 @@ The URL, organization, and project properties identify your organization and pro You can commit all the properties to your VCS, except the auth token. You can accomplish this by using the `.sentryclirc` file and including your auth token: + + ```ini {filename:.sentryclirc} [auth] -token=YOUR_AUTH_TOKEN +token=___ORG_AUTH_TOKEN___ ``` Don't forget to ignore `.sentryclirc` in your version control system to prevent it from being leaked! diff --git a/src/platforms/javascript/guides/sveltekit/manual-setup.mdx b/src/platforms/javascript/guides/sveltekit/manual-setup.mdx index 84bfe933b5ad5..a546ffb9a09a6 100644 --- a/src/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/src/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -197,7 +197,7 @@ You can set them as environment variables, for example in a `.env` file: - `SENTRY_ORG` your Sentry org slug - `SENTRY_PROJECT` your Sentry project slug -- `SENTRY_AUTH_TOKEN` your Sentry auth token +- `SENTRY_AUTH_TOKEN` your Sentry auth token (can be obtained from the [Organization Token Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/)) - `SENTRY_URL` your Sentry instance URL. This is only required if you use your own Sentry instance (as opposed to `https://sentry.io`). Or, you can set them by passing a `sourceMapsUploadOptions` object to `sentrySvelteKit`, as seen in the example below. All available options are documented at [the Sentry Vite plugin repo](https://www.npmjs.com/package/@sentry/vite-plugin#options).