The consent check someone missed
Analytics that fires on page load with a banner bolted on afterwards needs a guard at every call site, and one missed guard is a real problem. Here the guard is inside the tracking call itself.
Know what broke, without tracking anyone who said no.
When a request fails you get a short reference such as APP-CAPACITY-002 and a plain message, and that reference maps to exactly one entry in a registry. Product analytics stays a silent no-op until someone accepts the analytics cookie, including when they accept it part-way through a session.
0
tracking events before consent
1
place where every error code lives
2
tools that leave the build when unset
Without a shared foundation, every team rebuilds these edge cases, differently.
Analytics that fires on page load with a banner bolted on afterwards needs a guard at every call site, and one missed guard is a real problem. Here the guard is inside the tracking call itself.
Someone says it broke, with no reference, or pastes a stack trace. There is nothing stable to match against what was actually captured. A short reference solves that in one line.
SDKs that assume their keys exist crash local development or behave differently between environments. Here both wrappers are safe to call unconfigured and disappear from the build entirely.
The mechanism end to end, as implemented in the repository.
Consent comes first
Every tracking call checks the analytics cookie choice. On acceptance the tracker loads lazily, and a change listener covers a yes that arrives later in the session.
Errors are captured with context
Reporting filters noise and tags each event with structured context such as organization, project and job. In development, events log locally rather than being sent.
People get a stable reference
Every failure resolves through one registry to a reference such as APP-CAPACITY-001 and a safe public message. Operator meanings stay in the repository docs.
Missing keys cost nothing
Without analytics or error-reporting keys every helper becomes a no-op and the build drops the unused tools.
Interactive example
This walkthrough demonstrates the implemented backend contract without using an account, credentials, or provider calls.
Interactive example
Deterministic sample data only. No account, provider, or network connection is used by the interaction.
Highlights
Every tracking call checks the consent choice first. The tracker loads lazily on acceptance, and a listener covers someone who accepts mid-session.
Reports are tagged with organization, project, job and AI details, so a failure can be placed without digging through raw payloads.
Every API error maps through one registry to a support reference and a safe public message. A released reference always means the same thing.
Engineering guarantees
Error reporting is configured separately from analytics consent, and this page does not pretend otherwise. What our error context may contain, and how long it is kept, is ours to decide rather than something the code settles.
The boundary above is code, not a claim. These files carry the contract:
src/lib/analytics.tssrc/lib/sentry.tssrc/registries/error-codes.tsdocs/ERROR-CODES.mdThese capabilities share contracts and boundaries with this one.
The docs describe the same contracts this page demonstrates.