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