Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@sentry/astro
Advanced tools
This SDK is in Beta and not yet fully stable. If you have feedback or encounter any bugs, feel free to open an issue.
This package is a wrapper around @sentry/node
for the server and @sentry/browser
for the client side.
Install the Sentry Astro SDK with the astro
CLI:
npx astro add @sentry/astro
Add your DSN and source maps upload configuration:
import { defineConfig } from 'astro/config';
import sentry from '@sentry/astro';
export default defineConfig({
integrations: [
sentry({
dsn: '__DSN__',
sourceMapsUploadOptions: {
project: 'your-sentry-project-slug',
authToken: process.env.SENTRY_AUTH_TOKEN,
},
}),
],
});
Follow this guide to create an auth token and add it to your environment variables:
SENTRY_AUTH_TOKEN="your-token"
For Astro apps configured for (hybrid) Server Side Rendering (SSR), the Sentry integration will automatically add middleware to your server to instrument incoming requests if you're using Astro 3.5.2 or newer.
If you're using Astro <3.5.2, complete the setup by adding the Sentry middleware to your src/middleware.js
file:
// src/middleware.js
import { sequence } from 'astro:middleware';
import * as Sentry from '@sentry/astro';
export const onRequest = sequence(
Sentry.handleRequest(),
// Add your other handlers after Sentry.handleRequest()
);
The Sentry middleware enhances the data collected by Sentry on the server side by:
You can opt out of using the automatic sentry server instrumentation in your astro.config.mjs
file:
import { defineConfig } from 'astro/config';
import sentry from '@sentry/astro';
export default defineConfig({
integrations: [
sentry({
dsn: '__DSN__',
autoInstrumentation: {
requestHandler: false,
},
}),
],
});
Check out our docs for configuring your SDK setup:
8.35.0
This release marks the beta release of the @sentry/nuxt
Sentry SDK. For details on how to use it, check out the
Sentry Nuxt SDK README. Please reach out on
GitHub if you have any feedback or concerns.
import()
(#13945)It is no longer required to add a Node --import
flag. Please update your start command to avoid initializing Sentry
twice (BREAKING CHANGE). The SDK will now apply modifications during the build of your application to allow for
patching of libraries during runtime. If run into issues with this change, you can disable this behavior in your
nuxt.config.ts
and use the --import
flag instead:
sentry: {
dynamicImportForServerEntry: false;
}
We now require you to explicitly enable sourcemaps for the clientside so that Sentry can un-minify your errors. We made this change so source maps aren't accidentally leaked to the public. Enable source maps on the client as follows:
export default defineNuxtConfig({
sourcemap: {
client: true,
},
});
responseHook
with waitUntil
(#13986)Support for Pinia is added in this release for @sentry/vue
. To capture Pinia state data,
add createSentryPiniaPlugin()
to your Pinia store:
import { createPinia } from 'pinia';
import { createSentryPiniaPlugin } from '@sentry/vue';
const pinia = createPinia();
pinia.use(createSentryPiniaPlugin());
This change introduces a new SentryHttpInstrumentation
to handle non-span related HTTP instrumentation, allowing it to
run side-by-side with OTel's HttpInstrumentation
. This improves support for custom OTel setups and avoids conflicts
with Sentry's instrumentation. Additionally, the spans: false
option is reintroduced for httpIntegration
to disable
span emission while still allowing custom HttpInstrumentation
instances (httpIntegration({ spans: false })
).
This change adds a new option trackFetchStreamPerformance
to the browser tracing integration. Only when set to true
,
Sentry will instrument streams via fetch.
suppressTracing
API (#13875)@opentelemetry/instrumentation-express
to 0.43.0
(#13948)@opentelemetry/instrumentation-fastify
to 0.40.0
(#13983)init
is correct in meta frameworks
(#13938).set
the sentry-trace
header instead of .append
ing in fetch instrumentation
(#13907)ignoreOutgoingRequests
of httpIntegration
applies to breadcrumbs
(#13970)Work in this release was contributed by @ZakrepaShe and @zhiyan114. Thank you for your contributions!
FAQs
Official Sentry SDK for Astro
The npm package @sentry/astro receives a total of 7,512 weekly downloads. As such, @sentry/astro popularity was classified as popular.
We found that @sentry/astro demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.