errorcoredocsbeta

Local development

You do not need production credentials to see what errorcore captures.

import { init } from "errorcore";

init({
  service: "core-api",
  transport: { type: "stdout" },
});

No API key and no encryption key are required for the stdout transport, because nothing leaves the process.

Write packages to a file

init({
  service: "core-api",
  transport: { type: "file", path: ".errorcore/events.ndjson" },
});

Add the directory to .gitignore. Captured packages contain real runtime values from your local run.

Point at the hosted API from a dev machine

Use a project with a development environment, its own API key, and its own encryption key. Never reuse production credentials locally.

ERRORCORE_API_KEY="ec_live_..."
ERRORCORE_DEK="<64-hex payload encryption key>"
ERRORCORE_ENVIRONMENT="development"
ERRORCORE_INGEST_URL="<endpoint shown in the errorcore Setup page>"

Events sent this way are real events: they are admitted, indexed, and they consume your organization's allowance like any other.

Verify capture

getHealth() returns local counters: captured, dropped with its breakdown, transportFailures, queue depths, and flush latency percentiles. It is the fastest way to tell "nothing was captured" apart from "capture worked, delivery failed". Health metrics stay in your process and are never sent to errorcore.

On this page