diff --git a/src/platform-includes/sourcemaps/overview/javascript.astro.mdx b/src/platform-includes/sourcemaps/overview/javascript.astro.mdx index 780faa38be0fc..d7651d3e2b7b6 100644 --- a/src/platform-includes/sourcemaps/overview/javascript.astro.mdx +++ b/src/platform-includes/sourcemaps/overview/javascript.astro.mdx @@ -28,9 +28,9 @@ 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({ @@ -38,18 +38,35 @@ export default defineConfig({ 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({ @@ -57,7 +74,9 @@ export default defineConfig({ sentry({ // Other Sentry options sourceMapsUploadOptions: { - enabled: false, + project: "___PROJECT_SLUG___", + org: "___ORG_SLUG___", + authToken: process.env.SENTRY_AUTH_TOKEN, }, }), ],