Showing prj_acme_commerce, staging.
Setup
Five short steps take one controlled error from your server to its first case. This walkthrough shows them already complete; in your own workspace each step provisions something and reports back.
An organization owns projects, credentials, and the evidence-retention setting. Usage and plan limits are measured against it, never against a single project.
Every ingest credential is scoped to one project and one environment, so a staging key can never write into production evidence. This walkthrough runs acme-commerce with production and staging; the topbar picker switches between them and re-scopes every list.
The ingest key and the payload encryption key are issued once and shown once. Both live on the sending server: the SDK seals evidence with the encryption key before it leaves the process, so the ingest API stores ciphertext it cannot open.
Open project settingsThe SDK captures locals, bound arguments, outbound I/O, and the observation sequence around a throw, seals them into an encrypted envelope, and posts that envelope to the ingest API. It opens no connection from a browser and sends no payload in clear text.
npm install [email protected]ERRORCORE_API_KEY="ec_live_..."
ERRORCORE_DEK="<64-hex payload encryption key>"
ERRORCORE_ENVIRONMENT="staging"
ERRORCORE_RELEASE="<full-git-commit-sha>"
ERRORCORE_INGEST_URL="https://api.errorcore.dev/v1/ingest"Initialize before routes, then register expressMiddleware() so request context attaches to captures.
import { init } from "errorcore";
init({
service: "core-api",
deploymentEnv: process.env.ERRORCORE_ENVIRONMENT,
transport: {
type: "http",
url: process.env.ERRORCORE_INGEST_URL ?? "https://api.errorcore.dev/v1/ingest",
apiKey: process.env.ERRORCORE_API_KEY,
},
encryptionKey: process.env.ERRORCORE_DEK,
});
import { captureError, expressMiddleware, flush } from "errorcore";
app.use(expressMiddleware());
app.get("/errorcore-test", async (_request, response, next) => {
try {
captureError(new Error("errorcore test error"));
await flush();
response.status(202).json({ sent: true });
} catch (error) {
next(error);
}
});A live setup listens here and reports each stage as it happens. Every incident in this walkthrough went through the same four stages, and each one is readable on its own event page.
admittedstoredreconstructingindexed