
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@sentry/types
Advanced tools
The @sentry/types package provides TypeScript definitions for Sentry's JavaScript SDK. It includes types for Sentry's configuration options, event objects, and various interfaces used within Sentry's SDKs. This package is primarily used by developers to ensure type safety and autocompletion when working with Sentry in a TypeScript environment.
Event Interface
Defines the structure of an event that can be sent to Sentry. This includes the event's ID, level, timestamp, platform, and SDK information.
{
event_id: string;
level: 'error' | 'warning' | 'info' | 'debug';
timestamp: number;
platform: string;
sdk: {
name: string;
version: string;
};
}
Options Interface
Specifies the options for configuring the Sentry SDK. This includes the DSN (Data Source Name), breadcrumb limits, debug mode, integrations, and a beforeSend hook for event manipulation.
{
dsn: string;
maxBreadcrumbs: number;
debug: boolean;
integrations: Integration[];
beforeSend: (event: Event) => Event | null;
}
Breadcrumb Interface
Describes a breadcrumb, which is a snapshot of data that describes what happened before an event. This includes the timestamp, message, category, level, and any additional data.
{
timestamp: number;
message: string;
category: string;
level: 'critical' | 'error' | 'warning' | 'info' | 'debug';
data: Record<string, any>;
}
Provides TypeScript definitions for Node.js. Similar to @sentry/types, it's used for type safety and autocompletion but focuses on Node.js' API rather than Sentry's.
The TypeScript language itself, which includes its compiler and type system. While not a direct alternative, it's the foundation that packages like @sentry/types build upon to provide type definitions for specific libraries.
Offers TypeScript definitions for React. Similar to @sentry/types, it aids in developing React applications with TypeScript by providing types for React's API, but it doesn't relate to error monitoring or logging.
DEPRECATION NOTICE: The
@sentry/types
package is deprecated. All exports have been moved to@sentry/core
. Import everything from@sentry/core
instead.
Common types used by the Sentry JavaScript SDKs.
9.9.0
feat(nextjs): Support instrumentation-client.ts
(#15705)
Next.js recently added a feature to support client-side (browser) instrumentation via the experimental.clientInstrumentationHook
flag and the instrumentation-client.ts
file.
To be forwards compatible, the Sentry Next.js SDK will now pick up instrumentation-client.ts
files even on older Next.js versions and add them to your client bundles.
It is suggested that you either rename your sentry.client.config.ts
file to instrumentation-client.ts
, or if you already happen to have a instrumentation-client.ts
file move the contents of sentry.client.config.ts
to instrumentation-client.ts
.
feat(browser): Add previous_trace
span links (#15569)
The @sentry/browser
SDK and SDKs based on @sentry/browser
now emits a link from the first root span of a newly started trace to the root span of a previously started trace. You can control this feature via an option in browserTracingIntegration()
:
Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});
feat(browser): Add logger.X
methods to browser SDK (#15763)
For Sentry's upcoming logging product, the SDK now supports sending logs via dedicated methods.
Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation
Please note that the logs product is still in early access. See the link above for more information.
parseStringToURL
method (#15768)dropUndefinedKeys
(#15760)shouldHandleError
(#15771)addNonEnumerableProperty
(#15766)dropUndefinedKeys()
(#15757)dropUndefinedKeys()
(#15781)FAQs
Types for all Sentry JavaScript SDKs
The npm package @sentry/types receives a total of 7,502,915 weekly downloads. As such, @sentry/types popularity was classified as popular.
We found that @sentry/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 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.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.