Reference
All options are passed to errorcore.init(). Only transport is required.
| Option | Type | Default | Description |
|---|
transport | TransportConfig | required | Where incident packages are delivered. See Transport. |
encryptionKey | string | undefined | 64-character hex string (32 bytes) for AES-256-GCM encryption. Generate with node -e "console.log(require('crypto').randomBytes(32).toString('hex'))". |
allowUnencrypted | boolean | false | Allow unencrypted packages. Set to true for local development when no encryption key is available. |
| Option | Type | Default | Description |
|---|
captureLocalVariables | boolean | false | Capture local variables at the throw site via V8 Inspector. |
captureRequestBodies | boolean | false | Include request bodies in captured incidents. |
captureResponseBodies | boolean | false | Include response bodies in captured incidents. |
captureBody | boolean | false | Shorthand to enable both request and response body capture. |
captureBodyDigest | boolean | false | Include a SHA-256 digest of bodies instead of the full content. |
captureDbBindParams | boolean | false | Include database bind parameters in the IO timeline. |
bodyCaptureContentTypes | string[] | ["application/json", "application/x-www-form-urlencoded", "text/plain", "application/xml"] | Content types eligible for body capture. |
| Option | Type | Default | Description |
|---|
headerAllowlist | string[] | ["content-type", "content-length", "accept", "user-agent", "x-request-id", "x-correlation-id", "host"] | Headers to include in captured requests. |
headerBlocklist | RegExp[] | Patterns matching authorization, cookie, token, key, secret, password, credential | Headers to exclude (evaluated as regex against header names). |
envAllowlist | string[] | NODE_ENV, PORT, HOSTNAME, Kubernetes and cloud platform variables | Environment variables to include in the incident package. |
envBlocklist | RegExp[] | Patterns matching key, secret, token, password, credential, auth, private | Environment variable names to exclude. |
piiScrubber | (key: string, value: unknown) => unknown | undefined | Custom function to scrub or transform values before serialization. Runs in addition to the built-in scrubber. |
replaceDefaultScrubber | boolean | false | When true, the custom piiScrubber replaces the built-in scrubber entirely instead of running alongside it. |
| Option | Type | Default | Description |
|---|
bufferSize | number | 200 | Maximum number of IO events kept in the circular buffer. Range: 10-100000. |
bufferMaxBytes | number | 52428800 (50 MB) | Maximum memory for the IO buffer in bytes. Minimum: 1 MB. |
maxPayloadSize | number | 32768 (32 KB) | Maximum size of a single serialized value in bytes. |
maxConcurrentRequests | number | 50 | Maximum number of concurrent request contexts tracked. |
rateLimitPerMinute | number | 60 | Maximum incidents captured per rate limit window. |
rateLimitWindowMs | number | 60000 | Rate limit sliding window duration in milliseconds. Minimum: 1000. |
flushIntervalMs | number | 5000 | Interval for periodic transport flush. Set to 0 to disable. |
| Option | Type | Default | Description |
|---|
maxLocalsCollectionsPerSecond | number | 20 | Rate limit for V8 Inspector local variable collection. |
maxCachedLocals | number | 50 | Maximum cached local variable snapshots. |
maxLocalsFrames | number | 5 | Number of stack frames to capture locals from. |
Passed as serialization: { ... } in the config:
| Option | Type | Default | Description |
|---|
maxDepth | number | 8 | Maximum nesting depth for cloned values. |
maxArrayItems | number | 20 | Maximum array elements to include. |
maxObjectKeys | number | 50 | Maximum object keys to include. |
maxStringLength | number | 2048 | Maximum string length before truncation. |
maxPayloadSize | number | 32768 | Maximum serialized size per value (32 KB). |
maxTotalPackageSize | number | 5242880 | Maximum total package size (5 MB). |
| Option | Type | Default | Description |
|---|
deadLetterPath | string | auto-derived | Path to the dead-letter NDJSON file. Defaults to .errorcore-dead-letters.ndjson next to the transport file or in CWD for HTTP transport. |
maxDrainOnStartup | number | 100 | Maximum dead-letter entries to retry on SDK initialization. |
uncaughtExceptionExitDelayMs | number | 1500 | Milliseconds to wait for delivery before exiting after an uncaught exception. |
| Option | Type | Default | Description |
|---|
resolveSourceMaps | boolean | true | Resolve source maps in stack traces. |
useWorkerAssembly | boolean | false | Assemble incident packages in a worker thread to reduce main thread blocking. |
allowPlainHttpTransport | boolean | false | Allow http:// URLs for the HTTP transport (not recommended). |
allowInvalidCollectorCertificates | boolean | false | Skip TLS certificate validation for the collector (not recommended). |