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.40.0
feat(angular): Support Angular 19 (#14398)
The @sentry/angular
SDK can now be used with Angular 19. If you're upgrading to the new Angular version, you might want to migrate from the now deprecated APP_INITIALIZER
token to provideAppInitializer
.
In this case, change the Sentry TraceService
initialization in app.config.ts
:
// Angular 18
export const appConfig: ApplicationConfig = {
providers: [
// other providers
{
provide: TraceService,
deps: [Router],
},
{
provide: APP_INITIALIZER,
useFactory: () => () => {},
deps: [TraceService],
multi: true,
},
],
};
// Angular 19
export const appConfig: ApplicationConfig = {
providers: [
// other providers
{
provide: TraceService,
deps: [Router],
},
provideAppInitializer(() => {
inject(TraceService);
}),
],
};
feat(core): Deprecate debugIntegration
and sessionTimingIntegration
(#14363)
The debugIntegration
was deprecated and will be removed in the next major version of the SDK.
To log outgoing events, use Hook Options (beforeSend
, beforeSendTransaction
, ...).
The sessionTimingIntegration
was deprecated and will be removed in the next major version of the SDK.
To capture session durations alongside events, use Context (Sentry.setContext()
).
feat(nestjs): Deprecate @WithSentry
in favor of @SentryExceptionCaptured
(#14323)
The @WithSentry
decorator was deprecated. Use @SentryExceptionCaptured
instead. This is a simple renaming and functionality stays identical.
feat(nestjs): Deprecate SentryTracingInterceptor
, SentryService
, SentryGlobalGenericFilter
, SentryGlobalGraphQLFilter
(#14371)
The SentryTracingInterceptor
was deprecated. If you are using @sentry/nestjs
you can safely remove any references to the SentryTracingInterceptor
. If you are using another package migrate to @sentry/nestjs
and remove the SentryTracingInterceptor
afterwards.
The SentryService
was deprecated and its functionality was added to Sentry.init
. If you are using @sentry/nestjs
you can safely remove any references to the SentryService
. If you are using another package migrate to @sentry/nestjs
and remove the SentryService
afterwards.
The SentryGlobalGenericFilter
was deprecated. Use the SentryGlobalFilter
instead which is a drop-in replacement.
The SentryGlobalGraphQLFilter
was deprecated. Use the SentryGlobalFilter
instead which is a drop-in replacement.
feat(node): Deprecate nestIntegration
and setupNestErrorHandler
in favor of using @sentry/nestjs
(#14374)
The nestIntegration
and setupNestErrorHandler
functions from @sentry/node
were deprecated and will be removed in the next major version of the SDK. If you're using @sentry/node
in a NestJS application, we recommend switching to our new dedicated @sentry/nestjs
package.
normalizedRequest
on sdkProcessingMetadata
is merged (#14315)@sentry/utils
into @sentry/core
(#14382)__self
and __source
attributes on feedback nodes (#14356)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.