Environment variables
These are the variables used by the setup snippets. All of them are server-side. Never use a public prefix such as NEXT_PUBLIC_ on any of them.
There is no ERRORCORE_LICENSE_KEY. Transport authentication and payload encryption are two separate secrets with two separate jobs.
ERRORCORE_API_KEY
The ingestion API key. Format ec_live_ followed by 32 to 128 URL-safe characters. It is sent as Authorization: Bearer <key> and is the sole source of organization, project, and environment scope; the SDK never puts tenant identifiers in the request body.
Used as the fallback for transport.apiKey when the HTTP transport is configured without an explicit key. Issue and rotate keys in the console; see API keys.
ERRORCORE_DEK
The payload data encryption key: 64 hexadecimal characters (32 bytes). The SDK derives its AES-256-GCM encryption key and HMAC key from this value and encrypts every payload before it leaves the process.
Used as the fallback for encryptionKey. Keys with trivially low character diversity are rejected at startup. Issue and rotate keys in the console; see encryption keys.
ERRORCORE_ENVIRONMENT
The deployment environment label, such as production, staging, preview, or development. Used as the fallback for deploymentEnv.
This is deliberately separate from NODE_ENV: many fleets run NODE_ENV=production in non-production environments, which makes NODE_ENV a poor source of truth for the receiver.
ERRORCORE_INGEST_URL
The exact public Errorcore collector endpoint shown by the console Setup page. It is an absolute HTTP or HTTPS URL ending in /v1/ingest.
The SDK does not discover this URL from the environment by itself; the provided init() snippets pass process.env.ERRORCORE_INGEST_URL as transport.url. This is the destination for outbound encrypted envelopes. It is unrelated to the origin of your own application's temporary /errorcore-test route.
ERRORCORE_RELEASE
Optional in local development and strongly recommended in production. Set it to the full Git commit SHA for the deployed source:
ERRORCORE_ENVIRONMENT=production
ERRORCORE_RELEASE=<full-git-commit-sha>The SDK may inspect .git/HEAD as a local convenience fallback. Do not rely on that fallback for a release: production containers commonly omit the .git directory, and indirect refs may not identify the deployed revision without the rest of the repository metadata.
Map the deployment platform's predefined full-SHA value into ERRORCORE_RELEASE. For a typical CI job:
export ERRORCORE_ENVIRONMENT=production
export ERRORCORE_RELEASE="$CI_COMMIT_SHA"Use your CI provider's equivalent full commit variable when it uses another name. In Coolify, add these application variables:
ERRORCORE_ENVIRONMENT=production
ERRORCORE_RELEASE=$SOURCE_COMMITCoolify documents SOURCE_COMMIT as the source-code commit hash. For Docker builds, enable Include Source Commit in Build only when the value must be present during the image build; runtime metadata should otherwise stay a runtime variable.
ERRORCORE_DEBUG
Optional. Set to enable the SDK's internal debug logging. Leave it unset in production.
ERRORCORE_MAC_KEY
Advanced and rarely needed. A separate 64-hex MAC key. By default the MAC key is derived from ERRORCORE_DEK, and managed provisioning in the console issues only a DEK. Setting an explicit MAC key means self-managing both secrets, and envelopes signed with it will not verify against a console-provisioned project key.
Service name
The SDK resolves service from the service config option first, then OTEL_SERVICE_NAME, then npm_package_name, then the literal unknown-service. Setting service explicitly in init() is recommended.
ERRORCORE_API_KEY, ERRORCORE_DEK, billing credentials, and every other secret must remain server-only. Never place them in NEXT_PUBLIC_*, client-side build arguments, browser code, or public logs.