[{"data":1,"prerenderedAt":1272},["ShallowReactive",2],{"navigation_docs":3,"-logging-better-auth-performance":421,"-logging-better-auth-performance-surround":1267},[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":1256,"extension":1257,"links":1258,"meta":1263,"navigation":1264,"path":124,"seo":1265,"stem":125,"__hash__":1266},"docs\u002F2.logging\u002F7.better-auth\u002F05.performance.md","Performance & Composition",{"type":425,"value":426,"toc":1250},"minimark",[427,439,444,542,551,555,594,601,605,619,632,812,820,824,837,1243,1246],[428,429,430,434,435,438],"p",{},[431,432,433],"code",{},"getSession()"," costs a database query on every request. The integration measures it for you and exposes the timing as ",[431,436,437],{},"auth.resolvedIn"," so you can spot regressions before users do.",[440,441,443],"h2",{"id":442},"watch-session-resolution-time","Watch session resolution time",[445,446,452],"pre",{"className":447,"code":448,"filename":449,"language":450,"meta":451,"style":451},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"auth\": { \"resolvedIn\": 245, \"identified\": true },\n  \"duration\": \"312ms\"\n}\n","Wide Event — slow session resolution","json","",[431,453,454,463,515,536],{"__ignoreMap":451},[455,456,459],"span",{"class":457,"line":458},"line",1,[455,460,462],{"class":461},"sMK4o","{\n",[455,464,466,469,473,476,479,482,485,489,491,493,497,500,502,505,507,509,512],{"class":457,"line":465},2,[455,467,468],{"class":461},"  \"",[455,470,472],{"class":471},"spNyl","auth",[455,474,475],{"class":461},"\"",[455,477,478],{"class":461},":",[455,480,481],{"class":461}," {",[455,483,484],{"class":461}," \"",[455,486,488],{"class":487},"sBMFI","resolvedIn",[455,490,475],{"class":461},[455,492,478],{"class":461},[455,494,496],{"class":495},"sbssI"," 245",[455,498,499],{"class":461},",",[455,501,484],{"class":461},[455,503,504],{"class":487},"identified",[455,506,475],{"class":461},[455,508,478],{"class":461},[455,510,511],{"class":461}," true",[455,513,514],{"class":461}," },\n",[455,516,518,520,523,525,527,529,533],{"class":457,"line":517},3,[455,519,468],{"class":461},[455,521,522],{"class":471},"duration",[455,524,475],{"class":461},[455,526,478],{"class":461},[455,528,484],{"class":461},[455,530,532],{"class":531},"sfazB","312ms",[455,534,535],{"class":461},"\"\n",[455,537,539],{"class":457,"line":538},4,[455,540,541],{"class":461},"}\n",[428,543,544,545,547,548,550],{},"When ",[431,546,437],{}," is high relative to ",[431,549,522],{},", your auth backend is the bottleneck.",[440,552,554],{"id":553},"tune-for-high-traffic","Tune for high traffic",[556,557,558,573,586],"ol",{},[559,560,561,572],"li",{},[562,563,564,565],"strong",{},"Enable ",[566,567,571],"a",{"href":568,"rel":569},"https:\u002F\u002Fwww.better-auth.com\u002Fdocs\u002Fguides\u002Foptimizing-for-performance#cookie-cache",[570],"nofollow","cookie caching"," in Better Auth so session lookups don't hit the database every time.",[559,574,575,581,582,585],{},[562,576,577,578],{},"Use ",[431,579,580],{},"exclude"," on ",[431,583,584],{},"createAuthMiddleware"," to skip public routes that don't need user context.",[559,587,588,593],{},[562,589,577,590],{},[431,591,592],{},"include"," to limit resolution to specific route patterns instead of the entire app.",[428,595,596,597,600],{},"A common P95 target after caching: ",[431,598,599],{},"auth.resolvedIn \u003C 5ms",".",[440,602,604],{"id":603},"standalone-nitro","Standalone Nitro",[428,606,607,610,611,614,615,618],{},[431,608,609],{},"createAuthIdentifier"," is a factory that creates a Nitro ",[431,612,613],{},"request"," hook. Designed for ",[562,616,617],{},"standalone Nitro"," apps where the evlog Nitro module handles hook ordering.",[620,621,622,623,625,626,628,629,631],"note",{},"For ",[562,624,211],{},", use ",[431,627,584],{}," in a server middleware instead — Nitro plugin hook ordering can cause the logger to not be available yet in the ",[431,630,613],{}," hook.",[445,633,638],{"className":634,"code":635,"filename":636,"language":637,"meta":451,"style":451},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createAuthIdentifier } from 'evlog\u002Fbetter-auth'\nimport { auth } from '.\u002Flib\u002Fauth'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('request', createAuthIdentifier(auth, {\n    exclude: ['\u002Fapi\u002Fauth\u002F**', '\u002Fapi\u002Fpublic\u002F**'],\n  }))\n})\n","server\u002Fplugins\u002Fevlog-auth.ts","typescript",[431,639,640,667,687,693,723,761,794,803],{"__ignoreMap":451},[455,641,642,646,648,652,655,658,661,664],{"class":457,"line":458},[455,643,645],{"class":644},"s7zQu","import",[455,647,481],{"class":461},[455,649,651],{"class":650},"sTEyZ"," createAuthIdentifier",[455,653,654],{"class":461}," }",[455,656,657],{"class":644}," from",[455,659,660],{"class":461}," '",[455,662,663],{"class":531},"evlog\u002Fbetter-auth",[455,665,666],{"class":461},"'\n",[455,668,669,671,673,676,678,680,682,685],{"class":457,"line":465},[455,670,645],{"class":644},[455,672,481],{"class":461},[455,674,675],{"class":650}," auth",[455,677,654],{"class":461},[455,679,657],{"class":644},[455,681,660],{"class":461},[455,683,684],{"class":531},".\u002Flib\u002Fauth",[455,686,666],{"class":461},[455,688,689],{"class":457,"line":517},[455,690,692],{"emptyLinePlaceholder":691},true,"\n",[455,694,695,698,701,705,708,710,714,717,720],{"class":457,"line":538},[455,696,697],{"class":644},"export",[455,699,700],{"class":644}," default",[455,702,704],{"class":703},"s2Zo4"," defineNitroPlugin",[455,706,707],{"class":650},"(",[455,709,707],{"class":461},[455,711,713],{"class":712},"sHdIc","nitroApp",[455,715,716],{"class":461},")",[455,718,719],{"class":471}," =>",[455,721,722],{"class":461}," {\n",[455,724,726,729,731,734,736,739,742,745,747,749,751,753,755,757,759],{"class":457,"line":725},5,[455,727,728],{"class":650},"  nitroApp",[455,730,600],{"class":461},[455,732,733],{"class":650},"hooks",[455,735,600],{"class":461},[455,737,738],{"class":703},"hook",[455,740,707],{"class":741},"swJcz",[455,743,744],{"class":461},"'",[455,746,613],{"class":531},[455,748,744],{"class":461},[455,750,499],{"class":461},[455,752,651],{"class":703},[455,754,707],{"class":741},[455,756,472],{"class":650},[455,758,499],{"class":461},[455,760,722],{"class":461},[455,762,764,767,769,772,774,777,779,781,783,786,788,791],{"class":457,"line":763},6,[455,765,766],{"class":741},"    exclude",[455,768,478],{"class":461},[455,770,771],{"class":741}," [",[455,773,744],{"class":461},[455,775,776],{"class":531},"\u002Fapi\u002Fauth\u002F**",[455,778,744],{"class":461},[455,780,499],{"class":461},[455,782,660],{"class":461},[455,784,785],{"class":531},"\u002Fapi\u002Fpublic\u002F**",[455,787,744],{"class":461},[455,789,790],{"class":741},"]",[455,792,793],{"class":461},",\n",[455,795,797,800],{"class":457,"line":796},7,[455,798,799],{"class":461},"  }",[455,801,802],{"class":741},"))\n",[455,804,806,809],{"class":457,"line":805},8,[455,807,808],{"class":461},"}",[455,810,811],{"class":650},")\n",[428,813,814,815,600],{},"It accepts the same options as ",[566,816,818],{"href":817},"\u002Flogging\u002Fbetter-auth\u002Fmiddleware#options",[431,819,584],{},[440,821,823],{"id":822},"combine-with-the-ai-sdk","Combine with the AI SDK",[428,825,826,827,832,833,836],{},"When you also use ",[566,828,829],{"href":77},[431,830,831],{},"evlog\u002Fai",", your wide events include both user identity ",[562,834,835],{},"and"," AI metrics in a single event:",[445,838,841],{"className":447,"code":839,"filename":840,"language":450,"meta":451,"style":451},"{\n  \"method\": \"POST\",\n  \"path\": \"\u002Fapi\u002Fchat\",\n  \"status\": 200,\n  \"duration\": \"4.5s\",\n  \"userId\": \"QBX9tPjJQExWawAbNll75\",\n  \"user\": {\n    \"id\": \"QBX9tPjJQExWawAbNll75\",\n    \"name\": \"Hugo Richard\",\n    \"email\": \"hugo@example.com\"\n  },\n  \"auth\": { \"resolvedIn\": 8, \"identified\": true },\n  \"ai\": {\n    \"calls\": 1,\n    \"model\": \"claude-sonnet-4.6\",\n    \"provider\": \"anthropic\",\n    \"inputTokens\": 3312,\n    \"outputTokens\": 814,\n    \"totalTokens\": 4126,\n    \"msToFirstChunk\": 234,\n    \"msToFinish\": 4500,\n    \"tokensPerSecond\": 180\n  }\n}\n","Wide Event — AI + User",[431,842,843,847,867,887,903,922,942,955,975,996,1015,1021,1059,1073,1090,1111,1132,1149,1166,1183,1200,1217,1232,1238],{"__ignoreMap":451},[455,844,845],{"class":457,"line":458},[455,846,462],{"class":461},[455,848,849,851,854,856,858,860,863,865],{"class":457,"line":465},[455,850,468],{"class":461},[455,852,853],{"class":471},"method",[455,855,475],{"class":461},[455,857,478],{"class":461},[455,859,484],{"class":461},[455,861,862],{"class":531},"POST",[455,864,475],{"class":461},[455,866,793],{"class":461},[455,868,869,871,874,876,878,880,883,885],{"class":457,"line":517},[455,870,468],{"class":461},[455,872,873],{"class":471},"path",[455,875,475],{"class":461},[455,877,478],{"class":461},[455,879,484],{"class":461},[455,881,882],{"class":531},"\u002Fapi\u002Fchat",[455,884,475],{"class":461},[455,886,793],{"class":461},[455,888,889,891,894,896,898,901],{"class":457,"line":538},[455,890,468],{"class":461},[455,892,893],{"class":471},"status",[455,895,475],{"class":461},[455,897,478],{"class":461},[455,899,900],{"class":495}," 200",[455,902,793],{"class":461},[455,904,905,907,909,911,913,915,918,920],{"class":457,"line":725},[455,906,468],{"class":461},[455,908,522],{"class":471},[455,910,475],{"class":461},[455,912,478],{"class":461},[455,914,484],{"class":461},[455,916,917],{"class":531},"4.5s",[455,919,475],{"class":461},[455,921,793],{"class":461},[455,923,924,926,929,931,933,935,938,940],{"class":457,"line":763},[455,925,468],{"class":461},[455,927,928],{"class":471},"userId",[455,930,475],{"class":461},[455,932,478],{"class":461},[455,934,484],{"class":461},[455,936,937],{"class":531},"QBX9tPjJQExWawAbNll75",[455,939,475],{"class":461},[455,941,793],{"class":461},[455,943,944,946,949,951,953],{"class":457,"line":796},[455,945,468],{"class":461},[455,947,948],{"class":471},"user",[455,950,475],{"class":461},[455,952,478],{"class":461},[455,954,722],{"class":461},[455,956,957,960,963,965,967,969,971,973],{"class":457,"line":805},[455,958,959],{"class":461},"    \"",[455,961,962],{"class":487},"id",[455,964,475],{"class":461},[455,966,478],{"class":461},[455,968,484],{"class":461},[455,970,937],{"class":531},[455,972,475],{"class":461},[455,974,793],{"class":461},[455,976,978,980,983,985,987,989,992,994],{"class":457,"line":977},9,[455,979,959],{"class":461},[455,981,982],{"class":487},"name",[455,984,475],{"class":461},[455,986,478],{"class":461},[455,988,484],{"class":461},[455,990,991],{"class":531},"Hugo Richard",[455,993,475],{"class":461},[455,995,793],{"class":461},[455,997,999,1001,1004,1006,1008,1010,1013],{"class":457,"line":998},10,[455,1000,959],{"class":461},[455,1002,1003],{"class":487},"email",[455,1005,475],{"class":461},[455,1007,478],{"class":461},[455,1009,484],{"class":461},[455,1011,1012],{"class":531},"hugo@example.com",[455,1014,535],{"class":461},[455,1016,1018],{"class":457,"line":1017},11,[455,1019,1020],{"class":461},"  },\n",[455,1022,1024,1026,1028,1030,1032,1034,1036,1038,1040,1042,1045,1047,1049,1051,1053,1055,1057],{"class":457,"line":1023},12,[455,1025,468],{"class":461},[455,1027,472],{"class":471},[455,1029,475],{"class":461},[455,1031,478],{"class":461},[455,1033,481],{"class":461},[455,1035,484],{"class":461},[455,1037,488],{"class":487},[455,1039,475],{"class":461},[455,1041,478],{"class":461},[455,1043,1044],{"class":495}," 8",[455,1046,499],{"class":461},[455,1048,484],{"class":461},[455,1050,504],{"class":487},[455,1052,475],{"class":461},[455,1054,478],{"class":461},[455,1056,511],{"class":461},[455,1058,514],{"class":461},[455,1060,1062,1064,1067,1069,1071],{"class":457,"line":1061},13,[455,1063,468],{"class":461},[455,1065,1066],{"class":471},"ai",[455,1068,475],{"class":461},[455,1070,478],{"class":461},[455,1072,722],{"class":461},[455,1074,1076,1078,1081,1083,1085,1088],{"class":457,"line":1075},14,[455,1077,959],{"class":461},[455,1079,1080],{"class":487},"calls",[455,1082,475],{"class":461},[455,1084,478],{"class":461},[455,1086,1087],{"class":495}," 1",[455,1089,793],{"class":461},[455,1091,1093,1095,1098,1100,1102,1104,1107,1109],{"class":457,"line":1092},15,[455,1094,959],{"class":461},[455,1096,1097],{"class":487},"model",[455,1099,475],{"class":461},[455,1101,478],{"class":461},[455,1103,484],{"class":461},[455,1105,1106],{"class":531},"claude-sonnet-4.6",[455,1108,475],{"class":461},[455,1110,793],{"class":461},[455,1112,1114,1116,1119,1121,1123,1125,1128,1130],{"class":457,"line":1113},16,[455,1115,959],{"class":461},[455,1117,1118],{"class":487},"provider",[455,1120,475],{"class":461},[455,1122,478],{"class":461},[455,1124,484],{"class":461},[455,1126,1127],{"class":531},"anthropic",[455,1129,475],{"class":461},[455,1131,793],{"class":461},[455,1133,1135,1137,1140,1142,1144,1147],{"class":457,"line":1134},17,[455,1136,959],{"class":461},[455,1138,1139],{"class":487},"inputTokens",[455,1141,475],{"class":461},[455,1143,478],{"class":461},[455,1145,1146],{"class":495}," 3312",[455,1148,793],{"class":461},[455,1150,1152,1154,1157,1159,1161,1164],{"class":457,"line":1151},18,[455,1153,959],{"class":461},[455,1155,1156],{"class":487},"outputTokens",[455,1158,475],{"class":461},[455,1160,478],{"class":461},[455,1162,1163],{"class":495}," 814",[455,1165,793],{"class":461},[455,1167,1169,1171,1174,1176,1178,1181],{"class":457,"line":1168},19,[455,1170,959],{"class":461},[455,1172,1173],{"class":487},"totalTokens",[455,1175,475],{"class":461},[455,1177,478],{"class":461},[455,1179,1180],{"class":495}," 4126",[455,1182,793],{"class":461},[455,1184,1186,1188,1191,1193,1195,1198],{"class":457,"line":1185},20,[455,1187,959],{"class":461},[455,1189,1190],{"class":487},"msToFirstChunk",[455,1192,475],{"class":461},[455,1194,478],{"class":461},[455,1196,1197],{"class":495}," 234",[455,1199,793],{"class":461},[455,1201,1203,1205,1208,1210,1212,1215],{"class":457,"line":1202},21,[455,1204,959],{"class":461},[455,1206,1207],{"class":487},"msToFinish",[455,1209,475],{"class":461},[455,1211,478],{"class":461},[455,1213,1214],{"class":495}," 4500",[455,1216,793],{"class":461},[455,1218,1220,1222,1225,1227,1229],{"class":457,"line":1219},22,[455,1221,959],{"class":461},[455,1223,1224],{"class":487},"tokensPerSecond",[455,1226,475],{"class":461},[455,1228,478],{"class":461},[455,1230,1231],{"class":495}," 180\n",[455,1233,1235],{"class":457,"line":1234},23,[455,1236,1237],{"class":461},"  }\n",[455,1239,1241],{"class":457,"line":1240},24,[455,1242,541],{"class":461},[428,1244,1245],{},"This is the power of wide events — one event per request, all context in one place: who made the request, what they did, how the AI responded, and how it performed.",[1247,1248,1249],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}",{"title":451,"searchDepth":465,"depth":465,"links":1251},[1252,1253,1254,1255],{"id":442,"depth":465,"text":443},{"id":553,"depth":465,"text":554},{"id":603,"depth":465,"text":604},{"id":822,"depth":465,"text":823},"Watch session resolution time, enable session caching, wire the standalone Nitro hook, and combine with the AI SDK integration.","md",[1259,1262],{"label":114,"icon":117,"to":115,"color":1260,"variant":1261},"neutral","subtle",{"label":71,"icon":72,"to":77,"color":1260,"variant":1261},{},{"title":123,"icon":126},{"title":423,"description":1256},"TycRW-rrANbnFqA_aBYXwB7dnZSNK0JoDKrrmbQz6Z4",[1268,1270],{"title":119,"path":120,"stem":121,"description":1269,"icon":69,"children":-1},"Mirror the server-side user identity into client-side logs by watching the Better Auth session and calling setIdentity.",{"title":41,"path":134,"stem":135,"description":1271,"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.",1778330170425]