import { init } from '@sentry/browser';
init({
dsn: '__DSN__',
// ...
});
import { configureScope } from '@sentry/browser';
configureScope((scope: Scope) => {
scope.setExtra({ battery: 0.7 });
scope.setTag({ user_mode: 'admin' });
scope.setUser({ id: '4711' });
});
import { addBreadcrumb } from '@sentry/browser';
addBreadcrumb({
message: 'My Breadcrumb',
// ...
});
import * as Sentry from '@sentry/browser';
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
message: 'Manual',
stacktrace: [
// ...
],
});
BrowserOptions for documentation on configuration options.
Generated using TypeDoc
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.