@multiplayer-app/session-recorder-node
Version:
Multiplayer Fullstack Session Recorder for Node.js
25 lines (17 loc) • 1.12 kB
text/typescript
export const NODE_ENV = process.env.NODE_ENV || 'development'
export const isProduction = NODE_ENV === 'production'
export const PORT = Number(process.env.PORT || 3000)
export const API_PREFIX = process.env.API_PREFIX || '/v1/api'
export const LOG_LEVEL = process.env.LOG_LEVEL || (isProduction ? 'info' : 'debug')
export const COMPONENT_NAME = process.env.npm_package_name?.split('/').pop() as string || process.env.SERVICE_NAME || 'timegate'
export const COMPONENT_VERSION = process.env.npm_package_version || '0.0.1'
export const ENVIRONMENT = process.env.ENVIRONMENT || 'staging'
export const MULTIPLAYER_OTLP_KEY = process.env.MULTIPLAYER_OTLP_KEY as string
if (!MULTIPLAYER_OTLP_KEY) {
throw new Error('MULTIPLAYER_OTLP_KEY is not set')
}
export const OTLP_TRACES_ENDPOINT = process.env.OTLP_TRACES_ENDPOINT || 'https://api.multiplayer.app/v1/traces'
export const OTLP_LOGS_ENDPOINT = process.env.OTLP_LOGS_ENDPOINT || 'https://api.multiplayer.app/v1/logs'
export const MULTIPLAYER_OTLP_SPAN_RATIO = process.env.MULTIPLAYER_OTLP_SPAN_RATIO
? Number(process.env.MULTIPLAYER_OTLP_SPAN_RATIO)
: 0.01