Socket
Socket
Sign inDemoInstall

@sentry/types

Package Overview
Dependencies
0
Maintainers
0
Versions
445
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sentry/types

Types for all Sentry JavaScript SDKs


Version published
Weekly downloads
11M
increased by2.55%
Maintainers
0
Install size
315 kB
Created
Weekly downloads
 

Package description

What is @sentry/types?

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.

What are @sentry/types's main functionalities?

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>;
}

Other packages similar to @sentry/types

Changelog

Source

8.12.0

Important Changes

  • feat(solid): Remove need to pass router hooks to solid integration (breaking)

This release introduces breaking changes to the @sentry/solid package (which is currently out in alpha).

We've made it easier to get started with the solid router integration by removing the need to pass use* hooks explicitly to solidRouterBrowserTracingIntegration. Import solidRouterBrowserTracingIntegration from @sentry/solid/solidrouter and add it to Sentry.init

import * as Sentry from '@sentry/solid';
import { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '@sentry/solid/solidrouter';
import { Router } from '@solidjs/router';

Sentry.init({
  dsn: '__PUBLIC_DSN__',
  integrations: [solidRouterBrowserTracingIntegration()],
  tracesSampleRate: 1.0, //  Capture 100% of the transactions
});

const SentryRouter = withSentryRouterRouting(Router);
  • feat(core): Return client from init method (#12585)

Sentry.init() now returns a client directly, so you don't need to explicitly call getClient() anymore:

const client = Sentry.init();
  • feat(nextjs): Add deleteSourcemapsAfterUpload option (#12457)

This adds an easy way to delete sourcemaps immediately after uploading them:

module.exports = withSentryConfig(nextConfig, {
  sourcemaps: {
    deleteSourcemapsAfterUpload: true,
  },
});
  • feat(node): Allow to configure maxSpanWaitDuration (#12610)

Adds configuration option for the max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span. The SDK will automatically clean up spans that have no finished parent after this duration. This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing. However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early. In this case, you can increase this duration to a value that fits your expected data.

Other Changes

  • feat(feedback): Extra check for iPad in screenshot support (#12593)
  • fix(bundle): Ensure CDN bundles do not overwrite window.Sentry (#12580)
  • fix(feedback): Inject preact from feedbackModal into feedbackScreenshot integration (#12535)
  • fix(node): Re-throw errors from koa middleware (#12609)
  • fix(remix): Mark isRemixV2 as optional in exposed types. (#12614)
  • ref(node): Add error message to NodeFetch log (#12612)

Work in this release was contributed by @n4bb12. Thank you for your contribution!

Readme

Source

Sentry

Sentry JavaScript SDK Types

npm version npm dm npm dt

General

Common types used by the Sentry JavaScript SDKs.

FAQs

Last updated on 25 Jun 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc