Home Reference Source

Function

Static Public Summary
public
public

sentryInit(configuration: Object)

Initialize the Sentry SDK.

public

validateSchema(schema: Joi.Schema, data: Object): Object

Validate the configuration against the schema.

Static Public

public sampleApp(): string source

import {sampleApp} from 'app_name/src/index.js'

Return:

string

A greeting message

Example:


console.log(sampleApp());

// Output: Hello World!

public sentryInit(configuration: Object) source

import {sentryInit} from 'app_name/src/config/sentry.js'

Initialize the Sentry SDK.

Params:

NameTypeAttributeDescription
configuration Object

The configuration object.

configuration.sentry Object

The Sentry configuration object.

configuration.sentry.env string

The environment in which the app is running.

configuration.sentry.dsn string

The DSN for the Sentry project.

configuration.sentry.tracesSampleRate number

The traces sample rate.

configuration.app Object

The app configuration object.

configuration.app.name string | undefined

The name of the app.

configuration.app.version string | undefined

The version of the app.

public validateSchema(schema: Joi.Schema, data: Object): Object source

import {validateSchema} from 'app_name/src/utils/validateSchema.js'

Validate the configuration against the schema.

Params:

NameTypeAttributeDescription
schema Joi.Schema

The schema to validate against.

data Object

The configuration data to validate.

Return:

Object

The validated configuration data.