@reapit-cdk/sentry

0.0.1 • Public • Published

@reapit-cdk/sentry

npm version npm downloads coverage: 92.69%25

Minimal Sentry SDK

Package Installation:

yarn add --dev @reapit-cdk/sentry
# or
npm install @reapit-cdk/sentry --save-dev

Usage

// for usage with Edge API SDK
// { sentryDsn: string; sentryRelease: string } is required to be in your request env
import { initSentryLogger } from '@reapit-cdk/sentry/dist/edge-api-sentry-logger'
import { JSONResponse, jsonRequestHandler } from '@reapit-cdk/edge-api-sdk'

export const handler = jsonRequestHandler<{ sentryDsn: string; sentryRelease: string }>(
  async (): Promise<JSONResponse<{ something: string }>> => {
    return {
      body: {
        something: 'important',
      },
    }
  },
  (request) => ({
    loggerConfig: {
      transports: [initSentryLogger(request)],
    },
  }),
)

// for browser usage
import { initBrowserSentry } from '@reapit-cdk/sentry/dist/browser'

initBrowserSentry({
  componentName: '',
  dsn: '',
  environment: '',
  release: '',
  sessionId: '',
})

// for browser usage, with breadcrumb integration
import { initBreadcrumbIntegration } from '@reapit-cdk/sentry/dist/browser-breadcrumb-integration'

initBrowserSentry({
  componentName: '',
  dsn: '',
  environment: '',
  release: '',
  sessionId: '',
  integrations: [initBreadcrumbIntegration],
})

Readme

Keywords

none

Package Sidebar

Install

npm i @reapit-cdk/sentry

Weekly Downloads

3

Version

0.0.1

License

none

Unpacked Size

173 kB

Total Files

13

Last publish

Collaborators

  • joshbalfour