Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/platforms/javascript/guides/astro/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ import sentry from "@sentry/astro";
export default defineConfig({
integrations: [
sentry({
sourceMapsUploadOptions: {
project: "___PROJECT_SLUG___",
org: "___ORG_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
project: "___PROJECT_SLUG___",
org: "___ORG_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});
Expand Down Expand Up @@ -208,7 +206,7 @@ To get readable stack traces in your production builds, set the `SENTRY_AUTH_TOK
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```

This, in combination with your `sourceMapsUploadOptions` configuration, will <PlatformLink to="/sourcemaps">upload source maps</PlatformLink> to Sentry every time you make a production build.
This, in combination with your `sentry` integration configuration, will <PlatformLink to="/sourcemaps">upload source maps</PlatformLink> to Sentry every time you make a production build.

## Verify

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
export default defineConfig({
integrations: [
sentry({
sourceMapsUploadOptions: {
unstable_sentryVitePluginOptions: {
applicationKey: "your-custom-application-key",
},
unstable_sentryVitePluginOptions: {
applicationKey: "your-custom-application-key",
},
}),
],
Expand Down
12 changes: 5 additions & 7 deletions platform-includes/getting-started-complete/javascript.nuxt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,18 @@ export default defineNitroPlugin(sentryCloudflareNitroPlugin((nitroApp: NitroApp

## Step 3: Add Readable Stack Traces With Source Maps (Optional)

To upload source maps for clear error stack traces, add your Sentry auth token, organization, and project slugs in the `sentry.sourceMapsUploadOptions` inside your configuration file:
To upload source maps for clear error stack traces, add your Sentry auth token, organization, and project slugs in the `sentry` options inside your configuration file:

<Alert>These `sentry` options only affect the **build time** of the SDK.</Alert>

```javascript {filename:nuxt.config.ts} {3-10}
export default defineNuxtConfig({
modules: ["@sentry/nuxt/module"],
sentry: {
sourceMapsUploadOptions: {
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
// store your auth token in an environment variable
authToken: process.env.SENTRY_AUTH_TOKEN,
},
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
// store your auth token in an environment variable
authToken: process.env.SENTRY_AUTH_TOKEN,
},
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,16 @@ sentry-cli sourcemaps upload --release=<release_name> /path/to/directory

## Working With Old Authentication Tokens

Source maps work best with [organization-scoped auth tokens](/account/auth-tokens/#organization-tokens). If you are using an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`:
Source maps work best with [organization-scoped auth tokens](/account/auth-tokens/#organization-tokens). If you are using an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sentry` integration options:

```javascript {filename:astro.config.mjs}
export default defineConfig({
integrations: [
sentry({
// Other Sentry options
sourceMapsUploadOptions: {
project: "___PROJECT_SLUG___",
org: "___ORG_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
project: "___PROJECT_SLUG___",
org: "___ORG_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});
Expand Down
17 changes: 8 additions & 9 deletions platform-includes/sourcemaps/overview/javascript.astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@ To automatically upload source maps during production builds, add the `SENTRY_AU
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```

Next, add your project slug to the `sourceMapsUploadOptions` in your Astro config:
Next, add your project slug to the `sentry` integration options in your Astro config:

```javascript {filename:astro.config.mjs}
export default defineConfig({
integrations: [
sentry({
// Other Sentry options
sourceMapsUploadOptions: {
project: "___PROJECT_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
// Other Sentry build-time options
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this include org?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, good catch!

}),
],
});
```

### Disable Source Maps Upload

You can disable automatic source maps upload in your Astro configuration with `enabled: false` under `sourceMapsUploadOptions`
You can disable automatic source maps upload in your Astro configuration with `disable: true` under `sourcemaps` in the `sentry` integration options.

### Setting the Source Maps Assets Directory

Expand All @@ -41,7 +40,7 @@ If these defaults don't work for you (for example, due to an advanced customized
export default defineConfig({
integrations: [
sentry({
sourceMapsUploadOptions: {
sourcemaps: {
assets: [".clientOut/**/*", ".serverOut/**/*"],
},
}),
Expand All @@ -61,4 +60,4 @@ Source maps work best with [organization-scoped auth tokens](/account/auth-token
The Astro SDK uses the Sentry Vite plugin to upload source maps.
This plugin collects telemetry data to help us improve the source map uploading experience.
Read more about this in our [Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#telemetry).
You can disable telemetry collection by setting `telemetry:false` under `sourceMapsUploadOptions`.
You can disable telemetry collection by setting `telemetry: false` in the `sentry` integration options.
10 changes: 4 additions & 6 deletions platform-includes/sourcemaps/primer/javascript.nuxt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

## Configure Source Maps Upload

To automatically upload source maps, you need to provide your Sentry auth token, your organization, and project slugs to the `sentry.sourceMapsUploadOptions` in your Nuxt config:
To automatically upload source maps, you need to provide your Sentry auth token, your organization, and project slugs to the `sentry` options in your Nuxt config:

<OrgAuthTokenNote />

```javascript {filename:nuxt.config.ts} {3-9}
export default defineNuxtConfig({
modules: ["@sentry/nuxt/module"],
sentry: {
sourceMapsUploadOptions: {
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
authToken: "___ORG_AUTH_TOKEN___",
},
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
authToken: "___ORG_AUTH_TOKEN___",
},
});
```
Expand Down
Loading