Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/sentry/index.d.ts>init

The Official Sentry Deno SDK
Latest
function init
import { init } from "https://deno.land/x/sentry@7.120.0/index.d.ts";

The Sentry Deno SDK Client.

To use this SDK, call the init function as early as possible in the main entry module. To set context information or send manual events, use the provided methods.

Examples

Example 1


import { init } from 'npm:@sentry/deno';

init({
  dsn: '__DSN__',
  // ...
});

Example 2


import { configureScope } from 'npm:@sentry/deno';
configureScope((scope: Scope) => {
  scope.setExtra({ battery: 0.7 });
  scope.setTag({ user_mode: 'admin' });
  scope.setUser({ id: '4711' });
});

Example 3


import { addBreadcrumb } from 'npm:@sentry/deno';
addBreadcrumb({
  message: 'My Breadcrumb',
  // ...
});

Example 4


import * as Sentry from 'npm:@sentry/deno';
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
  message: 'Manual',
  stacktrace: [
    // ...
  ],
});

Parameters

optional
options: DenoOptions