Skip to main content
Module

x/sentry_deno/main.ts>init

Unofficial port of the Sentry SDK for JavaScript to Deno.
Latest
function init
import { init } from "https://deno.land/x/sentry_deno@v0.2.2/main.ts";

The Sentry Browser SDK Client.

To use this SDK, call the init function as early as possible when loading the web page. To set context information or send manual events, use the provided methods.

Examples

Example 1


import { init } from '@sentry/browser';

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

Example 2


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

Example 3


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

Example 4


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

Parameters

optional
options: BrowserOptions = [UNSUPPORTED]