Skip to content
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

feat(astro): Add enabled option to Astro integration options #10007

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 2, 2024

This PR adds a top level enabled option to the Astro integration options. This option can be used to globally enable/disable all Sentry features, either for client or server separately or for both sides simultaneously.

  • Disabeling either side will avoid the respective SDK code being injected into the bundles.
  • If both sides are disabled, source maps will not be generated and uploaded.
  • If both or just the server side is disabled, the Sentry middleware won't be added.
  • Obviously, this options defaults to true

API:

// astro.config.mjs

export default defineConfig({
  integrations: [
    sentry({
      // disable entirely
      enabled: false,
      // or just one side
      enabled: {
        client: true, // <-- can also be omitted
        server: false,
      }
    }),
  ],
});

closes #9783
ref #9777

@Lms24 Lms24 changed the title feat(astro): Add enabled option to Sentry Astro integration feat(astro): Add enabled option to Astro integration options Jan 2, 2024
@Lms24 Lms24 requested review from mydea and lforst January 2, 2024 09:10
@Lms24 Lms24 merged commit 993044d into develop Jan 2, 2024
53 checks passed
@Lms24 Lms24 deleted the lms/feat-astro-enabled-option branch January 2, 2024 10:24
anonrig pushed a commit that referenced this pull request Jan 3, 2024
Add a top level `enabled` option to the Astro integration
options. This option can be used to globally enable/disable all Sentry
features, either for client or server separately or for both sides
simultaneously.

* Disabeling either side will avoid the respective SDK code being
injected into the bundles.
* If both sides are disabled, source maps will not be generated and
uploaded.
* If both or just the server side is disabled, the Sentry middleware
won't be added.
* Obviously, this options defaults to `true`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry SDK code is injected in prod builds if no DSN is set
3 participants