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