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