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