[{"data":1,"prerenderedAt":1379},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-schema":429,"-logging-audit-schema-surround":1374},[4,35,159,201,289,326,413],{"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,297,302,307,312,317,321],{"title":41,"path":295,"stem":296,"icon":54},"\u002Fbuild-on-top\u002Foverview","5.build-on-top\u002F0.overview",{"title":298,"path":299,"stem":300,"icon":301},"Stream API","\u002Fbuild-on-top\u002Fstream-api","5.build-on-top\u002F1.stream-api","i-lucide-radio-tower",{"title":303,"path":304,"stem":305,"icon":306},"Stream server","\u002Fbuild-on-top\u002Fstream-server","5.build-on-top\u002F2.stream-server","i-lucide-radio",{"title":308,"path":309,"stem":310,"icon":311},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F3.fs-reader","i-lucide-folder-search",{"title":313,"path":314,"stem":315,"icon":316},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F4.identity-headers","i-lucide-fingerprint",{"title":156,"path":318,"stem":319,"icon":320},"\u002Fbuild-on-top\u002Frecipes","5.build-on-top\u002F5.recipes","i-lucide-chef-hat",{"title":322,"path":323,"stem":324,"icon":325},"Catalogs as packages","\u002Fbuild-on-top\u002Fcatalogs-as-packages","5.build-on-top\u002F6.catalogs-as-packages","i-lucide-package",{"title":327,"path":328,"stem":329,"children":330,"page":34},"Adapters","\u002Fadapters","6.adapters",[331,334,374,389],{"title":41,"path":332,"stem":333,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":335,"path":336,"stem":337,"children":338,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[339,344,349,354,359,364,369],{"title":340,"path":341,"stem":342,"icon":343},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":345,"path":346,"stem":347,"icon":348},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":350,"path":351,"stem":352,"icon":353},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":355,"path":356,"stem":357,"icon":358},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":360,"path":361,"stem":362,"icon":363},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":365,"path":366,"stem":367,"icon":368},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":370,"path":371,"stem":372,"icon":373},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":375,"path":376,"stem":377,"children":378,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[379,384],{"title":380,"path":381,"stem":382,"icon":383},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":385,"path":386,"stem":387,"icon":388},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":390,"path":391,"stem":392,"children":393,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[394,399,404,408],{"title":395,"path":396,"stem":397,"icon":398},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":400,"path":401,"stem":402,"icon":403},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":405,"path":406,"stem":407,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":409,"path":410,"stem":411,"icon":412},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":414,"path":415,"stem":416,"children":417,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[418,421,425],{"title":41,"path":419,"stem":420,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":422,"path":423,"stem":424,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":426,"path":427,"stem":428,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":430,"title":431,"body":432,"description":1363,"extension":1364,"links":1365,"meta":1370,"navigation":1371,"path":138,"seo":1372,"stem":139,"__hash__":1373},"docs\u002F2.logging\u002F8.audit\u002F02.schema.md","Audit Schema",{"type":433,"value":434,"toc":1354},"minimark",[435,447,455,928,932,970,973,1085,1103,1107,1129,1204,1208,1254,1266,1270,1288,1291,1295,1337,1350],[436,437,438,442,443,446],"p",{},[439,440,441],"code",{},"event.audit"," is a typed field on every wide event. Downstream queries filter on ",[439,444,445],{},"audit IS NOT NULL"," to materialise an audit dataset out of regular logs.",[448,449,451,454],"h2",{"id":450},"auditfields-type",[439,452,453],{},"AuditFields"," type",[456,457,462],"pre",{"className":458,"code":459,"language":460,"meta":461,"style":461},"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","",[439,463,464,481,498,508,555,566,577,587,593,603,617,627,637,643,694,727,737,765,778,791,805,818,831,841,851,861,871,881,886,899,912,922],{"__ignoreMap":461},[465,466,469,473,477],"span",{"class":467,"line":468},"line",1,[465,470,472],{"class":471},"spNyl","interface",[465,474,476],{"class":475},"sBMFI"," AuditFields",[465,478,480],{"class":479},"sMK4o"," {\n",[465,482,484,488,491,494],{"class":467,"line":483},2,[465,485,487],{"class":486},"swJcz","  action",[465,489,490],{"class":479},":",[465,492,493],{"class":475}," string",[465,495,497],{"class":496},"sHwdD","                          \u002F\u002F 'invoice.refund'\n",[465,499,501,504,506],{"class":467,"line":500},3,[465,502,503],{"class":486},"  actor",[465,505,490],{"class":479},[465,507,480],{"class":479},[465,509,511,514,516,519,523,526,529,531,534,536,538,540,543,545,547,549,552],{"class":467,"line":510},4,[465,512,513],{"class":486},"    type",[465,515,490],{"class":479},[465,517,518],{"class":479}," '",[465,520,522],{"class":521},"sfazB","user",[465,524,525],{"class":479},"'",[465,527,528],{"class":479}," |",[465,530,518],{"class":479},[465,532,533],{"class":521},"system",[465,535,525],{"class":479},[465,537,528],{"class":479},[465,539,518],{"class":479},[465,541,542],{"class":521},"api",[465,544,525],{"class":479},[465,546,528],{"class":479},[465,548,518],{"class":479},[465,550,551],{"class":521},"agent",[465,553,554],{"class":479},"'\n",[465,556,558,561,563],{"class":467,"line":557},5,[465,559,560],{"class":486},"    id",[465,562,490],{"class":479},[465,564,565],{"class":475}," string\n",[465,567,569,572,575],{"class":467,"line":568},6,[465,570,571],{"class":486},"    displayName",[465,573,574],{"class":479},"?:",[465,576,565],{"class":475},[465,578,580,583,585],{"class":467,"line":579},7,[465,581,582],{"class":486},"    email",[465,584,574],{"class":479},[465,586,565],{"class":475},[465,588,590],{"class":467,"line":589},8,[465,591,592],{"class":496},"    \u002F\u002F For type === 'agent', mirrors evlog\u002Fai fields:\n",[465,594,596,599,601],{"class":467,"line":595},9,[465,597,598],{"class":486},"    model",[465,600,574],{"class":479},[465,602,565],{"class":475},[465,604,606,609,611,613],{"class":467,"line":605},10,[465,607,608],{"class":486},"    tools",[465,610,574],{"class":479},[465,612,493],{"class":475},[465,614,616],{"class":615},"sTEyZ","[]\n",[465,618,620,623,625],{"class":467,"line":619},11,[465,621,622],{"class":486},"    reason",[465,624,574],{"class":479},[465,626,565],{"class":475},[465,628,630,633,635],{"class":467,"line":629},12,[465,631,632],{"class":486},"    promptId",[465,634,574],{"class":479},[465,636,565],{"class":475},[465,638,640],{"class":467,"line":639},13,[465,641,642],{"class":479},"  }\n",[465,644,646,649,651,654,656,658,660,663,666,668,670,672,675,679,681,683,686,688,691],{"class":467,"line":645},14,[465,647,648],{"class":486},"  target",[465,650,574],{"class":479},[465,652,653],{"class":479}," {",[465,655,454],{"class":486},[465,657,490],{"class":479},[465,659,493],{"class":475},[465,661,662],{"class":479},",",[465,664,665],{"class":486}," id",[465,667,490],{"class":479},[465,669,493],{"class":475},[465,671,662],{"class":479},[465,673,674],{"class":615}," [",[465,676,678],{"class":677},"sHdIc","k",[465,680,490],{"class":479},[465,682,493],{"class":475},[465,684,685],{"class":615},"]",[465,687,490],{"class":479},[465,689,690],{"class":475}," unknown",[465,692,693],{"class":479}," }\n",[465,695,697,700,702,704,707,709,711,713,716,718,720,722,725],{"class":467,"line":696},15,[465,698,699],{"class":486},"  outcome",[465,701,490],{"class":479},[465,703,518],{"class":479},[465,705,706],{"class":521},"success",[465,708,525],{"class":479},[465,710,528],{"class":479},[465,712,518],{"class":479},[465,714,715],{"class":521},"failure",[465,717,525],{"class":479},[465,719,528],{"class":479},[465,721,518],{"class":479},[465,723,724],{"class":521},"denied",[465,726,554],{"class":479},[465,728,730,733,735],{"class":467,"line":729},16,[465,731,732],{"class":486},"  reason",[465,734,574],{"class":479},[465,736,565],{"class":475},[465,738,740,743,745,747,750,752,754,756,759,761,763],{"class":467,"line":739},17,[465,741,742],{"class":486},"  changes",[465,744,574],{"class":479},[465,746,653],{"class":479},[465,748,749],{"class":486}," before",[465,751,574],{"class":479},[465,753,690],{"class":475},[465,755,662],{"class":479},[465,757,758],{"class":486}," after",[465,760,574],{"class":479},[465,762,690],{"class":475},[465,764,693],{"class":479},[465,766,768,771,773,775],{"class":467,"line":767},18,[465,769,770],{"class":486},"  causationId",[465,772,574],{"class":479},[465,774,493],{"class":475},[465,776,777],{"class":496},"                    \u002F\u002F ID of the action that caused this one\n",[465,779,781,784,786,788],{"class":467,"line":780},19,[465,782,783],{"class":486},"  correlationId",[465,785,574],{"class":479},[465,787,493],{"class":475},[465,789,790],{"class":496},"                  \u002F\u002F Shared by every action in one operation\n",[465,792,794,797,799,802],{"class":467,"line":793},20,[465,795,796],{"class":486},"  version",[465,798,574],{"class":479},[465,800,801],{"class":475}," number",[465,803,804],{"class":496},"                        \u002F\u002F Defaults to 1\n",[465,806,808,811,813,815],{"class":467,"line":807},21,[465,809,810],{"class":486},"  idempotencyKey",[465,812,574],{"class":479},[465,814,493],{"class":475},[465,816,817],{"class":496},"                 \u002F\u002F Auto-derived; safe retries across drains\n",[465,819,821,824,826,828],{"class":467,"line":820},22,[465,822,823],{"class":486},"  context",[465,825,574],{"class":479},[465,827,653],{"class":479},[465,829,830],{"class":496},"                             \u002F\u002F Filled by auditEnricher\n",[465,832,834,837,839],{"class":467,"line":833},23,[465,835,836],{"class":486},"    requestId",[465,838,574],{"class":479},[465,840,565],{"class":475},[465,842,844,847,849],{"class":467,"line":843},24,[465,845,846],{"class":486},"    traceId",[465,848,574],{"class":479},[465,850,565],{"class":475},[465,852,854,857,859],{"class":467,"line":853},25,[465,855,856],{"class":486},"    ip",[465,858,574],{"class":479},[465,860,565],{"class":475},[465,862,864,867,869],{"class":467,"line":863},26,[465,865,866],{"class":486},"    userAgent",[465,868,574],{"class":479},[465,870,565],{"class":475},[465,872,874,877,879],{"class":467,"line":873},27,[465,875,876],{"class":486},"    tenantId",[465,878,574],{"class":479},[465,880,565],{"class":475},[465,882,884],{"class":467,"line":883},28,[465,885,642],{"class":479},[465,887,889,892,894,896],{"class":467,"line":888},29,[465,890,891],{"class":486},"  signature",[465,893,574],{"class":479},[465,895,493],{"class":475},[465,897,898],{"class":496},"                      \u002F\u002F Set by signed({ strategy: 'hmac' })\n",[465,900,902,905,907,909],{"class":467,"line":901},30,[465,903,904],{"class":486},"  prevHash",[465,906,574],{"class":479},[465,908,493],{"class":475},[465,910,911],{"class":496},"                       \u002F\u002F Set by signed({ strategy: 'hash-chain' })\n",[465,913,915,918,920],{"class":467,"line":914},31,[465,916,917],{"class":486},"  hash",[465,919,574],{"class":479},[465,921,565],{"class":475},[465,923,925],{"class":467,"line":924},32,[465,926,927],{"class":479},"}\n",[448,929,931],{"id":930},"action-naming","Action naming",[933,934,935,943,944,947,948,951,952,951,955,958,959,962,963,966,967,969],"tip",{},[936,937,938,939,942],"strong",{},"Naming convention for ",[439,940,941],{},"action","."," Use ",[439,945,946],{},"noun.verb"," (",[439,949,950],{},"invoice.refund",", ",[439,953,954],{},"user.invite",[439,956,957],{},"apiKey.revoke","). Past tense if the action already happened (",[439,960,961],{},"invoice.refunded","), present tense if ",[439,964,965],{},"withAudit()"," will resolve the outcome. Keep a small fixed dictionary in one file — auditors and SIEM rules query on ",[439,968,941],{},", so a typo is a missing alert.",[436,971,972],{},"A single dictionary file makes alerting straightforward:",[456,974,977],{"className":458,"code":975,"filename":976,"language":460,"meta":461,"style":461},"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",[439,978,979,996,1012,1028,1044,1059,1074],{"__ignoreMap":461},[465,980,981,985,988,991,994],{"class":467,"line":468},[465,982,984],{"class":983},"s7zQu","export",[465,986,987],{"class":471}," const",[465,989,990],{"class":615}," AUDIT_ACTIONS ",[465,992,993],{"class":479},"=",[465,995,480],{"class":479},[465,997,998,1001,1003,1005,1007,1009],{"class":467,"line":483},[465,999,1000],{"class":486},"  USER_INVITE",[465,1002,490],{"class":479},[465,1004,518],{"class":479},[465,1006,954],{"class":521},[465,1008,525],{"class":479},[465,1010,1011],{"class":479},",\n",[465,1013,1014,1017,1019,1021,1024,1026],{"class":467,"line":500},[465,1015,1016],{"class":486},"  USER_REMOVE",[465,1018,490],{"class":479},[465,1020,518],{"class":479},[465,1022,1023],{"class":521},"user.remove",[465,1025,525],{"class":479},[465,1027,1011],{"class":479},[465,1029,1030,1033,1035,1037,1040,1042],{"class":467,"line":510},[465,1031,1032],{"class":486},"  USER_ROLE_CHANGE",[465,1034,490],{"class":479},[465,1036,518],{"class":479},[465,1038,1039],{"class":521},"user.role-change",[465,1041,525],{"class":479},[465,1043,1011],{"class":479},[465,1045,1046,1049,1051,1053,1055,1057],{"class":467,"line":557},[465,1047,1048],{"class":486},"  INVOICE_REFUND",[465,1050,490],{"class":479},[465,1052,518],{"class":479},[465,1054,950],{"class":521},[465,1056,525],{"class":479},[465,1058,1011],{"class":479},[465,1060,1061,1064,1066,1068,1070,1072],{"class":467,"line":568},[465,1062,1063],{"class":486},"  API_KEY_REVOKE",[465,1065,490],{"class":479},[465,1067,518],{"class":479},[465,1069,957],{"class":521},[465,1071,525],{"class":479},[465,1073,1011],{"class":479},[465,1075,1076,1079,1082],{"class":467,"line":579},[465,1077,1078],{"class":479},"}",[465,1080,1081],{"class":983}," as",[465,1083,1084],{"class":471}," const\n",[933,1086,1087,1088,1095,1096,1098,1099,1102],{},"For more than a handful of actions, prefer ",[1089,1090,1092],"a",{"href":1091},"\u002Flogging\u002Faudit\u002Frecording#defineauditcatalog",[439,1093,1094],{},"defineAuditCatalog"," over a plain object dictionary — same ",[439,1097,946],{}," convention, but you get autocomplete on the action union and per-entry ",[439,1100,1101],{},"target"," type inference for free.",[448,1104,1106],{"id":1105},"actor-types","Actor types",[1108,1109,1110,943,1113,1116,1117,1120,1121,1124,1125,1128],"warning",{},[936,1111,1112],{},"Don't fake the actor.",[439,1114,1115],{},"actor.type: 'system'"," for cron jobs, queue workers, and background tasks; ",[439,1118,1119],{},"actor.type: 'api'"," for machine-to-machine calls authenticated by a token; ",[439,1122,1123],{},"actor.type: 'agent'"," for AI tool calls. Logging a synthetic ",[439,1126,1127],{},"'user'"," for system actions is the single fastest way to fail an audit review.",[1130,1131,1132,1147],"table",{},[1133,1134,1135],"thead",{},[1136,1137,1138,1144],"tr",{},[1139,1140,1141],"th",{},[439,1142,1143],{},"actor.type",[1139,1145,1146],{},"When to use",[1148,1149,1150,1160,1170,1180],"tbody",{},[1136,1151,1152,1157],{},[1153,1154,1155],"td",{},[439,1156,1127],{},[1153,1158,1159],{},"A human authenticated through your normal auth flow.",[1136,1161,1162,1167],{},[1153,1163,1164],{},[439,1165,1166],{},"'system'",[1153,1168,1169],{},"Cron jobs, queue workers, scheduled tasks, internal background processes.",[1136,1171,1172,1177],{},[1153,1173,1174],{},[439,1175,1176],{},"'api'",[1153,1178,1179],{},"Machine-to-machine calls from another service authenticated by a token.",[1136,1181,1182,1187],{},[1153,1183,1184],{},[439,1185,1186],{},"'agent'",[1153,1188,1189,1190,1193,1194,951,1197,951,1200,1203],{},"AI tool calls (combine with ",[439,1191,1192],{},"evlog\u002Fai"," fields like ",[439,1195,1196],{},"model",[439,1198,1199],{},"tools",[439,1201,1202],{},"promptId",").",[448,1205,1207],{"id":1206},"outcomes","Outcomes",[1130,1209,1210,1222],{},[1133,1211,1212],{},[1136,1213,1214,1219],{},[1139,1215,1216],{},[439,1217,1218],{},"outcome",[1139,1220,1221],{},"Meaning",[1148,1223,1224,1234,1244],{},[1136,1225,1226,1231],{},[1153,1227,1228],{},[439,1229,1230],{},"'success'",[1153,1232,1233],{},"The action completed as requested.",[1136,1235,1236,1241],{},[1153,1237,1238],{},[439,1239,1240],{},"'failure'",[1153,1242,1243],{},"The action was attempted but failed (downstream error, race condition, etc.).",[1136,1245,1246,1251],{},[1153,1247,1248],{},[439,1249,1250],{},"'denied'",[1153,1252,1253],{},"The action was rejected by an authorisation check.",[436,1255,1256,1258,1259,1261,1262,1203],{},[439,1257,1240],{}," and ",[439,1260,1250],{}," are different things — auditors care a lot about denied actions because they signal probing or misconfigured access controls. Always log denials (see ",[1089,1263,1265],{"href":1264},"\u002Flogging\u002Faudit\u002Frecording#deny","Recording Events",[448,1267,1269],{"id":1268},"idempotency","Idempotency",[436,1271,1272,1275,1276,951,1278,951,1281,1283,1284,1287],{},[439,1273,1274],{},"idempotencyKey"," is auto-derived from a hash of ",[439,1277,941],{},[439,1279,1280],{},"actor.id",[439,1282,1101],{},", and a coarse timestamp. The result: even if your drain retries an audit insert across a network blip, the duplicate row collapses on ",[439,1285,1286],{},"ON CONFLICT DO NOTHING",". You don't have to think about it — it's filled in for you.",[436,1289,1290],{},"Use the field as the primary key in Postgres \u002F Bigtable \u002F DynamoDB so retries stay safe by construction.",[448,1292,1294],{"id":1293},"causation-and-correlation","Causation and correlation",[1130,1296,1297,1307],{},[1133,1298,1299],{},[1136,1300,1301,1304],{},[1139,1302,1303],{},"Field",[1139,1305,1306],{},"Use case",[1148,1308,1309,1323],{},[1136,1310,1311,1316],{},[1153,1312,1313],{},[439,1314,1315],{},"correlationId",[1153,1317,1318,1319,1322],{},"Shared by every audit event that belongs to the ",[936,1320,1321],{},"same operation"," (e.g. one HTTP request that triggers a refund + an email + a webhook).",[1136,1324,1325,1330],{},[1153,1326,1327],{},[439,1328,1329],{},"causationId",[1153,1331,1332,1333,1336],{},"The id of the previous audit event that ",[936,1334,1335],{},"caused"," this one. Useful for reconstructing chains of cascading actions.",[436,1338,1339,1340,1342,1343,1346,1347,1349],{},"Most teams set ",[439,1341,1315],{}," to ",[439,1344,1345],{},"requestId",". ",[439,1348,1329],{}," is opt-in and only worth filling when a single user action triggers many internal audit events.",[1351,1352,1353],"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":461,"searchDepth":483,"depth":483,"links":1355},[1356,1358,1359,1360,1361,1362],{"id":450,"depth":483,"text":1357},"AuditFields type",{"id":930,"depth":483,"text":931},{"id":1105,"depth":483,"text":1106},{"id":1206,"depth":483,"text":1207},{"id":1268,"depth":483,"text":1269},{"id":1293,"depth":483,"text":1294},"The AuditFields type, action naming conventions, actor types, idempotency, and how the schema sits inside a regular wide event.","md",[1366,1369],{"label":41,"icon":44,"to":134,"color":1367,"variant":1368},"neutral","subtle",{"label":142,"icon":145,"to":143,"color":1367,"variant":1368},{},{"title":137,"icon":140},{"title":431,"description":1363},"gy1kpgQgCJ5-_0ppU0U_2a2vwc_fY_N0gnhdM_FTWZM",[1375,1377],{"title":41,"path":134,"stem":135,"description":1376,"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":1378,"icon":145,"children":-1},"log.audit, log.audit.deny, standalone audit(), withAudit auto-instrumentation, defineAuditAction and defineAuditCatalog registries, and auditDiff change patches.",1778336623618]