• 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.

    Parameters

    Returns void

    Example


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

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

    Example


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

    Example


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

    Example


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

    See

    BrowserOptions for documentation on configuration options.

Generated using TypeDoc