How to use @sentry/minimal - 9 common examples

To help you get started, we’ve selected a few @sentry/minimal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mentos1386 / nest-raven / lib / raven.interceptor.ts View on Github external
tap(null, (exception) => {
        if (this.shouldReport(exception)) {
          Sentry.withScope(scope => {
            // TODO: When https://github.com/nestjs/nest/issues/1581 gets implemented switch to that
            switch(this.options.context){
              case 'Http': return this.captureHttpException(scope, http, exception);
              case 'Ws': return this.captureWsException(scope, ws, exception);
              case 'Rpc': return this.captureRpcException(scope, rpc, exception);
            }
          });
        }
      })
    );
github filestack / filestack-js / src / lib / client.ts View on Github external
import { transform, TransformOptions } from './api/transform';
import { storeURL } from './api/store';
import { resolveHost, getVersion } from './utils';
import { Upload, InputFile, UploadOptions, StoreUploadOptions } from './api/upload';
import { preview, PreviewOptions } from './api/preview';
import { CloudClient } from './api/cloud';
import { StoreParams } from './filelink';

import {
  picker,
  PickerInstance,
  PickerOptions,
} from './picker';

/* istanbul ignore next */
Sentry.addBreadcrumb({ category: 'sdk', message: 'filestack-js-sdk scope' });

export interface Session {
  apikey: string;
  urls: Hosts;
  cname?: string;
  policy?: string;
  signature?: string;
}

export interface Security {
  policy: string;
  signature: string;
}

export interface ClientOptions {
  [option: string]: any;
github filestack / filestack-js / src / lib / client.ts View on Github external
constructor(apikey: string, options?: ClientOptions) {
    super();

    /* istanbul ignore next */
    Sentry.configureScope(scope => {
      scope.setTag('apikey', apikey);
      scope.setTag('sdk-version', getVersion());
      scope.setExtra('clientOptions', options);
    });

    if (!apikey || typeof apikey !== 'string' || apikey.length === 0) {
      throw new Error('An apikey is required to initialize the Filestack client');
    }
    const { urls } = config;
    this.session = { apikey, urls };

    if (options) {
      const { cname, security } = options;

      this.setSecurity(security);
      this.setCname(cname);
github filestack / filestack-js / src / lib / client.ts View on Github external
upload.on('error', (e) => {
      Sentry.withScope(scope => {
        scope.setExtras(e.details);
        scope.setExtras({ uploadOptions: options, storeOptions });
        Sentry.captureException(e);
      });

      this.emit('upload.error', e);
    });
github mentos1386 / nest-raven / lib / raven.interceptor.ts View on Github external
private captureException(scope: Scope, exception): void {
    if (this.options.level) scope.setLevel(this.options.level);
    if (this.options.fingerprint) scope.setFingerprint(this.options.fingerprint);
    if (this.options.extra) for (const key in this.options.extra) {
      if(this.options.extra.hasOwnProperty(key)) scope.setExtra(key, this.options.extra[key]);
    }
    for (const tag in this.options.tags) {
      scope.setTag(tag, this.options.tags[tag])
    }

    Sentry.captureException(exception);
  }
github filestack / filestack-js / src / lib / client.ts View on Github external
Sentry.withScope(scope => {
        scope.setExtras(e.details);
        scope.setExtras({ uploadOptions: options, storeOptions });
        Sentry.captureException(e);
      });
github getsentry / sentry-javascript / packages / browser / src / integrations / onunhandledrejection.ts View on Github external
public handler(event: PromiseRejectionEvent): void {
    captureException(event.reason);
  }
  /**

@sentry/minimal

Sentry minimal library that can be used in other packages

MIT
Latest version published 3 years ago

Package Health Score

88 / 100
Full package analysis

Similar packages