Skip to content

feat(astro): Document assets sourcemaps upload option #8586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2023
Merged
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
35 changes: 27 additions & 8 deletions src/platform-includes/sourcemaps/overview/javascript.astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,55 @@ export default defineConfig({
});
```

### Working With Old Authentication Tokens
### Disable Source Maps Upload

Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-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`:
You can disable automatic source maps upload in your Astro config:

```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,
enabled: false,
},
}),
],
});
```

### Disable Source Maps Upload
### Setting the Source Maps Assets Directory

You can disable automatic source maps upload in your Astro config:
By default, the Sentry Astro integration will look for source maps in sensible default directories, depending on your `outDir`, `rootDir` and `adapter` configuration.
If these defaults don't work for you (for example, due to an advanced customized build setup or an unsupported adapter), you can specify the `assets` option to point to the folder(s) where your source maps are located:

```javascript {filename:astro.config.mjs}
export default defineConfig({
integrations: [
sentry({
sourceMapsUploadOptions: {
assets: [".clientOut/**/*", ".serverOut/**/*"],
},
}),
],
});
```

The specified patterns must follow the [glob syntax](https://www.npmjs.com/package/glob#glob-primer).

### Working With Old Authentication Tokens

Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-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`:

```javascript {filename:astro.config.mjs}
export default defineConfig({
integrations: [
sentry({
// Other Sentry options
sourceMapsUploadOptions: {
enabled: false,
project: "___PROJECT_SLUG___",
org: "___ORG_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
}),
],
Expand Down