[{"data":1,"prerenderedAt":1280},["ShallowReactive",2],{"navigation_docs":3,"-logging-better-auth-performance":429,"-logging-better-auth-performance-surround":1275},[4,35,159,201,289,326,413],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,297,302,307,312,317,321],{"title":41,"path":295,"stem":296,"icon":54},"\u002Fbuild-on-top\u002Foverview","5.build-on-top\u002F0.overview",{"title":298,"path":299,"stem":300,"icon":301},"Stream API","\u002Fbuild-on-top\u002Fstream-api","5.build-on-top\u002F1.stream-api","i-lucide-radio-tower",{"title":303,"path":304,"stem":305,"icon":306},"Stream server","\u002Fbuild-on-top\u002Fstream-server","5.build-on-top\u002F2.stream-server","i-lucide-radio",{"title":308,"path":309,"stem":310,"icon":311},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F3.fs-reader","i-lucide-folder-search",{"title":313,"path":314,"stem":315,"icon":316},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F4.identity-headers","i-lucide-fingerprint",{"title":156,"path":318,"stem":319,"icon":320},"\u002Fbuild-on-top\u002Frecipes","5.build-on-top\u002F5.recipes","i-lucide-chef-hat",{"title":322,"path":323,"stem":324,"icon":325},"Catalogs as packages","\u002Fbuild-on-top\u002Fcatalogs-as-packages","5.build-on-top\u002F6.catalogs-as-packages","i-lucide-package",{"title":327,"path":328,"stem":329,"children":330,"page":34},"Adapters","\u002Fadapters","6.adapters",[331,334,374,389],{"title":41,"path":332,"stem":333,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":335,"path":336,"stem":337,"children":338,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[339,344,349,354,359,364,369],{"title":340,"path":341,"stem":342,"icon":343},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":345,"path":346,"stem":347,"icon":348},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":350,"path":351,"stem":352,"icon":353},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":355,"path":356,"stem":357,"icon":358},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":360,"path":361,"stem":362,"icon":363},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":365,"path":366,"stem":367,"icon":368},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":370,"path":371,"stem":372,"icon":373},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":375,"path":376,"stem":377,"children":378,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[379,384],{"title":380,"path":381,"stem":382,"icon":383},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":385,"path":386,"stem":387,"icon":388},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":390,"path":391,"stem":392,"children":393,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[394,399,404,408],{"title":395,"path":396,"stem":397,"icon":398},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":400,"path":401,"stem":402,"icon":403},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":405,"path":406,"stem":407,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":409,"path":410,"stem":411,"icon":412},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":414,"path":415,"stem":416,"children":417,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[418,421,425],{"title":41,"path":419,"stem":420,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":422,"path":423,"stem":424,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":426,"path":427,"stem":428,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":430,"title":431,"body":432,"description":1264,"extension":1265,"links":1266,"meta":1271,"navigation":1272,"path":124,"seo":1273,"stem":125,"__hash__":1274},"docs\u002F2.logging\u002F7.better-auth\u002F05.performance.md","Performance & Composition",{"type":433,"value":434,"toc":1258},"minimark",[435,447,452,550,559,563,602,609,613,627,640,820,828,832,845,1251,1254],[436,437,438,442,443,446],"p",{},[439,440,441],"code",{},"getSession()"," costs a database query on every request. The integration measures it for you and exposes the timing as ",[439,444,445],{},"auth.resolvedIn"," so you can spot regressions before users do.",[448,449,451],"h2",{"id":450},"watch-session-resolution-time","Watch session resolution time",[453,454,460],"pre",{"className":455,"code":456,"filename":457,"language":458,"meta":459,"style":459},"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","",[439,461,462,471,523,544],{"__ignoreMap":459},[463,464,467],"span",{"class":465,"line":466},"line",1,[463,468,470],{"class":469},"sMK4o","{\n",[463,472,474,477,481,484,487,490,493,497,499,501,505,508,510,513,515,517,520],{"class":465,"line":473},2,[463,475,476],{"class":469},"  \"",[463,478,480],{"class":479},"spNyl","auth",[463,482,483],{"class":469},"\"",[463,485,486],{"class":469},":",[463,488,489],{"class":469}," {",[463,491,492],{"class":469}," \"",[463,494,496],{"class":495},"sBMFI","resolvedIn",[463,498,483],{"class":469},[463,500,486],{"class":469},[463,502,504],{"class":503},"sbssI"," 245",[463,506,507],{"class":469},",",[463,509,492],{"class":469},[463,511,512],{"class":495},"identified",[463,514,483],{"class":469},[463,516,486],{"class":469},[463,518,519],{"class":469}," true",[463,521,522],{"class":469}," },\n",[463,524,526,528,531,533,535,537,541],{"class":465,"line":525},3,[463,527,476],{"class":469},[463,529,530],{"class":479},"duration",[463,532,483],{"class":469},[463,534,486],{"class":469},[463,536,492],{"class":469},[463,538,540],{"class":539},"sfazB","312ms",[463,542,543],{"class":469},"\"\n",[463,545,547],{"class":465,"line":546},4,[463,548,549],{"class":469},"}\n",[436,551,552,553,555,556,558],{},"When ",[439,554,445],{}," is high relative to ",[439,557,530],{},", your auth backend is the bottleneck.",[448,560,562],{"id":561},"tune-for-high-traffic","Tune for high traffic",[564,565,566,581,594],"ol",{},[567,568,569,580],"li",{},[570,571,572,573],"strong",{},"Enable ",[574,575,579],"a",{"href":576,"rel":577},"https:\u002F\u002Fwww.better-auth.com\u002Fdocs\u002Fguides\u002Foptimizing-for-performance#cookie-cache",[578],"nofollow","cookie caching"," in Better Auth so session lookups don't hit the database every time.",[567,582,583,589,590,593],{},[570,584,585,586],{},"Use ",[439,587,588],{},"exclude"," on ",[439,591,592],{},"createAuthMiddleware"," to skip public routes that don't need user context.",[567,595,596,601],{},[570,597,585,598],{},[439,599,600],{},"include"," to limit resolution to specific route patterns instead of the entire app.",[436,603,604,605,608],{},"A common P95 target after caching: ",[439,606,607],{},"auth.resolvedIn \u003C 5ms",".",[448,610,612],{"id":611},"standalone-nitro","Standalone Nitro",[436,614,615,618,619,622,623,626],{},[439,616,617],{},"createAuthIdentifier"," is a factory that creates a Nitro ",[439,620,621],{},"request"," hook. Designed for ",[570,624,625],{},"standalone Nitro"," apps where the evlog Nitro module handles hook ordering.",[628,629,630,631,633,634,636,637,639],"note",{},"For ",[570,632,211],{},", use ",[439,635,592],{}," in a server middleware instead — Nitro plugin hook ordering can cause the logger to not be available yet in the ",[439,638,621],{}," hook.",[453,641,646],{"className":642,"code":643,"filename":644,"language":645,"meta":459,"style":459},"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",[439,647,648,675,695,701,731,769,802,811],{"__ignoreMap":459},[463,649,650,654,656,660,663,666,669,672],{"class":465,"line":466},[463,651,653],{"class":652},"s7zQu","import",[463,655,489],{"class":469},[463,657,659],{"class":658},"sTEyZ"," createAuthIdentifier",[463,661,662],{"class":469}," }",[463,664,665],{"class":652}," from",[463,667,668],{"class":469}," '",[463,670,671],{"class":539},"evlog\u002Fbetter-auth",[463,673,674],{"class":469},"'\n",[463,676,677,679,681,684,686,688,690,693],{"class":465,"line":473},[463,678,653],{"class":652},[463,680,489],{"class":469},[463,682,683],{"class":658}," auth",[463,685,662],{"class":469},[463,687,665],{"class":652},[463,689,668],{"class":469},[463,691,692],{"class":539},".\u002Flib\u002Fauth",[463,694,674],{"class":469},[463,696,697],{"class":465,"line":525},[463,698,700],{"emptyLinePlaceholder":699},true,"\n",[463,702,703,706,709,713,716,718,722,725,728],{"class":465,"line":546},[463,704,705],{"class":652},"export",[463,707,708],{"class":652}," default",[463,710,712],{"class":711},"s2Zo4"," defineNitroPlugin",[463,714,715],{"class":658},"(",[463,717,715],{"class":469},[463,719,721],{"class":720},"sHdIc","nitroApp",[463,723,724],{"class":469},")",[463,726,727],{"class":479}," =>",[463,729,730],{"class":469}," {\n",[463,732,734,737,739,742,744,747,750,753,755,757,759,761,763,765,767],{"class":465,"line":733},5,[463,735,736],{"class":658},"  nitroApp",[463,738,608],{"class":469},[463,740,741],{"class":658},"hooks",[463,743,608],{"class":469},[463,745,746],{"class":711},"hook",[463,748,715],{"class":749},"swJcz",[463,751,752],{"class":469},"'",[463,754,621],{"class":539},[463,756,752],{"class":469},[463,758,507],{"class":469},[463,760,659],{"class":711},[463,762,715],{"class":749},[463,764,480],{"class":658},[463,766,507],{"class":469},[463,768,730],{"class":469},[463,770,772,775,777,780,782,785,787,789,791,794,796,799],{"class":465,"line":771},6,[463,773,774],{"class":749},"    exclude",[463,776,486],{"class":469},[463,778,779],{"class":749}," [",[463,781,752],{"class":469},[463,783,784],{"class":539},"\u002Fapi\u002Fauth\u002F**",[463,786,752],{"class":469},[463,788,507],{"class":469},[463,790,668],{"class":469},[463,792,793],{"class":539},"\u002Fapi\u002Fpublic\u002F**",[463,795,752],{"class":469},[463,797,798],{"class":749},"]",[463,800,801],{"class":469},",\n",[463,803,805,808],{"class":465,"line":804},7,[463,806,807],{"class":469},"  }",[463,809,810],{"class":749},"))\n",[463,812,814,817],{"class":465,"line":813},8,[463,815,816],{"class":469},"}",[463,818,819],{"class":658},")\n",[436,821,822,823,608],{},"It accepts the same options as ",[574,824,826],{"href":825},"\u002Flogging\u002Fbetter-auth\u002Fmiddleware#options",[439,827,592],{},[448,829,831],{"id":830},"combine-with-the-ai-sdk","Combine with the AI SDK",[436,833,834,835,840,841,844],{},"When you also use ",[574,836,837],{"href":77},[439,838,839],{},"evlog\u002Fai",", your wide events include both user identity ",[570,842,843],{},"and"," AI metrics in a single event:",[453,846,849],{"className":455,"code":847,"filename":848,"language":458,"meta":459,"style":459},"{\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",[439,850,851,855,875,895,911,930,950,963,983,1004,1023,1029,1067,1081,1098,1119,1140,1157,1174,1191,1208,1225,1240,1246],{"__ignoreMap":459},[463,852,853],{"class":465,"line":466},[463,854,470],{"class":469},[463,856,857,859,862,864,866,868,871,873],{"class":465,"line":473},[463,858,476],{"class":469},[463,860,861],{"class":479},"method",[463,863,483],{"class":469},[463,865,486],{"class":469},[463,867,492],{"class":469},[463,869,870],{"class":539},"POST",[463,872,483],{"class":469},[463,874,801],{"class":469},[463,876,877,879,882,884,886,888,891,893],{"class":465,"line":525},[463,878,476],{"class":469},[463,880,881],{"class":479},"path",[463,883,483],{"class":469},[463,885,486],{"class":469},[463,887,492],{"class":469},[463,889,890],{"class":539},"\u002Fapi\u002Fchat",[463,892,483],{"class":469},[463,894,801],{"class":469},[463,896,897,899,902,904,906,909],{"class":465,"line":546},[463,898,476],{"class":469},[463,900,901],{"class":479},"status",[463,903,483],{"class":469},[463,905,486],{"class":469},[463,907,908],{"class":503}," 200",[463,910,801],{"class":469},[463,912,913,915,917,919,921,923,926,928],{"class":465,"line":733},[463,914,476],{"class":469},[463,916,530],{"class":479},[463,918,483],{"class":469},[463,920,486],{"class":469},[463,922,492],{"class":469},[463,924,925],{"class":539},"4.5s",[463,927,483],{"class":469},[463,929,801],{"class":469},[463,931,932,934,937,939,941,943,946,948],{"class":465,"line":771},[463,933,476],{"class":469},[463,935,936],{"class":479},"userId",[463,938,483],{"class":469},[463,940,486],{"class":469},[463,942,492],{"class":469},[463,944,945],{"class":539},"QBX9tPjJQExWawAbNll75",[463,947,483],{"class":469},[463,949,801],{"class":469},[463,951,952,954,957,959,961],{"class":465,"line":804},[463,953,476],{"class":469},[463,955,956],{"class":479},"user",[463,958,483],{"class":469},[463,960,486],{"class":469},[463,962,730],{"class":469},[463,964,965,968,971,973,975,977,979,981],{"class":465,"line":813},[463,966,967],{"class":469},"    \"",[463,969,970],{"class":495},"id",[463,972,483],{"class":469},[463,974,486],{"class":469},[463,976,492],{"class":469},[463,978,945],{"class":539},[463,980,483],{"class":469},[463,982,801],{"class":469},[463,984,986,988,991,993,995,997,1000,1002],{"class":465,"line":985},9,[463,987,967],{"class":469},[463,989,990],{"class":495},"name",[463,992,483],{"class":469},[463,994,486],{"class":469},[463,996,492],{"class":469},[463,998,999],{"class":539},"Hugo Richard",[463,1001,483],{"class":469},[463,1003,801],{"class":469},[463,1005,1007,1009,1012,1014,1016,1018,1021],{"class":465,"line":1006},10,[463,1008,967],{"class":469},[463,1010,1011],{"class":495},"email",[463,1013,483],{"class":469},[463,1015,486],{"class":469},[463,1017,492],{"class":469},[463,1019,1020],{"class":539},"hugo@example.com",[463,1022,543],{"class":469},[463,1024,1026],{"class":465,"line":1025},11,[463,1027,1028],{"class":469},"  },\n",[463,1030,1032,1034,1036,1038,1040,1042,1044,1046,1048,1050,1053,1055,1057,1059,1061,1063,1065],{"class":465,"line":1031},12,[463,1033,476],{"class":469},[463,1035,480],{"class":479},[463,1037,483],{"class":469},[463,1039,486],{"class":469},[463,1041,489],{"class":469},[463,1043,492],{"class":469},[463,1045,496],{"class":495},[463,1047,483],{"class":469},[463,1049,486],{"class":469},[463,1051,1052],{"class":503}," 8",[463,1054,507],{"class":469},[463,1056,492],{"class":469},[463,1058,512],{"class":495},[463,1060,483],{"class":469},[463,1062,486],{"class":469},[463,1064,519],{"class":469},[463,1066,522],{"class":469},[463,1068,1070,1072,1075,1077,1079],{"class":465,"line":1069},13,[463,1071,476],{"class":469},[463,1073,1074],{"class":479},"ai",[463,1076,483],{"class":469},[463,1078,486],{"class":469},[463,1080,730],{"class":469},[463,1082,1084,1086,1089,1091,1093,1096],{"class":465,"line":1083},14,[463,1085,967],{"class":469},[463,1087,1088],{"class":495},"calls",[463,1090,483],{"class":469},[463,1092,486],{"class":469},[463,1094,1095],{"class":503}," 1",[463,1097,801],{"class":469},[463,1099,1101,1103,1106,1108,1110,1112,1115,1117],{"class":465,"line":1100},15,[463,1102,967],{"class":469},[463,1104,1105],{"class":495},"model",[463,1107,483],{"class":469},[463,1109,486],{"class":469},[463,1111,492],{"class":469},[463,1113,1114],{"class":539},"claude-sonnet-4.6",[463,1116,483],{"class":469},[463,1118,801],{"class":469},[463,1120,1122,1124,1127,1129,1131,1133,1136,1138],{"class":465,"line":1121},16,[463,1123,967],{"class":469},[463,1125,1126],{"class":495},"provider",[463,1128,483],{"class":469},[463,1130,486],{"class":469},[463,1132,492],{"class":469},[463,1134,1135],{"class":539},"anthropic",[463,1137,483],{"class":469},[463,1139,801],{"class":469},[463,1141,1143,1145,1148,1150,1152,1155],{"class":465,"line":1142},17,[463,1144,967],{"class":469},[463,1146,1147],{"class":495},"inputTokens",[463,1149,483],{"class":469},[463,1151,486],{"class":469},[463,1153,1154],{"class":503}," 3312",[463,1156,801],{"class":469},[463,1158,1160,1162,1165,1167,1169,1172],{"class":465,"line":1159},18,[463,1161,967],{"class":469},[463,1163,1164],{"class":495},"outputTokens",[463,1166,483],{"class":469},[463,1168,486],{"class":469},[463,1170,1171],{"class":503}," 814",[463,1173,801],{"class":469},[463,1175,1177,1179,1182,1184,1186,1189],{"class":465,"line":1176},19,[463,1178,967],{"class":469},[463,1180,1181],{"class":495},"totalTokens",[463,1183,483],{"class":469},[463,1185,486],{"class":469},[463,1187,1188],{"class":503}," 4126",[463,1190,801],{"class":469},[463,1192,1194,1196,1199,1201,1203,1206],{"class":465,"line":1193},20,[463,1195,967],{"class":469},[463,1197,1198],{"class":495},"msToFirstChunk",[463,1200,483],{"class":469},[463,1202,486],{"class":469},[463,1204,1205],{"class":503}," 234",[463,1207,801],{"class":469},[463,1209,1211,1213,1216,1218,1220,1223],{"class":465,"line":1210},21,[463,1212,967],{"class":469},[463,1214,1215],{"class":495},"msToFinish",[463,1217,483],{"class":469},[463,1219,486],{"class":469},[463,1221,1222],{"class":503}," 4500",[463,1224,801],{"class":469},[463,1226,1228,1230,1233,1235,1237],{"class":465,"line":1227},22,[463,1229,967],{"class":469},[463,1231,1232],{"class":495},"tokensPerSecond",[463,1234,483],{"class":469},[463,1236,486],{"class":469},[463,1238,1239],{"class":503}," 180\n",[463,1241,1243],{"class":465,"line":1242},23,[463,1244,1245],{"class":469},"  }\n",[463,1247,1249],{"class":465,"line":1248},24,[463,1250,549],{"class":469},[436,1252,1253],{},"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.",[1255,1256,1257],"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":459,"searchDepth":473,"depth":473,"links":1259},[1260,1261,1262,1263],{"id":450,"depth":473,"text":451},{"id":561,"depth":473,"text":562},{"id":611,"depth":473,"text":612},{"id":830,"depth":473,"text":831},"Watch session resolution time, enable session caching, wire the standalone Nitro hook, and combine with the AI SDK integration.","md",[1267,1270],{"label":114,"icon":117,"to":115,"color":1268,"variant":1269},"neutral","subtle",{"label":71,"icon":72,"to":77,"color":1268,"variant":1269},{},{"title":123,"icon":126},{"title":431,"description":1264},"TycRW-rrANbnFqA_aBYXwB7dnZSNK0JoDKrrmbQz6Z4",[1276,1278],{"title":119,"path":120,"stem":121,"description":1277,"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":1279,"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.",1778336623455]