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