Creates a new Node SDK instance.
Configuration options for this SDK.
Protected
Optional
Readonly
_dsnThe client Dsn, if specified in options. Without this Dsn, the SDK will be disabled.
Protected
_integrationsArray of set up integrations.
Protected
_integrationsIndicates whether this client's integrations have been set up.
Protected
_numNumber of calls being processed
Protected
Readonly
_optionsOptions passed to the SDK.
Protected
_captureProtected
_captureProtected
_clearProtected
_isDetermine if the client is finished processing. Returns a promise because it will wait timeout
ms before saying
"no" (resolving to false
) in order to give the client a chance to potentially finish first.
Optional
timeout: numberThe time, in ms, after which to resolve to false
if the client is still busy. Passing 0
(or not
passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
true
.
A promise which will resolve to true
if processing is already done or finishes before the timeout, and
false
otherwise
Protected
_isProtected
_prepareAdds common information to events.
The information includes release and environment from options
,
breadcrumbs and context (extra, tags and user) from the scope.
Information that is already present in the event is never overwritten. For nested objects, such as the context, keys are merged.
A new event with more information.
Protected
_processProtected
_processProcesses an event (either error or message) and sends it to Sentry.
This also adds breadcrumbs and context information to the event. However, platform specific meta data (such as the User's IP address) must be added by the SDK implementor.
A SyncPromise that resolves with the event or rejects in case event was/will not be send.
Protected
_sendProtected
_updateUpdates existing session based on the provided event
Add an integration to the client.
This can be used to e.g. lazy load integrations.
In most cases, this should not be necessary, and you're better off just passing the integrations via integrations: []
at initialization time.
However, if you find the need to conditionally load & add an integration, you can use addIntegration
to do so.
TODO (v8): Make this a required method.
Flush the event queue and set the client to enabled = false
. See flush.
Optional
timeout: numberMaximum time in ms the client should wait before shutting down. Omitting this parameter will cause the client to wait until all events are sent before disabling itself.
A promise which resolves to true
if the flush completes successfully before the timeout, or false
if
it doesn't.
Fire a hook event for transaction start and finish. Expects to be given a transaction as the second argument.
Fire a hook for when a breadcrumb is added. Expects the breadcrumb as second argument.
Fire a hook for when a DSC (Dynamic Sampling Context) is created. Expects the DSC as second argument.
Optional
hint: BreadcrumbHintWait for all events to be sent or the timeout to expire, whichever comes first.
Optional
timeout: numberMaximum time in ms the client should wait for events to be flushed. Omitting this parameter will cause the client to wait until all events are sent before resolving the promise.
A promise that will resolve with true
if all events are sent before the timeout, or false
if there are
still events in the queue when the timeout is reached.
Returns the current Dsn.
Returns the client's instance of the given integration class, it any.
Gets an installed integration by its id
.
The installed integration or undefined
if no integration with that id
was installed.
Register a callback for transaction start and finish.
Register a callback for transaction start and finish.
Register a callback for when an event has been sent.
Register a callback before a breadcrumb is added.
Optional
hint: BreadcrumbHintRegister a callback whena DSC (Dynamic Sampling Context) is created.
Record on the client that an event got dropped (ie, an event that will not be sent to sentry).
The reason why the event got dropped.
Optional
_event: EventThe dropped event.
Submits the session to Sentry
Generated using TypeDoc
The Sentry Node SDK Client.
See