
I built a zero-infrastructure audit logging SDK for TypeScript -> here's what I learned
Every B2B SaaS eventually gets this message from a customer: "Someone changed this record — who did it?" If you don't have audit logs, you have no answer. I've seen this problem in fintech systems I've built, and every time the solution was the same: spend two weeks writing the same boilerplate from scratch. So I built trailkit — a lightweight, zero-infrastructure audit logging SDK for TypeScript. Here's what I learned along the way. The problem with existing solutions When I looked at the npm ecosystem, the situation was bleak. The audit-log package was last published 13 years ago. Most ORM-specific plugins are abandoned or locked to a single database. And commercial services like WorkOS charge $5,000+/month for 100 organizations — which makes no sense for a small B2B SaaS team that just needs to answer "who did what." The gap was clear: there's no lightweight, TypeScript-native library that just works out of the box. The insight that made everything click: AsyncLocalStorage The harde
Continue reading on Dev.to Webdev
Opens in a new tab



![[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One](/_next/image?url=https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1368%2F1*AvVpFzkFJBm-xns4niPLAA.png&w=1200&q=75)