[{"data":1,"prerenderedAt":1371},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-schema":421,"-logging-audit-schema-surround":1366},[4,35,159,201,289,318,405],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,299,304,309,314],{"title":295,"path":296,"stem":297,"icon":298},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F1.identity-headers","i-lucide-fingerprint",{"title":300,"path":301,"stem":302,"icon":303},"Stream API","\u002Fbuild-on-top\u002Fstream-api","5.build-on-top\u002F2.stream-api","i-lucide-radio-tower",{"title":305,"path":306,"stem":307,"icon":308},"SSE bridge","\u002Fbuild-on-top\u002Fsse-bridge","5.build-on-top\u002F3.sse-bridge","i-lucide-wifi",{"title":310,"path":311,"stem":312,"icon":313},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F4.fs-reader","i-lucide-folder-search",{"title":156,"path":315,"stem":316,"icon":317},"\u002Fbuild-on-top\u002Frecipes","5.build-on-top\u002F4.recipes","i-lucide-chef-hat",{"title":319,"path":320,"stem":321,"children":322,"page":34},"Adapters","\u002Fadapters","6.adapters",[323,326,366,381],{"title":41,"path":324,"stem":325,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":327,"path":328,"stem":329,"children":330,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[331,336,341,346,351,356,361],{"title":332,"path":333,"stem":334,"icon":335},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":337,"path":338,"stem":339,"icon":340},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":342,"path":343,"stem":344,"icon":345},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":347,"path":348,"stem":349,"icon":350},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":352,"path":353,"stem":354,"icon":355},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":357,"path":358,"stem":359,"icon":360},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":362,"path":363,"stem":364,"icon":365},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":367,"path":368,"stem":369,"children":370,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[371,376],{"title":372,"path":373,"stem":374,"icon":375},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":377,"path":378,"stem":379,"icon":380},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":382,"path":383,"stem":384,"children":385,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[386,391,396,400],{"title":387,"path":388,"stem":389,"icon":390},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":392,"path":393,"stem":394,"icon":395},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":397,"path":398,"stem":399,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":401,"path":402,"stem":403,"icon":404},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":406,"path":407,"stem":408,"children":409,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[410,413,417],{"title":41,"path":411,"stem":412,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":414,"path":415,"stem":416,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":418,"path":419,"stem":420,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":422,"title":423,"body":424,"description":1355,"extension":1356,"links":1357,"meta":1362,"navigation":1363,"path":138,"seo":1364,"stem":139,"__hash__":1365},"docs\u002F2.logging\u002F8.audit\u002F02.schema.md","Audit Schema",{"type":425,"value":426,"toc":1346},"minimark",[427,439,447,920,924,962,965,1077,1095,1099,1121,1196,1200,1246,1258,1262,1280,1283,1287,1329,1342],[428,429,430,434,435,438],"p",{},[431,432,433],"code",{},"event.audit"," is a typed field on every wide event. Downstream queries filter on ",[431,436,437],{},"audit IS NOT NULL"," to materialise an audit dataset out of regular logs.",[440,441,443,446],"h2",{"id":442},"auditfields-type",[431,444,445],{},"AuditFields"," type",[448,449,454],"pre",{"className":450,"code":451,"language":452,"meta":453,"style":453},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","interface AuditFields {\n  action: string                          \u002F\u002F 'invoice.refund'\n  actor: {\n    type: 'user' | 'system' | 'api' | 'agent'\n    id: string\n    displayName?: string\n    email?: string\n    \u002F\u002F For type === 'agent', mirrors evlog\u002Fai fields:\n    model?: string\n    tools?: string[]\n    reason?: string\n    promptId?: string\n  }\n  target?: { type: string, id: string, [k: string]: unknown }\n  outcome: 'success' | 'failure' | 'denied'\n  reason?: string\n  changes?: { before?: unknown, after?: unknown }\n  causationId?: string                    \u002F\u002F ID of the action that caused this one\n  correlationId?: string                  \u002F\u002F Shared by every action in one operation\n  version?: number                        \u002F\u002F Defaults to 1\n  idempotencyKey?: string                 \u002F\u002F Auto-derived; safe retries across drains\n  context?: {                             \u002F\u002F Filled by auditEnricher\n    requestId?: string\n    traceId?: string\n    ip?: string\n    userAgent?: string\n    tenantId?: string\n  }\n  signature?: string                      \u002F\u002F Set by signed({ strategy: 'hmac' })\n  prevHash?: string                       \u002F\u002F Set by signed({ strategy: 'hash-chain' })\n  hash?: string\n}\n","typescript","",[431,455,456,473,490,500,547,558,569,579,585,595,609,619,629,635,686,719,729,757,770,783,797,810,823,833,843,853,863,873,878,891,904,914],{"__ignoreMap":453},[457,458,461,465,469],"span",{"class":459,"line":460},"line",1,[457,462,464],{"class":463},"spNyl","interface",[457,466,468],{"class":467},"sBMFI"," AuditFields",[457,470,472],{"class":471},"sMK4o"," {\n",[457,474,476,480,483,486],{"class":459,"line":475},2,[457,477,479],{"class":478},"swJcz","  action",[457,481,482],{"class":471},":",[457,484,485],{"class":467}," string",[457,487,489],{"class":488},"sHwdD","                          \u002F\u002F 'invoice.refund'\n",[457,491,493,496,498],{"class":459,"line":492},3,[457,494,495],{"class":478},"  actor",[457,497,482],{"class":471},[457,499,472],{"class":471},[457,501,503,506,508,511,515,518,521,523,526,528,530,532,535,537,539,541,544],{"class":459,"line":502},4,[457,504,505],{"class":478},"    type",[457,507,482],{"class":471},[457,509,510],{"class":471}," '",[457,512,514],{"class":513},"sfazB","user",[457,516,517],{"class":471},"'",[457,519,520],{"class":471}," |",[457,522,510],{"class":471},[457,524,525],{"class":513},"system",[457,527,517],{"class":471},[457,529,520],{"class":471},[457,531,510],{"class":471},[457,533,534],{"class":513},"api",[457,536,517],{"class":471},[457,538,520],{"class":471},[457,540,510],{"class":471},[457,542,543],{"class":513},"agent",[457,545,546],{"class":471},"'\n",[457,548,550,553,555],{"class":459,"line":549},5,[457,551,552],{"class":478},"    id",[457,554,482],{"class":471},[457,556,557],{"class":467}," string\n",[457,559,561,564,567],{"class":459,"line":560},6,[457,562,563],{"class":478},"    displayName",[457,565,566],{"class":471},"?:",[457,568,557],{"class":467},[457,570,572,575,577],{"class":459,"line":571},7,[457,573,574],{"class":478},"    email",[457,576,566],{"class":471},[457,578,557],{"class":467},[457,580,582],{"class":459,"line":581},8,[457,583,584],{"class":488},"    \u002F\u002F For type === 'agent', mirrors evlog\u002Fai fields:\n",[457,586,588,591,593],{"class":459,"line":587},9,[457,589,590],{"class":478},"    model",[457,592,566],{"class":471},[457,594,557],{"class":467},[457,596,598,601,603,605],{"class":459,"line":597},10,[457,599,600],{"class":478},"    tools",[457,602,566],{"class":471},[457,604,485],{"class":467},[457,606,608],{"class":607},"sTEyZ","[]\n",[457,610,612,615,617],{"class":459,"line":611},11,[457,613,614],{"class":478},"    reason",[457,616,566],{"class":471},[457,618,557],{"class":467},[457,620,622,625,627],{"class":459,"line":621},12,[457,623,624],{"class":478},"    promptId",[457,626,566],{"class":471},[457,628,557],{"class":467},[457,630,632],{"class":459,"line":631},13,[457,633,634],{"class":471},"  }\n",[457,636,638,641,643,646,648,650,652,655,658,660,662,664,667,671,673,675,678,680,683],{"class":459,"line":637},14,[457,639,640],{"class":478},"  target",[457,642,566],{"class":471},[457,644,645],{"class":471}," {",[457,647,446],{"class":478},[457,649,482],{"class":471},[457,651,485],{"class":467},[457,653,654],{"class":471},",",[457,656,657],{"class":478}," id",[457,659,482],{"class":471},[457,661,485],{"class":467},[457,663,654],{"class":471},[457,665,666],{"class":607}," [",[457,668,670],{"class":669},"sHdIc","k",[457,672,482],{"class":471},[457,674,485],{"class":467},[457,676,677],{"class":607},"]",[457,679,482],{"class":471},[457,681,682],{"class":467}," unknown",[457,684,685],{"class":471}," }\n",[457,687,689,692,694,696,699,701,703,705,708,710,712,714,717],{"class":459,"line":688},15,[457,690,691],{"class":478},"  outcome",[457,693,482],{"class":471},[457,695,510],{"class":471},[457,697,698],{"class":513},"success",[457,700,517],{"class":471},[457,702,520],{"class":471},[457,704,510],{"class":471},[457,706,707],{"class":513},"failure",[457,709,517],{"class":471},[457,711,520],{"class":471},[457,713,510],{"class":471},[457,715,716],{"class":513},"denied",[457,718,546],{"class":471},[457,720,722,725,727],{"class":459,"line":721},16,[457,723,724],{"class":478},"  reason",[457,726,566],{"class":471},[457,728,557],{"class":467},[457,730,732,735,737,739,742,744,746,748,751,753,755],{"class":459,"line":731},17,[457,733,734],{"class":478},"  changes",[457,736,566],{"class":471},[457,738,645],{"class":471},[457,740,741],{"class":478}," before",[457,743,566],{"class":471},[457,745,682],{"class":467},[457,747,654],{"class":471},[457,749,750],{"class":478}," after",[457,752,566],{"class":471},[457,754,682],{"class":467},[457,756,685],{"class":471},[457,758,760,763,765,767],{"class":459,"line":759},18,[457,761,762],{"class":478},"  causationId",[457,764,566],{"class":471},[457,766,485],{"class":467},[457,768,769],{"class":488},"                    \u002F\u002F ID of the action that caused this one\n",[457,771,773,776,778,780],{"class":459,"line":772},19,[457,774,775],{"class":478},"  correlationId",[457,777,566],{"class":471},[457,779,485],{"class":467},[457,781,782],{"class":488},"                  \u002F\u002F Shared by every action in one operation\n",[457,784,786,789,791,794],{"class":459,"line":785},20,[457,787,788],{"class":478},"  version",[457,790,566],{"class":471},[457,792,793],{"class":467}," number",[457,795,796],{"class":488},"                        \u002F\u002F Defaults to 1\n",[457,798,800,803,805,807],{"class":459,"line":799},21,[457,801,802],{"class":478},"  idempotencyKey",[457,804,566],{"class":471},[457,806,485],{"class":467},[457,808,809],{"class":488},"                 \u002F\u002F Auto-derived; safe retries across drains\n",[457,811,813,816,818,820],{"class":459,"line":812},22,[457,814,815],{"class":478},"  context",[457,817,566],{"class":471},[457,819,645],{"class":471},[457,821,822],{"class":488},"                             \u002F\u002F Filled by auditEnricher\n",[457,824,826,829,831],{"class":459,"line":825},23,[457,827,828],{"class":478},"    requestId",[457,830,566],{"class":471},[457,832,557],{"class":467},[457,834,836,839,841],{"class":459,"line":835},24,[457,837,838],{"class":478},"    traceId",[457,840,566],{"class":471},[457,842,557],{"class":467},[457,844,846,849,851],{"class":459,"line":845},25,[457,847,848],{"class":478},"    ip",[457,850,566],{"class":471},[457,852,557],{"class":467},[457,854,856,859,861],{"class":459,"line":855},26,[457,857,858],{"class":478},"    userAgent",[457,860,566],{"class":471},[457,862,557],{"class":467},[457,864,866,869,871],{"class":459,"line":865},27,[457,867,868],{"class":478},"    tenantId",[457,870,566],{"class":471},[457,872,557],{"class":467},[457,874,876],{"class":459,"line":875},28,[457,877,634],{"class":471},[457,879,881,884,886,888],{"class":459,"line":880},29,[457,882,883],{"class":478},"  signature",[457,885,566],{"class":471},[457,887,485],{"class":467},[457,889,890],{"class":488},"                      \u002F\u002F Set by signed({ strategy: 'hmac' })\n",[457,892,894,897,899,901],{"class":459,"line":893},30,[457,895,896],{"class":478},"  prevHash",[457,898,566],{"class":471},[457,900,485],{"class":467},[457,902,903],{"class":488},"                       \u002F\u002F Set by signed({ strategy: 'hash-chain' })\n",[457,905,907,910,912],{"class":459,"line":906},31,[457,908,909],{"class":478},"  hash",[457,911,566],{"class":471},[457,913,557],{"class":467},[457,915,917],{"class":459,"line":916},32,[457,918,919],{"class":471},"}\n",[440,921,923],{"id":922},"action-naming","Action naming",[925,926,927,935,936,939,940,943,944,943,947,950,951,954,955,958,959,961],"tip",{},[928,929,930,931,934],"strong",{},"Naming convention for ",[431,932,933],{},"action","."," Use ",[431,937,938],{},"noun.verb"," (",[431,941,942],{},"invoice.refund",", ",[431,945,946],{},"user.invite",[431,948,949],{},"apiKey.revoke","). Past tense if the action already happened (",[431,952,953],{},"invoice.refunded","), present tense if ",[431,956,957],{},"withAudit()"," will resolve the outcome. Keep a small fixed dictionary in one file — auditors and SIEM rules query on ",[431,960,933],{},", so a typo is a missing alert.",[428,963,964],{},"A single dictionary file makes alerting straightforward:",[448,966,969],{"className":450,"code":967,"filename":968,"language":452,"meta":453,"style":453},"export const AUDIT_ACTIONS = {\n  USER_INVITE: 'user.invite',\n  USER_REMOVE: 'user.remove',\n  USER_ROLE_CHANGE: 'user.role-change',\n  INVOICE_REFUND: 'invoice.refund',\n  API_KEY_REVOKE: 'apiKey.revoke',\n} as const\n","src\u002Faudit\u002Factions.ts",[431,970,971,988,1004,1020,1036,1051,1066],{"__ignoreMap":453},[457,972,973,977,980,983,986],{"class":459,"line":460},[457,974,976],{"class":975},"s7zQu","export",[457,978,979],{"class":463}," const",[457,981,982],{"class":607}," AUDIT_ACTIONS ",[457,984,985],{"class":471},"=",[457,987,472],{"class":471},[457,989,990,993,995,997,999,1001],{"class":459,"line":475},[457,991,992],{"class":478},"  USER_INVITE",[457,994,482],{"class":471},[457,996,510],{"class":471},[457,998,946],{"class":513},[457,1000,517],{"class":471},[457,1002,1003],{"class":471},",\n",[457,1005,1006,1009,1011,1013,1016,1018],{"class":459,"line":492},[457,1007,1008],{"class":478},"  USER_REMOVE",[457,1010,482],{"class":471},[457,1012,510],{"class":471},[457,1014,1015],{"class":513},"user.remove",[457,1017,517],{"class":471},[457,1019,1003],{"class":471},[457,1021,1022,1025,1027,1029,1032,1034],{"class":459,"line":502},[457,1023,1024],{"class":478},"  USER_ROLE_CHANGE",[457,1026,482],{"class":471},[457,1028,510],{"class":471},[457,1030,1031],{"class":513},"user.role-change",[457,1033,517],{"class":471},[457,1035,1003],{"class":471},[457,1037,1038,1041,1043,1045,1047,1049],{"class":459,"line":549},[457,1039,1040],{"class":478},"  INVOICE_REFUND",[457,1042,482],{"class":471},[457,1044,510],{"class":471},[457,1046,942],{"class":513},[457,1048,517],{"class":471},[457,1050,1003],{"class":471},[457,1052,1053,1056,1058,1060,1062,1064],{"class":459,"line":560},[457,1054,1055],{"class":478},"  API_KEY_REVOKE",[457,1057,482],{"class":471},[457,1059,510],{"class":471},[457,1061,949],{"class":513},[457,1063,517],{"class":471},[457,1065,1003],{"class":471},[457,1067,1068,1071,1074],{"class":459,"line":571},[457,1069,1070],{"class":471},"}",[457,1072,1073],{"class":975}," as",[457,1075,1076],{"class":463}," const\n",[925,1078,1079,1080,1087,1088,1090,1091,1094],{},"For more than a handful of actions, prefer ",[1081,1082,1084],"a",{"href":1083},"\u002Flogging\u002Faudit\u002Frecording#defineauditcatalog",[431,1085,1086],{},"defineAuditCatalog"," over a plain object dictionary — same ",[431,1089,938],{}," convention, but you get autocomplete on the action union and per-entry ",[431,1092,1093],{},"target"," type inference for free.",[440,1096,1098],{"id":1097},"actor-types","Actor types",[1100,1101,1102,935,1105,1108,1109,1112,1113,1116,1117,1120],"warning",{},[928,1103,1104],{},"Don't fake the actor.",[431,1106,1107],{},"actor.type: 'system'"," for cron jobs, queue workers, and background tasks; ",[431,1110,1111],{},"actor.type: 'api'"," for machine-to-machine calls authenticated by a token; ",[431,1114,1115],{},"actor.type: 'agent'"," for AI tool calls. Logging a synthetic ",[431,1118,1119],{},"'user'"," for system actions is the single fastest way to fail an audit review.",[1122,1123,1124,1139],"table",{},[1125,1126,1127],"thead",{},[1128,1129,1130,1136],"tr",{},[1131,1132,1133],"th",{},[431,1134,1135],{},"actor.type",[1131,1137,1138],{},"When to use",[1140,1141,1142,1152,1162,1172],"tbody",{},[1128,1143,1144,1149],{},[1145,1146,1147],"td",{},[431,1148,1119],{},[1145,1150,1151],{},"A human authenticated through your normal auth flow.",[1128,1153,1154,1159],{},[1145,1155,1156],{},[431,1157,1158],{},"'system'",[1145,1160,1161],{},"Cron jobs, queue workers, scheduled tasks, internal background processes.",[1128,1163,1164,1169],{},[1145,1165,1166],{},[431,1167,1168],{},"'api'",[1145,1170,1171],{},"Machine-to-machine calls from another service authenticated by a token.",[1128,1173,1174,1179],{},[1145,1175,1176],{},[431,1177,1178],{},"'agent'",[1145,1180,1181,1182,1185,1186,943,1189,943,1192,1195],{},"AI tool calls (combine with ",[431,1183,1184],{},"evlog\u002Fai"," fields like ",[431,1187,1188],{},"model",[431,1190,1191],{},"tools",[431,1193,1194],{},"promptId",").",[440,1197,1199],{"id":1198},"outcomes","Outcomes",[1122,1201,1202,1214],{},[1125,1203,1204],{},[1128,1205,1206,1211],{},[1131,1207,1208],{},[431,1209,1210],{},"outcome",[1131,1212,1213],{},"Meaning",[1140,1215,1216,1226,1236],{},[1128,1217,1218,1223],{},[1145,1219,1220],{},[431,1221,1222],{},"'success'",[1145,1224,1225],{},"The action completed as requested.",[1128,1227,1228,1233],{},[1145,1229,1230],{},[431,1231,1232],{},"'failure'",[1145,1234,1235],{},"The action was attempted but failed (downstream error, race condition, etc.).",[1128,1237,1238,1243],{},[1145,1239,1240],{},[431,1241,1242],{},"'denied'",[1145,1244,1245],{},"The action was rejected by an authorisation check.",[428,1247,1248,1250,1251,1253,1254,1195],{},[431,1249,1232],{}," and ",[431,1252,1242],{}," are different things — auditors care a lot about denied actions because they signal probing or misconfigured access controls. Always log denials (see ",[1081,1255,1257],{"href":1256},"\u002Flogging\u002Faudit\u002Frecording#deny","Recording Events",[440,1259,1261],{"id":1260},"idempotency","Idempotency",[428,1263,1264,1267,1268,943,1270,943,1273,1275,1276,1279],{},[431,1265,1266],{},"idempotencyKey"," is auto-derived from a hash of ",[431,1269,933],{},[431,1271,1272],{},"actor.id",[431,1274,1093],{},", and a coarse timestamp. The result: even if your drain retries an audit insert across a network blip, the duplicate row collapses on ",[431,1277,1278],{},"ON CONFLICT DO NOTHING",". You don't have to think about it — it's filled in for you.",[428,1281,1282],{},"Use the field as the primary key in Postgres \u002F Bigtable \u002F DynamoDB so retries stay safe by construction.",[440,1284,1286],{"id":1285},"causation-and-correlation","Causation and correlation",[1122,1288,1289,1299],{},[1125,1290,1291],{},[1128,1292,1293,1296],{},[1131,1294,1295],{},"Field",[1131,1297,1298],{},"Use case",[1140,1300,1301,1315],{},[1128,1302,1303,1308],{},[1145,1304,1305],{},[431,1306,1307],{},"correlationId",[1145,1309,1310,1311,1314],{},"Shared by every audit event that belongs to the ",[928,1312,1313],{},"same operation"," (e.g. one HTTP request that triggers a refund + an email + a webhook).",[1128,1316,1317,1322],{},[1145,1318,1319],{},[431,1320,1321],{},"causationId",[1145,1323,1324,1325,1328],{},"The id of the previous audit event that ",[928,1326,1327],{},"caused"," this one. Useful for reconstructing chains of cascading actions.",[428,1330,1331,1332,1334,1335,1338,1339,1341],{},"Most teams set ",[431,1333,1307],{}," to ",[431,1336,1337],{},"requestId",". ",[431,1340,1321],{}," is opt-in and only worth filling when a single user action triggers many internal audit events.",[1343,1344,1345],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":453,"searchDepth":475,"depth":475,"links":1347},[1348,1350,1351,1352,1353,1354],{"id":442,"depth":475,"text":1349},"AuditFields type",{"id":922,"depth":475,"text":923},{"id":1097,"depth":475,"text":1098},{"id":1198,"depth":475,"text":1199},{"id":1260,"depth":475,"text":1261},{"id":1285,"depth":475,"text":1286},"The AuditFields type, action naming conventions, actor types, idempotency, and how the schema sits inside a regular wide event.","md",[1358,1361],{"label":41,"icon":44,"to":134,"color":1359,"variant":1360},"neutral","subtle",{"label":142,"icon":145,"to":143,"color":1359,"variant":1360},{},{"title":137,"icon":140},{"title":423,"description":1355},"gy1kpgQgCJ5-_0ppU0U_2a2vwc_fY_N0gnhdM_FTWZM",[1367,1369],{"title":41,"path":134,"stem":135,"description":1368,"icon":44,"children":-1},"First-class audit logs as a thin layer on top of evlog's wide events. Add tamper-evident audit trails to any app with one enricher, one drain wrapper, and one helper.",{"title":142,"path":143,"stem":144,"description":1370,"icon":145,"children":-1},"log.audit, log.audit.deny, standalone audit(), withAudit auto-instrumentation, defineAuditAction and defineAuditCatalog registries, and auditDiff change patches.",1778330170544]