[{"data":1,"prerenderedAt":1363},["ShallowReactive",2],{"navigation_docs":3,"-logging-better-auth-client-sync":429,"-logging-better-auth-client-sync-surround":1358},[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":1346,"extension":1347,"links":1348,"meta":1354,"navigation":1355,"path":120,"seo":1356,"stem":121,"__hash__":1357},"docs\u002F2.logging\u002F7.better-auth\u002F04.client-sync.md","Client Identity Sync",{"type":433,"value":434,"toc":1340},"minimark",[435,444,449,709,712,750,754,981,988,992,1187,1194,1198,1201,1320,1336],[436,437,438,439,443],"p",{},"The middleware identifies users on the server. To get the same identity on ",[440,441,442],"strong",{},"client-side logs"," (clicks, navigation, errors caught in the browser), watch the Better Auth session and forward the user to evlog's client identity store.",[445,446,448],"h2",{"id":447},"vue-nuxt","Vue \u002F Nuxt",[450,451,457],"pre",{"className":452,"code":453,"filename":454,"language":455,"meta":456,"style":456},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { authClient } from '~\u002Flib\u002Fauth-client'\n\nexport function useAuthIdentity() {\n  const session = authClient.useSession()\n\n  watch(() => session.value?.data?.user, (user) => {\n    if (user) {\n      setIdentity({ userId: user.id, userName: user.name })\n    } else {\n      clearIdentity()\n    }\n  }, { immediate: true })\n}\n","composables\u002FuseAuthIdentity.ts","typescript","",[458,459,460,493,500,520,544,549,597,613,657,668,676,682,703],"code",{"__ignoreMap":456},[461,462,465,469,473,477,480,483,486,490],"span",{"class":463,"line":464},"line",1,[461,466,468],{"class":467},"s7zQu","import",[461,470,472],{"class":471},"sMK4o"," {",[461,474,476],{"class":475},"sTEyZ"," authClient",[461,478,479],{"class":471}," }",[461,481,482],{"class":467}," from",[461,484,485],{"class":471}," '",[461,487,489],{"class":488},"sfazB","~\u002Flib\u002Fauth-client",[461,491,492],{"class":471},"'\n",[461,494,496],{"class":463,"line":495},2,[461,497,499],{"emptyLinePlaceholder":498},true,"\n",[461,501,503,506,510,514,517],{"class":463,"line":502},3,[461,504,505],{"class":467},"export",[461,507,509],{"class":508},"spNyl"," function",[461,511,513],{"class":512},"s2Zo4"," useAuthIdentity",[461,515,516],{"class":471},"()",[461,518,519],{"class":471}," {\n",[461,521,523,526,529,532,534,537,540],{"class":463,"line":522},4,[461,524,525],{"class":508},"  const",[461,527,528],{"class":475}," session",[461,530,531],{"class":471}," =",[461,533,476],{"class":475},[461,535,536],{"class":471},".",[461,538,539],{"class":512},"useSession",[461,541,543],{"class":542},"swJcz","()\n",[461,545,547],{"class":463,"line":546},5,[461,548,499],{"emptyLinePlaceholder":498},[461,550,552,555,558,560,563,565,567,570,573,576,578,581,584,587,590,593,595],{"class":463,"line":551},6,[461,553,554],{"class":512},"  watch",[461,556,557],{"class":542},"(",[461,559,516],{"class":471},[461,561,562],{"class":508}," =>",[461,564,528],{"class":475},[461,566,536],{"class":471},[461,568,569],{"class":475},"value",[461,571,572],{"class":471},"?.",[461,574,575],{"class":475},"data",[461,577,572],{"class":471},[461,579,580],{"class":475},"user",[461,582,583],{"class":471},",",[461,585,586],{"class":471}," (",[461,588,580],{"class":589},"sHdIc",[461,591,592],{"class":471},")",[461,594,562],{"class":508},[461,596,519],{"class":471},[461,598,600,603,605,607,610],{"class":463,"line":599},7,[461,601,602],{"class":467},"    if",[461,604,586],{"class":542},[461,606,580],{"class":475},[461,608,609],{"class":542},") ",[461,611,612],{"class":471},"{\n",[461,614,616,619,621,624,627,630,633,635,638,640,643,645,647,649,652,654],{"class":463,"line":615},8,[461,617,618],{"class":512},"      setIdentity",[461,620,557],{"class":542},[461,622,623],{"class":471},"{",[461,625,626],{"class":542}," userId",[461,628,629],{"class":471},":",[461,631,632],{"class":475}," user",[461,634,536],{"class":471},[461,636,637],{"class":475},"id",[461,639,583],{"class":471},[461,641,642],{"class":542}," userName",[461,644,629],{"class":471},[461,646,632],{"class":475},[461,648,536],{"class":471},[461,650,651],{"class":475},"name",[461,653,479],{"class":471},[461,655,656],{"class":542},")\n",[461,658,660,663,666],{"class":463,"line":659},9,[461,661,662],{"class":471},"    }",[461,664,665],{"class":467}," else",[461,667,519],{"class":471},[461,669,671,674],{"class":463,"line":670},10,[461,672,673],{"class":512},"      clearIdentity",[461,675,543],{"class":542},[461,677,679],{"class":463,"line":678},11,[461,680,681],{"class":471},"    }\n",[461,683,685,688,690,693,695,699,701],{"class":463,"line":684},12,[461,686,687],{"class":471},"  },",[461,689,472],{"class":471},[461,691,692],{"class":542}," immediate",[461,694,629],{"class":471},[461,696,698],{"class":697},"sfNiH"," true",[461,700,479],{"class":471},[461,702,656],{"class":542},[461,704,706],{"class":463,"line":705},13,[461,707,708],{"class":471},"}\n",[436,710,711],{},"Call it once in your root layout:",[450,713,718],{"className":714,"code":715,"filename":716,"language":717,"meta":456,"style":456},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup>\nuseAuthIdentity()\n\u003C\u002Fscript>\n","app.vue","vue",[458,719,720,734,741],{"__ignoreMap":456},[461,721,722,725,728,731],{"class":463,"line":464},[461,723,724],{"class":471},"\u003C",[461,726,727],{"class":542},"script",[461,729,730],{"class":508}," setup",[461,732,733],{"class":471},">\n",[461,735,736,739],{"class":463,"line":495},[461,737,738],{"class":512},"useAuthIdentity",[461,740,543],{"class":475},[461,742,743,746,748],{"class":463,"line":502},[461,744,745],{"class":471},"\u003C\u002F",[461,747,727],{"class":542},[461,749,733],{"class":471},[445,751,753],{"id":752},"react","React",[450,755,760],{"className":756,"code":757,"filename":758,"language":759,"meta":456,"style":456},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { useEffect } from 'react'\nimport { setIdentity, clearIdentity } from 'evlog\u002Fhttp'\nimport { authClient } from '@\u002Flib\u002Fauth-client'\n\nexport function useAuthIdentity() {\n  const { data } = authClient.useSession()\n\n  useEffect(() => {\n    if (data?.user) {\n      setIdentity({ userId: data.user.id, userName: data.user.name })\n    } else {\n      clearIdentity()\n    }\n  }, [data?.user?.id])\n}\n","hooks\u002FuseAuthIdentity.tsx","tsx",[458,761,762,781,806,825,829,841,862,866,879,895,937,945,951,955,976],{"__ignoreMap":456},[461,763,764,766,768,771,773,775,777,779],{"class":463,"line":464},[461,765,468],{"class":467},[461,767,472],{"class":471},[461,769,770],{"class":475}," useEffect",[461,772,479],{"class":471},[461,774,482],{"class":467},[461,776,485],{"class":471},[461,778,752],{"class":488},[461,780,492],{"class":471},[461,782,783,785,787,790,792,795,797,799,801,804],{"class":463,"line":495},[461,784,468],{"class":467},[461,786,472],{"class":471},[461,788,789],{"class":475}," setIdentity",[461,791,583],{"class":471},[461,793,794],{"class":475}," clearIdentity",[461,796,479],{"class":471},[461,798,482],{"class":467},[461,800,485],{"class":471},[461,802,803],{"class":488},"evlog\u002Fhttp",[461,805,492],{"class":471},[461,807,808,810,812,814,816,818,820,823],{"class":463,"line":502},[461,809,468],{"class":467},[461,811,472],{"class":471},[461,813,476],{"class":475},[461,815,479],{"class":471},[461,817,482],{"class":467},[461,819,485],{"class":471},[461,821,822],{"class":488},"@\u002Flib\u002Fauth-client",[461,824,492],{"class":471},[461,826,827],{"class":463,"line":522},[461,828,499],{"emptyLinePlaceholder":498},[461,830,831,833,835,837,839],{"class":463,"line":546},[461,832,505],{"class":467},[461,834,509],{"class":508},[461,836,513],{"class":512},[461,838,516],{"class":471},[461,840,519],{"class":471},[461,842,843,845,847,850,852,854,856,858,860],{"class":463,"line":551},[461,844,525],{"class":508},[461,846,472],{"class":471},[461,848,849],{"class":475}," data",[461,851,479],{"class":471},[461,853,531],{"class":471},[461,855,476],{"class":475},[461,857,536],{"class":471},[461,859,539],{"class":512},[461,861,543],{"class":542},[461,863,864],{"class":463,"line":599},[461,865,499],{"emptyLinePlaceholder":498},[461,867,868,871,873,875,877],{"class":463,"line":615},[461,869,870],{"class":512},"  useEffect",[461,872,557],{"class":542},[461,874,516],{"class":471},[461,876,562],{"class":508},[461,878,519],{"class":471},[461,880,881,883,885,887,889,891,893],{"class":463,"line":659},[461,882,602],{"class":467},[461,884,586],{"class":542},[461,886,575],{"class":475},[461,888,572],{"class":471},[461,890,580],{"class":475},[461,892,609],{"class":542},[461,894,612],{"class":471},[461,896,897,899,901,903,905,907,909,911,913,915,917,919,921,923,925,927,929,931,933,935],{"class":463,"line":670},[461,898,618],{"class":512},[461,900,557],{"class":542},[461,902,623],{"class":471},[461,904,626],{"class":542},[461,906,629],{"class":471},[461,908,849],{"class":475},[461,910,536],{"class":471},[461,912,580],{"class":475},[461,914,536],{"class":471},[461,916,637],{"class":475},[461,918,583],{"class":471},[461,920,642],{"class":542},[461,922,629],{"class":471},[461,924,849],{"class":475},[461,926,536],{"class":471},[461,928,580],{"class":475},[461,930,536],{"class":471},[461,932,651],{"class":475},[461,934,479],{"class":471},[461,936,656],{"class":542},[461,938,939,941,943],{"class":463,"line":678},[461,940,662],{"class":471},[461,942,665],{"class":467},[461,944,519],{"class":471},[461,946,947,949],{"class":463,"line":684},[461,948,673],{"class":512},[461,950,543],{"class":542},[461,952,953],{"class":463,"line":705},[461,954,681],{"class":471},[461,956,958,960,963,965,967,969,971,973],{"class":463,"line":957},14,[461,959,687],{"class":471},[461,961,962],{"class":542}," [",[461,964,575],{"class":475},[461,966,572],{"class":471},[461,968,580],{"class":475},[461,970,572],{"class":471},[461,972,637],{"class":475},[461,974,975],{"class":542},"])\n",[461,977,979],{"class":463,"line":978},15,[461,980,708],{"class":471},[436,982,983,984,987],{},"Wire it up at the root of your app (in ",[458,985,986],{},"_app.tsx",", the root layout, or a top-level provider).",[445,989,991],{"id":990},"svelte","Svelte",[450,993,996],{"className":452,"code":994,"filename":995,"language":455,"meta":456,"style":456},"import { setIdentity, clearIdentity } from 'evlog\u002Fhttp'\nimport { authClient } from '$lib\u002Fauth-client'\n\nexport function setupAuthIdentity() {\n  const session = authClient.useSession()\n\n  session.subscribe(({ data }) => {\n    if (data?.user) {\n      setIdentity({ userId: data.user.id, userName: data.user.name })\n    } else {\n      clearIdentity()\n    }\n  })\n}\n","src\u002Flib\u002Fauth-identity.ts",[458,997,998,1020,1039,1043,1056,1072,1076,1100,1116,1158,1166,1172,1176,1183],{"__ignoreMap":456},[461,999,1000,1002,1004,1006,1008,1010,1012,1014,1016,1018],{"class":463,"line":464},[461,1001,468],{"class":467},[461,1003,472],{"class":471},[461,1005,789],{"class":475},[461,1007,583],{"class":471},[461,1009,794],{"class":475},[461,1011,479],{"class":471},[461,1013,482],{"class":467},[461,1015,485],{"class":471},[461,1017,803],{"class":488},[461,1019,492],{"class":471},[461,1021,1022,1024,1026,1028,1030,1032,1034,1037],{"class":463,"line":495},[461,1023,468],{"class":467},[461,1025,472],{"class":471},[461,1027,476],{"class":475},[461,1029,479],{"class":471},[461,1031,482],{"class":467},[461,1033,485],{"class":471},[461,1035,1036],{"class":488},"$lib\u002Fauth-client",[461,1038,492],{"class":471},[461,1040,1041],{"class":463,"line":502},[461,1042,499],{"emptyLinePlaceholder":498},[461,1044,1045,1047,1049,1052,1054],{"class":463,"line":522},[461,1046,505],{"class":467},[461,1048,509],{"class":508},[461,1050,1051],{"class":512}," setupAuthIdentity",[461,1053,516],{"class":471},[461,1055,519],{"class":471},[461,1057,1058,1060,1062,1064,1066,1068,1070],{"class":463,"line":546},[461,1059,525],{"class":508},[461,1061,528],{"class":475},[461,1063,531],{"class":471},[461,1065,476],{"class":475},[461,1067,536],{"class":471},[461,1069,539],{"class":512},[461,1071,543],{"class":542},[461,1073,1074],{"class":463,"line":551},[461,1075,499],{"emptyLinePlaceholder":498},[461,1077,1078,1081,1083,1086,1088,1091,1093,1096,1098],{"class":463,"line":599},[461,1079,1080],{"class":475},"  session",[461,1082,536],{"class":471},[461,1084,1085],{"class":512},"subscribe",[461,1087,557],{"class":542},[461,1089,1090],{"class":471},"({",[461,1092,849],{"class":589},[461,1094,1095],{"class":471}," })",[461,1097,562],{"class":508},[461,1099,519],{"class":471},[461,1101,1102,1104,1106,1108,1110,1112,1114],{"class":463,"line":615},[461,1103,602],{"class":467},[461,1105,586],{"class":542},[461,1107,575],{"class":475},[461,1109,572],{"class":471},[461,1111,580],{"class":475},[461,1113,609],{"class":542},[461,1115,612],{"class":471},[461,1117,1118,1120,1122,1124,1126,1128,1130,1132,1134,1136,1138,1140,1142,1144,1146,1148,1150,1152,1154,1156],{"class":463,"line":659},[461,1119,618],{"class":512},[461,1121,557],{"class":542},[461,1123,623],{"class":471},[461,1125,626],{"class":542},[461,1127,629],{"class":471},[461,1129,849],{"class":475},[461,1131,536],{"class":471},[461,1133,580],{"class":475},[461,1135,536],{"class":471},[461,1137,637],{"class":475},[461,1139,583],{"class":471},[461,1141,642],{"class":542},[461,1143,629],{"class":471},[461,1145,849],{"class":475},[461,1147,536],{"class":471},[461,1149,580],{"class":475},[461,1151,536],{"class":471},[461,1153,651],{"class":475},[461,1155,479],{"class":471},[461,1157,656],{"class":542},[461,1159,1160,1162,1164],{"class":463,"line":670},[461,1161,662],{"class":471},[461,1163,665],{"class":467},[461,1165,519],{"class":471},[461,1167,1168,1170],{"class":463,"line":678},[461,1169,673],{"class":512},[461,1171,543],{"class":542},[461,1173,1174],{"class":463,"line":684},[461,1175,681],{"class":471},[461,1177,1178,1181],{"class":463,"line":705},[461,1179,1180],{"class":471},"  }",[461,1182,656],{"class":542},[461,1184,1185],{"class":463,"line":957},[461,1186,708],{"class":471},[436,1188,1189,1190,1193],{},"Run ",[458,1191,1192],{},"setupAuthIdentity()"," once when the app boots.",[445,1195,1197],{"id":1196},"output","Output",[436,1199,1200],{},"Client-side logs now include the user identity:",[450,1202,1207],{"className":1203,"code":1204,"filename":1205,"language":1206,"meta":456,"style":456},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"level\": \"info\",\n  \"tag\": \"checkout\",\n  \"message\": \"User clicked checkout\",\n  \"userId\": \"QBX9tPjJQExWawAbNll75\",\n  \"userName\": \"Hugo Richard\"\n}\n","Client Log","json",[458,1208,1209,1213,1237,1257,1277,1297,1316],{"__ignoreMap":456},[461,1210,1211],{"class":463,"line":464},[461,1212,612],{"class":471},[461,1214,1215,1218,1221,1224,1226,1229,1232,1234],{"class":463,"line":495},[461,1216,1217],{"class":471},"  \"",[461,1219,1220],{"class":508},"level",[461,1222,1223],{"class":471},"\"",[461,1225,629],{"class":471},[461,1227,1228],{"class":471}," \"",[461,1230,1231],{"class":488},"info",[461,1233,1223],{"class":471},[461,1235,1236],{"class":471},",\n",[461,1238,1239,1241,1244,1246,1248,1250,1253,1255],{"class":463,"line":502},[461,1240,1217],{"class":471},[461,1242,1243],{"class":508},"tag",[461,1245,1223],{"class":471},[461,1247,629],{"class":471},[461,1249,1228],{"class":471},[461,1251,1252],{"class":488},"checkout",[461,1254,1223],{"class":471},[461,1256,1236],{"class":471},[461,1258,1259,1261,1264,1266,1268,1270,1273,1275],{"class":463,"line":522},[461,1260,1217],{"class":471},[461,1262,1263],{"class":508},"message",[461,1265,1223],{"class":471},[461,1267,629],{"class":471},[461,1269,1228],{"class":471},[461,1271,1272],{"class":488},"User clicked checkout",[461,1274,1223],{"class":471},[461,1276,1236],{"class":471},[461,1278,1279,1281,1284,1286,1288,1290,1293,1295],{"class":463,"line":546},[461,1280,1217],{"class":471},[461,1282,1283],{"class":508},"userId",[461,1285,1223],{"class":471},[461,1287,629],{"class":471},[461,1289,1228],{"class":471},[461,1291,1292],{"class":488},"QBX9tPjJQExWawAbNll75",[461,1294,1223],{"class":471},[461,1296,1236],{"class":471},[461,1298,1299,1301,1304,1306,1308,1310,1313],{"class":463,"line":551},[461,1300,1217],{"class":471},[461,1302,1303],{"class":508},"userName",[461,1305,1223],{"class":471},[461,1307,629],{"class":471},[461,1309,1228],{"class":471},[461,1311,1312],{"class":488},"Hugo Richard",[461,1314,1315],{"class":471},"\"\n",[461,1317,1318],{"class":463,"line":599},[461,1319,708],{"class":471},[1321,1322,1323,1326,1327,1331,1332,1335],"tip",{},[458,1324,1325],{},"setIdentity"," is part of evlog's ",[1328,1329,1330],"a",{"href":67},"client logging"," layer. The same fields are picked up by the HTTP transport when client logs are forwarded to your server, so a single user shows up identified across browser ",[440,1333,1334],{},"and"," API logs.",[1337,1338,1339],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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);}",{"title":456,"searchDepth":495,"depth":495,"links":1341},[1342,1343,1344,1345],{"id":447,"depth":495,"text":448},{"id":752,"depth":495,"text":753},{"id":990,"depth":495,"text":991},{"id":1196,"depth":495,"text":1197},"Mirror the server-side user identity into client-side logs by watching the Better Auth session and calling setIdentity.","md",[1349,1352],{"label":41,"icon":44,"to":106,"color":1350,"variant":1351},"neutral","subtle",{"label":66,"icon":1353,"to":67,"color":1350,"variant":1351},"i-lucide-monitor-dot",{},{"title":119,"icon":69},{"title":431,"description":1346},"GpqdzSD3zeulAg9gqP3hOumIdngTF04pnEijgCVnFaE",[1359,1361],{"title":114,"path":115,"stem":116,"description":1360,"icon":117,"children":-1},"Framework-agnostic factory with route filtering, session timing, and lifecycle hooks. Call it once at startup and reuse across requests.",{"title":123,"path":124,"stem":125,"description":1362,"icon":126,"children":-1},"Watch session resolution time, enable session caching, wire the standalone Nitro hook, and combine with the AI SDK integration.",1778336623391]