CControxity Docs
GuidesReferenceHTTP APIOpen Controxity
How it works

The shape of what failed

With an error, the SDK sends what the failing code was given as key names and types, never values, so the fixer can write a test that fails the same way.

A stack trace says where an error happened. Often the cause is what came in: an order with no items, an empty coupon, a quantity that isn't a number. So with each error the SDK sends the shape of its input.

{body: {items: undefined, coupon: "", lines: [{sku: string, qty: number}]}}

That's key names and types. Never a value: a string is string (or "" when it's empty), a number is number (or NaN), whatever it was.

Where it's used#

Where it comes from#

The framework hooks send the request's route params, query and body by themselves:

app.use(controxity.express());   // and fastify(app), nest(app)

For your own code, pass what it was given:

controxity.captureError(error, { where: "checkout", input: { cart, coupon } });

What's never in it#

GivenSent
"[email protected]"string
4111111111111111number
{"[email protected]": {...}} (keyed by data){[key]: {...}}
trueboolean

A key that looks like data (an email, a long number, an id or a token) isn't kept: it becomes [key]. A shape stops at 6 levels deep and 150 parts, and at 30 keys in one object.

Controxity checks every shape again when it arrives: it keeps only objects of name-like keys and type words from a fixed list, so a value sent by mistake is dropped and never stored.

Turning it off#

controxity.init({ key, url, captureInput: false });

Errors are reported as before, without their input.

Controxity 1.132.0These pages are in the repository: docs/site