Quickstart
Quickstart is only meant to prove that capture works. Do it with a controlled error in a development or staging service.
Initialize the SDK
import errorcore from "errorcore";
errorcore.init({
service: "billing-api",
environment: process.env.NODE_ENV ?? "development",
captureIO: true,
captureLocals: true,
encryptionKey: process.env.ERRORCORE_KEY,
});Trigger a known failure
const rows = await db.query(
"select * from invoices where status = ?",
["overdue"],
);
const invoice = rows[0];
if (!invoice) {
throw new Error("disk quota exceeded");
}Verify the result
Look for a single incident with:
- the thrown error and stack
- local variables from the failing frame
- the database query in the IO timeline
- a transport-ready package instead of a raw exception log
If those four signals are present, move on to configuration and transport policy.