@sentry/minimal
- Version 6.19.7
- Published
- 56.6 kB
- 3 dependencies
- BSD-3-Clause license
Install
npm i @sentry/minimal
yarn add @sentry/minimal
pnpm add @sentry/minimal
Overview
Sentry minimal library that can be used in other packages
Index
Functions
function addBreadcrumb
addBreadcrumb: (breadcrumb: Breadcrumb) => void;
Records a new breadcrumb which will be attached to future events.
Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.
Parameter breadcrumb
The breadcrumb to record.
function captureEvent
captureEvent: (event: Event) => string;
Captures a manually created event and sends it to Sentry.
Parameter event
The event to send to Sentry.
Returns
The generated eventId.
function captureException
captureException: (exception: any, captureContext?: CaptureContext) => string;
Captures an exception event and sends it to Sentry.
Parameter exception
An exception-like object.
Returns
The generated eventId.
function captureMessage
captureMessage: ( message: string, captureContext?: CaptureContext | Severity) => string;
Captures a message event and sends it to Sentry.
Parameter message
The message to send to Sentry.
Parameter Severity
Define the level of the message.
Returns
The generated eventId.
function configureScope
configureScope: (callback: (scope: Scope) => void) => void;
Callback to set context information onto the scope.
Parameter callback
Callback function that receives Scope.
function setContext
setContext: (name: string, context: { [key: string]: any }) => void;
Sets context data with the given name.
Parameter name
of the context
Parameter context
Any kind of data. This data will be normalized.
function setExtra
setExtra: (key: string, extra: Extra) => void;
Set key:value that will be sent as extra data with the event.
Parameter key
String of extra
Parameter extra
Any kind of data. This data will be normalized.
function setExtras
setExtras: (extras: Extras) => void;
Set an object that will be merged sent as extra data with the event.
Parameter extras
Extras object to merge into current context.
function setTag
setTag: (key: string, value: Primitive) => void;
Set key:value that will be sent as tags data with the event.
Can also be used to unset a tag, by passing
undefined
.Parameter key
String key of tag
Parameter value
Value of tag
function setTags
setTags: (tags: { [key: string]: Primitive }) => void;
Set an object that will be merged sent as tags data with the event.
Parameter tags
Tags context object to merge into current context.
function setUser
setUser: (user: User | null) => void;
Updates user context information for future events.
Parameter user
User context object to be set in the current context. Pass
null
to unset the user.
function startTransaction
startTransaction: ( context: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
Starts a new
Transaction
and returns it. This is the entry point to manual tracing instrumentation.A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a new child span within the transaction or any span, call the respective
.startChild()
method.Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
The transaction must be finished with a call to its
.finish()
method, at which point the transaction with all its finished child spans will be sent to Sentry.Parameter context
Properties of the new
Transaction
.Parameter customSamplingContext
Information given to the transaction sampling function (along with context-dependent default values). See Options.tracesSampler.
Returns
The transaction which was just started
function withScope
withScope: (callback: (scope: Scope) => void) => void;
Creates a new scope with and executes the given operation within. The scope is automatically removed once the operation finishes or throws.
This is essentially a convenience function for:
pushScope(); callback(); popScope();
Parameter callback
that will be enclosed into push/popScope.
Package Files (1)
Dependencies (3)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@sentry/minimal
.
- Markdown[](https://www.jsdocs.io/package/@sentry/minimal)
- HTML<a href="https://www.jsdocs.io/package/@sentry/minimal"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3927 ms. - Missing or incorrect documentation? Open an issue for this package.