[{"data":1,"prerenderedAt":2324},["ShallowReactive",2],{"navigation_docs":3,"-adapters-building-blocks-http":388,"-adapters-building-blocks-http-surround":2319},[4,35,155,197,285,372],{"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,94,122],{"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},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":66,"icon":67,"path":68,"stem":69,"children":70,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk",[71,74,79,84,89],{"title":41,"path":72,"stem":73,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F5.ai-sdk\u002F01.overview",{"title":75,"path":76,"stem":77,"icon":78},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F5.ai-sdk\u002F02.usage","i-lucide-code",{"title":80,"path":81,"stem":82,"icon":83},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F5.ai-sdk\u002F03.options","i-lucide-sliders",{"title":85,"path":86,"stem":87,"icon":88},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F5.ai-sdk\u002F04.metadata","i-lucide-database",{"title":90,"path":91,"stem":92,"icon":93},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F5.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":95,"icon":96,"path":97,"stem":98,"children":99,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F6.better-auth",[100,103,108,113,117],{"title":41,"path":101,"stem":102,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F6.better-auth\u002F01.overview",{"title":104,"path":105,"stem":106,"icon":107},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F6.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":109,"path":110,"stem":111,"icon":112},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F6.better-auth\u002F03.middleware","i-lucide-shield",{"title":114,"path":115,"stem":116,"icon":64},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F6.better-auth\u002F04.client-sync",{"title":118,"path":119,"stem":120,"icon":121},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F6.better-auth\u002F05.performance","i-lucide-gauge",{"title":123,"icon":124,"path":125,"stem":126,"children":127,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F7.audit",[128,131,136,141,146,150],{"title":41,"path":129,"stem":130,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F7.audit\u002F01.overview",{"title":132,"path":133,"stem":134,"icon":135},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F7.audit\u002F02.schema","i-lucide-file-text",{"title":137,"path":138,"stem":139,"icon":140},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F7.audit\u002F03.recording","i-lucide-pen-line",{"title":142,"path":143,"stem":144,"icon":145},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F7.audit\u002F04.pipeline","i-lucide-link",{"title":147,"path":148,"stem":149,"icon":124},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F7.audit\u002F05.compliance",{"title":151,"path":152,"stem":153,"icon":154},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F7.audit\u002F06.recipes","i-lucide-book-open",{"title":156,"path":157,"stem":158,"children":159,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[160,165,170,175,180,184,187,192],{"title":161,"path":162,"stem":163,"icon":164},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":166,"path":167,"stem":168,"icon":169},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":171,"path":172,"stem":173,"icon":174},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":176,"path":177,"stem":178,"icon":179},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":181,"path":182,"stem":183,"icon":124},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":118,"path":185,"stem":186,"icon":121},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":188,"path":189,"stem":190,"icon":191},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":193,"path":194,"stem":195,"icon":196},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":198,"path":199,"stem":200,"children":201,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[202,206,211,216,221,226,231,236,241,246,251,256,261,266,270,275,280],{"title":41,"path":203,"stem":204,"icon":205},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":207,"path":208,"stem":209,"icon":210},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":212,"path":213,"stem":214,"icon":215},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":217,"path":218,"stem":219,"icon":220},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":222,"path":223,"stem":224,"icon":225},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":227,"path":228,"stem":229,"icon":230},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":232,"path":233,"stem":234,"icon":235},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":237,"path":238,"stem":239,"icon":240},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":242,"path":243,"stem":244,"icon":245},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":247,"path":248,"stem":249,"icon":250},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":252,"path":253,"stem":254,"icon":255},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":257,"path":258,"stem":259,"icon":260},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":262,"path":263,"stem":264,"icon":265},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":267,"path":268,"stem":269,"icon":179},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":271,"path":272,"stem":273,"icon":274},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":276,"path":277,"stem":278,"icon":279},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":281,"path":282,"stem":283,"icon":284},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":286,"path":287,"stem":288,"children":289,"page":34},"Adapters","\u002Fadapters","6.adapters",[290,293,333,348],{"title":41,"path":291,"stem":292,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":294,"path":295,"stem":296,"children":297,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[298,303,308,313,318,323,328],{"title":299,"path":300,"stem":301,"icon":302},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":304,"path":305,"stem":306,"icon":307},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":309,"path":310,"stem":311,"icon":312},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":314,"path":315,"stem":316,"icon":317},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":319,"path":320,"stem":321,"icon":322},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":324,"path":325,"stem":326,"icon":327},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":329,"path":330,"stem":331,"icon":332},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":334,"path":335,"stem":336,"children":337,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[338,343],{"title":339,"path":340,"stem":341,"icon":342},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":344,"path":345,"stem":346,"icon":347},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":349,"path":350,"stem":351,"children":352,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[353,358,363,367],{"title":354,"path":355,"stem":356,"icon":357},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":359,"path":360,"stem":361,"icon":362},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":364,"path":365,"stem":366,"icon":78},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":368,"path":369,"stem":370,"icon":371},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":373,"path":374,"stem":375,"children":376,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[377,380,384],{"title":41,"path":378,"stem":379,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":381,"path":382,"stem":383,"icon":284},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":385,"path":386,"stem":387,"icon":78},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":389,"title":390,"body":391,"description":2308,"extension":2309,"links":2310,"meta":2315,"navigation":2316,"path":360,"seo":2317,"stem":361,"__hash__":2318},"docs\u002F6.adapters\u002F04.building-blocks\u002F02.http.md","HTTP drain",{"type":392,"value":393,"toc":2288},"minimark",[394,398,424,477,481,683,687,742,746,753,767,955,961,964,1169,1173,1179,1302,1308,1371,1375,1388,1393,1397,1400,1494,1521,1525,1531,1534,1685,1688,1832,1836,1846,2245,2255,2262,2266,2284],[395,396,397],"p",{},"Most observability tools focus on server-side logs. The HTTP drain gives you a framework-agnostic way to send structured logs from the browser to any HTTP endpoint without any vendor SDK or framework coupling.",[399,400,402,403,407,408,412,413,416,417,420,421,423],"callout",{"color":401,"icon":13},"neutral","The ",[404,405,406],"code",{},"evlog\u002Fbrowser"," import path is ",[409,410,411],"strong",{},"deprecated"," and re-exports the same API as ",[404,414,415],{},"evlog\u002Fhttp",". It will be removed in the next ",[409,418,419],{},"major"," release. Prefer ",[404,422,415],{}," for new code.",[425,426,429,432,465],"prompt",{":actions":427,"description":428,"icon":362},"[\"copy\",\"cursor\",\"windsurf\"]","Set up the HTTP transport for client logs",[395,430,431],{},"Set up the HTTP transport so my browser logs are sent to my server.",[433,434,435,439,442,452,455,458],"ul",{},[436,437,438],"li",{},"Install evlog: pnpm add evlog",[436,440,441],{},"Import createHttpLogDrain from 'evlog\u002Fhttp' (NOT evlog\u002Fbrowser — that's deprecated)",[436,443,444,445,451],{},"Create a drain with { endpoint: '",[446,447,448],"a",{"href":448,"rel":449},"https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest",[450],"nofollow","' } and an optional pipeline ({ batch: { size, intervalMs } })",[436,453,454],{},"Pass the drain to initLogger({ drain }) on the client side",[436,456,457],{},"The drain batches events and uses fetch keepalive + sendBeacon on visibility change",[436,459,460,461,464],{},"On the server, accept POST requests with a DrainContext",[462,463],"span",{}," body and forward them to my drain pipeline",[395,466,467,468,472,473],{},"Docs: ",[446,469,470],{"href":470,"rel":471},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fbuilding-blocks\u002Fhttp",[450],"\nPipeline: ",[446,474,475],{"href":475,"rel":476},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline",[450],[478,479,20],"h2",{"id":480},"quick-start",[482,483,489],"pre",{"className":484,"code":485,"filename":486,"language":487,"meta":488,"style":488},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { initLogger, log } from 'evlog'\nimport { createHttpLogDrain } from 'evlog\u002Fhttp'\n\nconst drain = createHttpLogDrain({\n  drain: { endpoint: 'https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest' },\n})\ninitLogger({ drain })\n\nlog.info({ action: 'page_view', path: location.pathname })\n","app.ts","typescript","",[404,490,491,529,549,556,578,605,614,631,636],{"__ignoreMap":488},[462,492,495,499,503,507,510,513,516,519,522,526],{"class":493,"line":494},"line",1,[462,496,498],{"class":497},"s7zQu","import",[462,500,502],{"class":501},"sMK4o"," {",[462,504,506],{"class":505},"sTEyZ"," initLogger",[462,508,509],{"class":501},",",[462,511,512],{"class":505}," log",[462,514,515],{"class":501}," }",[462,517,518],{"class":497}," from",[462,520,521],{"class":501}," '",[462,523,525],{"class":524},"sfazB","evlog",[462,527,528],{"class":501},"'\n",[462,530,532,534,536,539,541,543,545,547],{"class":493,"line":531},2,[462,533,498],{"class":497},[462,535,502],{"class":501},[462,537,538],{"class":505}," createHttpLogDrain",[462,540,515],{"class":501},[462,542,518],{"class":497},[462,544,521],{"class":501},[462,546,415],{"class":524},[462,548,528],{"class":501},[462,550,552],{"class":493,"line":551},3,[462,553,555],{"emptyLinePlaceholder":554},true,"\n",[462,557,559,563,566,569,572,575],{"class":493,"line":558},4,[462,560,562],{"class":561},"spNyl","const",[462,564,565],{"class":505}," drain ",[462,567,568],{"class":501},"=",[462,570,538],{"class":571},"s2Zo4",[462,573,574],{"class":505},"(",[462,576,577],{"class":501},"{\n",[462,579,581,585,588,590,593,595,597,599,602],{"class":493,"line":580},5,[462,582,584],{"class":583},"swJcz","  drain",[462,586,587],{"class":501},":",[462,589,502],{"class":501},[462,591,592],{"class":583}," endpoint",[462,594,587],{"class":501},[462,596,521],{"class":501},[462,598,448],{"class":524},[462,600,601],{"class":501},"'",[462,603,604],{"class":501}," },\n",[462,606,608,611],{"class":493,"line":607},6,[462,609,610],{"class":501},"}",[462,612,613],{"class":505},")\n",[462,615,617,620,622,625,627,629],{"class":493,"line":616},7,[462,618,619],{"class":571},"initLogger",[462,621,574],{"class":505},[462,623,624],{"class":501},"{",[462,626,565],{"class":505},[462,628,610],{"class":501},[462,630,613],{"class":505},[462,632,634],{"class":493,"line":633},8,[462,635,555],{"emptyLinePlaceholder":554},[462,637,639,642,645,648,650,652,655,657,659,662,664,666,669,671,674,676,679,681],{"class":493,"line":638},9,[462,640,641],{"class":505},"log",[462,643,644],{"class":501},".",[462,646,647],{"class":571},"info",[462,649,574],{"class":505},[462,651,624],{"class":501},[462,653,654],{"class":583}," action",[462,656,587],{"class":501},[462,658,521],{"class":501},[462,660,661],{"class":524},"page_view",[462,663,601],{"class":501},[462,665,509],{"class":501},[462,667,668],{"class":583}," path",[462,670,587],{"class":501},[462,672,673],{"class":505}," location",[462,675,644],{"class":501},[462,677,678],{"class":505},"pathname ",[462,680,610],{"class":501},[462,682,613],{"class":505},[478,684,686],{"id":685},"how-it-works","How It Works",[688,689,690,706,713,724,731],"ol",{},[436,691,692,695,696,695,699,702,703],{},[404,693,694],{},"log.info()"," \u002F ",[404,697,698],{},"log.warn()",[404,700,701],{},"log.error()"," push events into a ",[409,704,705],{},"memory buffer",[436,707,708,709,712],{},"Events are ",[409,710,711],{},"batched"," by size (default 25) or time interval (default 2 s)",[436,714,715,716,719,720,723],{},"Batches are sent via ",[404,717,718],{},"fetch"," with ",[404,721,722],{},"keepalive: true"," so requests survive page navigation",[436,725,726,727,730],{},"When the page becomes hidden (tab switch, navigation), buffered events are flushed via ",[404,728,729],{},"navigator.sendBeacon"," as a fallback",[436,732,733,734,737,738,741],{},"Your ",[409,735,736],{},"server endpoint"," receives a ",[404,739,740],{},"DrainContext[]"," JSON array and processes it however you like",[478,743,745],{"id":744},"two-tier-api","Two-Tier API",[747,748,750],"h3",{"id":749},"createhttplogdrainoptions",[404,751,752],{},"createHttpLogDrain(options)",[395,754,755,756,759,760,763,764,644],{},"High-level, pre-composed: creates a pipeline with batching, retry, and auto-flush on ",[404,757,758],{},"visibilitychange",". Returns a ",[404,761,762],{},"PipelineDrainFn\u003CDrainContext>"," directly usable with ",[404,765,766],{},"initLogger({ drain })",[482,768,770],{"className":484,"code":769,"filename":486,"language":487,"meta":488,"style":488},"import { initLogger, log } from 'evlog'\nimport { createHttpLogDrain } from 'evlog\u002Fhttp'\n\nconst drain = createHttpLogDrain({\n  drain: { endpoint: 'https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest' },\n  pipeline: { batch: { size: 50, intervalMs: 5000 } },\n})\n\ninitLogger({ drain })\nlog.info({ action: 'click', target: 'buy-button' })\n",[404,771,772,794,812,816,830,850,889,895,899,913],{"__ignoreMap":488},[462,773,774,776,778,780,782,784,786,788,790,792],{"class":493,"line":494},[462,775,498],{"class":497},[462,777,502],{"class":501},[462,779,506],{"class":505},[462,781,509],{"class":501},[462,783,512],{"class":505},[462,785,515],{"class":501},[462,787,518],{"class":497},[462,789,521],{"class":501},[462,791,525],{"class":524},[462,793,528],{"class":501},[462,795,796,798,800,802,804,806,808,810],{"class":493,"line":531},[462,797,498],{"class":497},[462,799,502],{"class":501},[462,801,538],{"class":505},[462,803,515],{"class":501},[462,805,518],{"class":497},[462,807,521],{"class":501},[462,809,415],{"class":524},[462,811,528],{"class":501},[462,813,814],{"class":493,"line":551},[462,815,555],{"emptyLinePlaceholder":554},[462,817,818,820,822,824,826,828],{"class":493,"line":558},[462,819,562],{"class":561},[462,821,565],{"class":505},[462,823,568],{"class":501},[462,825,538],{"class":571},[462,827,574],{"class":505},[462,829,577],{"class":501},[462,831,832,834,836,838,840,842,844,846,848],{"class":493,"line":580},[462,833,584],{"class":583},[462,835,587],{"class":501},[462,837,502],{"class":501},[462,839,592],{"class":583},[462,841,587],{"class":501},[462,843,521],{"class":501},[462,845,448],{"class":524},[462,847,601],{"class":501},[462,849,604],{"class":501},[462,851,852,855,857,859,862,864,866,869,871,875,877,880,882,885,887],{"class":493,"line":607},[462,853,854],{"class":583},"  pipeline",[462,856,587],{"class":501},[462,858,502],{"class":501},[462,860,861],{"class":583}," batch",[462,863,587],{"class":501},[462,865,502],{"class":501},[462,867,868],{"class":583}," size",[462,870,587],{"class":501},[462,872,874],{"class":873},"sbssI"," 50",[462,876,509],{"class":501},[462,878,879],{"class":583}," intervalMs",[462,881,587],{"class":501},[462,883,884],{"class":873}," 5000",[462,886,515],{"class":501},[462,888,604],{"class":501},[462,890,891,893],{"class":493,"line":616},[462,892,610],{"class":501},[462,894,613],{"class":505},[462,896,897],{"class":493,"line":633},[462,898,555],{"emptyLinePlaceholder":554},[462,900,901,903,905,907,909,911],{"class":493,"line":638},[462,902,619],{"class":571},[462,904,574],{"class":505},[462,906,624],{"class":501},[462,908,565],{"class":505},[462,910,610],{"class":501},[462,912,613],{"class":505},[462,914,916,918,920,922,924,926,928,930,932,935,937,939,942,944,946,949,951,953],{"class":493,"line":915},10,[462,917,641],{"class":505},[462,919,644],{"class":501},[462,921,647],{"class":571},[462,923,574],{"class":505},[462,925,624],{"class":501},[462,927,654],{"class":583},[462,929,587],{"class":501},[462,931,521],{"class":501},[462,933,934],{"class":524},"click",[462,936,601],{"class":501},[462,938,509],{"class":501},[462,940,941],{"class":583}," target",[462,943,587],{"class":501},[462,945,521],{"class":501},[462,947,948],{"class":524},"buy-button",[462,950,601],{"class":501},[462,952,515],{"class":501},[462,954,613],{"class":505},[747,956,958],{"id":957},"createhttpdrainconfig",[404,959,960],{},"createHttpDrain(config)",[395,962,963],{},"Low-level transport function. Use this when you want full control over the pipeline configuration:",[482,965,967],{"className":484,"code":966,"filename":486,"language":487,"meta":488,"style":488},"import { createHttpDrain } from 'evlog\u002Fhttp'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport type { DrainContext } from 'evlog'\n\nconst transport = createHttpDrain({\n  endpoint: 'https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest',\n})\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: { size: 100, intervalMs: 10000 },\n  retry: { maxAttempts: 5 },\n})\n\nconst drain = pipeline(transport)\n",[404,968,969,988,1008,1030,1034,1049,1065,1071,1096,1123,1142,1149,1154],{"__ignoreMap":488},[462,970,971,973,975,978,980,982,984,986],{"class":493,"line":494},[462,972,498],{"class":497},[462,974,502],{"class":501},[462,976,977],{"class":505}," createHttpDrain",[462,979,515],{"class":501},[462,981,518],{"class":497},[462,983,521],{"class":501},[462,985,415],{"class":524},[462,987,528],{"class":501},[462,989,990,992,994,997,999,1001,1003,1006],{"class":493,"line":531},[462,991,498],{"class":497},[462,993,502],{"class":501},[462,995,996],{"class":505}," createDrainPipeline",[462,998,515],{"class":501},[462,1000,518],{"class":497},[462,1002,521],{"class":501},[462,1004,1005],{"class":524},"evlog\u002Fpipeline",[462,1007,528],{"class":501},[462,1009,1010,1012,1015,1017,1020,1022,1024,1026,1028],{"class":493,"line":551},[462,1011,498],{"class":497},[462,1013,1014],{"class":497}," type",[462,1016,502],{"class":501},[462,1018,1019],{"class":505}," DrainContext",[462,1021,515],{"class":501},[462,1023,518],{"class":497},[462,1025,521],{"class":501},[462,1027,525],{"class":524},[462,1029,528],{"class":501},[462,1031,1032],{"class":493,"line":558},[462,1033,555],{"emptyLinePlaceholder":554},[462,1035,1036,1038,1041,1043,1045,1047],{"class":493,"line":580},[462,1037,562],{"class":561},[462,1039,1040],{"class":505}," transport ",[462,1042,568],{"class":501},[462,1044,977],{"class":571},[462,1046,574],{"class":505},[462,1048,577],{"class":501},[462,1050,1051,1054,1056,1058,1060,1062],{"class":493,"line":607},[462,1052,1053],{"class":583},"  endpoint",[462,1055,587],{"class":501},[462,1057,521],{"class":501},[462,1059,448],{"class":524},[462,1061,601],{"class":501},[462,1063,1064],{"class":501},",\n",[462,1066,1067,1069],{"class":493,"line":616},[462,1068,610],{"class":501},[462,1070,613],{"class":505},[462,1072,1073,1075,1078,1080,1082,1085,1089,1092,1094],{"class":493,"line":633},[462,1074,562],{"class":561},[462,1076,1077],{"class":505}," pipeline ",[462,1079,568],{"class":501},[462,1081,996],{"class":571},[462,1083,1084],{"class":501},"\u003C",[462,1086,1088],{"class":1087},"sBMFI","DrainContext",[462,1090,1091],{"class":501},">",[462,1093,574],{"class":505},[462,1095,577],{"class":501},[462,1097,1098,1101,1103,1105,1107,1109,1112,1114,1116,1118,1121],{"class":493,"line":638},[462,1099,1100],{"class":583},"  batch",[462,1102,587],{"class":501},[462,1104,502],{"class":501},[462,1106,868],{"class":583},[462,1108,587],{"class":501},[462,1110,1111],{"class":873}," 100",[462,1113,509],{"class":501},[462,1115,879],{"class":583},[462,1117,587],{"class":501},[462,1119,1120],{"class":873}," 10000",[462,1122,604],{"class":501},[462,1124,1125,1128,1130,1132,1135,1137,1140],{"class":493,"line":915},[462,1126,1127],{"class":583},"  retry",[462,1129,587],{"class":501},[462,1131,502],{"class":501},[462,1133,1134],{"class":583}," maxAttempts",[462,1136,587],{"class":501},[462,1138,1139],{"class":873}," 5",[462,1141,604],{"class":501},[462,1143,1145,1147],{"class":493,"line":1144},11,[462,1146,610],{"class":501},[462,1148,613],{"class":505},[462,1150,1152],{"class":493,"line":1151},12,[462,1153,555],{"emptyLinePlaceholder":554},[462,1155,1157,1159,1161,1163,1166],{"class":493,"line":1156},13,[462,1158,562],{"class":561},[462,1160,565],{"class":505},[462,1162,568],{"class":501},[462,1164,1165],{"class":571}," pipeline",[462,1167,1168],{"class":505},"(transport)\n",[478,1170,1172],{"id":1171},"configuration-reference","Configuration Reference",[747,1174,1176],{"id":1175},"httpdrainconfig",[404,1177,1178],{},"HttpDrainConfig",[1180,1181,1182,1198],"table",{},[1183,1184,1185],"thead",{},[1186,1187,1188,1192,1195],"tr",{},[1189,1190,1191],"th",{},"Option",[1189,1193,1194],{},"Default",[1189,1196,1197],{},"Description",[1199,1200,1201,1218,1241,1256,1275],"tbody",{},[1186,1202,1203,1209,1212],{},[1204,1205,1206],"td",{},[404,1207,1208],{},"endpoint",[1204,1210,1211],{},"-",[1204,1213,1214,1217],{},[409,1215,1216],{},"(required)"," Full URL of the server ingest endpoint",[1186,1219,1220,1225,1227],{},[1204,1221,1222],{},[404,1223,1224],{},"headers",[1204,1226,1211],{},[1204,1228,1229,1230,1232,1233,1236,1237,1240],{},"Custom headers sent with each ",[404,1231,718],{}," request (e.g. ",[404,1234,1235],{},"Authorization",", ",[404,1238,1239],{},"X-API-Key",")",[1186,1242,1243,1248,1253],{},[1204,1244,1245],{},[404,1246,1247],{},"timeout",[1204,1249,1250],{},[404,1251,1252],{},"5000",[1204,1254,1255],{},"Request timeout in milliseconds",[1186,1257,1258,1263,1268],{},[1204,1259,1260],{},[404,1261,1262],{},"useBeacon",[1204,1264,1265],{},[404,1266,1267],{},"true",[1204,1269,1270,1271,1274],{},"Use ",[404,1272,1273],{},"sendBeacon"," when the page is hidden",[1186,1276,1277,1282,1287],{},[1204,1278,1279],{},[404,1280,1281],{},"credentials",[1204,1283,1284],{},[404,1285,1286],{},"'same-origin'",[1204,1288,1289,1290,1236,1293,1236,1295,1298,1299,1301],{},"Fetch credentials mode (",[404,1291,1292],{},"'omit'",[404,1294,1286],{},[404,1296,1297],{},"'include'","). Set to ",[404,1300,1297],{}," for cross-origin endpoints",[747,1303,1305],{"id":1304},"httplogdrainoptions",[404,1306,1307],{},"HttpLogDrainOptions",[1180,1309,1310,1320],{},[1183,1311,1312],{},[1186,1313,1314,1316,1318],{},[1189,1315,1191],{},[1189,1317,1194],{},[1189,1319,1197],{},[1199,1321,1322,1339,1354],{},[1186,1323,1324,1329,1331],{},[1204,1325,1326],{},[404,1327,1328],{},"drain",[1204,1330,1211],{},[1204,1332,1333,1335,1336,1338],{},[409,1334,1216],{}," ",[404,1337,1178],{}," object",[1186,1340,1341,1346,1351],{},[1204,1342,1343],{},[404,1344,1345],{},"pipeline",[1204,1347,1348],{},[404,1349,1350],{},"{ batch: { size: 25, intervalMs: 2000 }, retry: { maxAttempts: 2 } }",[1204,1352,1353],{},"Pipeline configuration overrides",[1186,1355,1356,1361,1365],{},[1204,1357,1358],{},[404,1359,1360],{},"autoFlush",[1204,1362,1363],{},[404,1364,1267],{},[1204,1366,1367,1368,1370],{},"Auto-register ",[404,1369,758],{}," flush listener",[478,1372,1374],{"id":1373},"sendbeacon-fallback","sendBeacon Fallback",[399,1376,1378,1379,1381,1382,1384,1385,1387],{"color":647,"icon":1377},"i-lucide-radio","When ",[404,1380,1262],{}," is enabled (the default) and the page becomes hidden, the drain automatically switches from ",[404,1383,718],{}," to ",[404,1386,729],{},". This ensures logs are delivered even when the user closes the tab or navigates away, preventing data loss on page exit.",[395,1389,1390,1392],{},[404,1391,1273],{}," has a browser-imposed payload limit (~64 KB). If the payload exceeds this, the drain throws an error. Keep batch sizes reasonable (the default of 25 is well within limits).",[478,1394,1396],{"id":1395},"authentication","Authentication",[395,1398,1399],{},"Pass custom headers to protect your ingest endpoint:",[482,1401,1403],{"className":484,"code":1402,"filename":486,"language":487,"meta":488,"style":488},"const drain = createHttpLogDrain({\n  drain: {\n    endpoint: 'https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest',\n    headers: {\n      'Authorization': 'Bearer ' + token,\n    },\n  },\n})\n",[404,1404,1405,1419,1428,1443,1452,1478,1483,1488],{"__ignoreMap":488},[462,1406,1407,1409,1411,1413,1415,1417],{"class":493,"line":494},[462,1408,562],{"class":561},[462,1410,565],{"class":505},[462,1412,568],{"class":501},[462,1414,538],{"class":571},[462,1416,574],{"class":505},[462,1418,577],{"class":501},[462,1420,1421,1423,1425],{"class":493,"line":531},[462,1422,584],{"class":583},[462,1424,587],{"class":501},[462,1426,1427],{"class":501}," {\n",[462,1429,1430,1433,1435,1437,1439,1441],{"class":493,"line":551},[462,1431,1432],{"class":583},"    endpoint",[462,1434,587],{"class":501},[462,1436,521],{"class":501},[462,1438,448],{"class":524},[462,1440,601],{"class":501},[462,1442,1064],{"class":501},[462,1444,1445,1448,1450],{"class":493,"line":558},[462,1446,1447],{"class":583},"    headers",[462,1449,587],{"class":501},[462,1451,1427],{"class":501},[462,1453,1454,1457,1459,1461,1463,1465,1468,1470,1473,1476],{"class":493,"line":580},[462,1455,1456],{"class":501},"      '",[462,1458,1235],{"class":583},[462,1460,601],{"class":501},[462,1462,587],{"class":501},[462,1464,521],{"class":501},[462,1466,1467],{"class":524},"Bearer ",[462,1469,601],{"class":501},[462,1471,1472],{"class":501}," +",[462,1474,1475],{"class":505}," token",[462,1477,1064],{"class":501},[462,1479,1480],{"class":493,"line":607},[462,1481,1482],{"class":501},"    },\n",[462,1484,1485],{"class":493,"line":616},[462,1486,1487],{"class":501},"  },\n",[462,1489,1490,1492],{"class":493,"line":633},[462,1491,610],{"class":501},[462,1493,613],{"class":505},[399,1495,1497,1499,1500,1502,1503,1505,1506,1508,1509,1512,1513,1515,1516,719,1518,644],{"color":1496,"icon":59},"warning",[404,1498,1224],{}," are applied to ",[404,1501,718],{}," requests only. The ",[404,1504,1273],{}," API does not support custom headers, so when the page is hidden and ",[404,1507,1273],{}," is used, headers are not sent. If your endpoint requires authentication, consider validating via a session cookie (set ",[404,1510,1511],{},"credentials: 'include'"," for cross-origin endpoints, defaults to ",[404,1514,1286],{},") or disable ",[404,1517,1273],{},[404,1519,1520],{},"useBeacon: false",[478,1522,1524],{"id":1523},"server-endpoint","Server Endpoint",[395,1526,1527,1528,1530],{},"Your server needs a POST endpoint that accepts a ",[404,1529,740],{}," JSON body. Here are examples for common frameworks:",[747,1532,237],{"id":1533},"express",[482,1535,1538],{"className":484,"code":1536,"filename":1537,"language":487,"meta":488,"style":488},"app.post('\u002Fv1\u002Fingest', express.json(), (req, res) => {\n  for (const entry of req.body) {\n    console.log('[BROWSER]', JSON.stringify(entry))\n  }\n  res.sendStatus(204)\n})\n","server.ts",[404,1539,1540,1593,1621,1657,1662,1679],{"__ignoreMap":488},[462,1541,1542,1545,1547,1550,1552,1554,1557,1559,1561,1564,1566,1569,1572,1574,1577,1581,1583,1586,1588,1591],{"class":493,"line":494},[462,1543,1544],{"class":505},"app",[462,1546,644],{"class":501},[462,1548,1549],{"class":571},"post",[462,1551,574],{"class":505},[462,1553,601],{"class":501},[462,1555,1556],{"class":524},"\u002Fv1\u002Fingest",[462,1558,601],{"class":501},[462,1560,509],{"class":501},[462,1562,1563],{"class":505}," express",[462,1565,644],{"class":501},[462,1567,1568],{"class":571},"json",[462,1570,1571],{"class":505},"()",[462,1573,509],{"class":501},[462,1575,1576],{"class":501}," (",[462,1578,1580],{"class":1579},"sHdIc","req",[462,1582,509],{"class":501},[462,1584,1585],{"class":1579}," res",[462,1587,1240],{"class":501},[462,1589,1590],{"class":561}," =>",[462,1592,1427],{"class":501},[462,1594,1595,1598,1600,1602,1605,1608,1611,1613,1616,1619],{"class":493,"line":531},[462,1596,1597],{"class":497},"  for",[462,1599,1576],{"class":583},[462,1601,562],{"class":561},[462,1603,1604],{"class":505}," entry",[462,1606,1607],{"class":501}," of",[462,1609,1610],{"class":505}," req",[462,1612,644],{"class":501},[462,1614,1615],{"class":505},"body",[462,1617,1618],{"class":583},") ",[462,1620,577],{"class":501},[462,1622,1623,1626,1628,1630,1632,1634,1637,1639,1641,1644,1646,1649,1651,1654],{"class":493,"line":551},[462,1624,1625],{"class":505},"    console",[462,1627,644],{"class":501},[462,1629,641],{"class":571},[462,1631,574],{"class":583},[462,1633,601],{"class":501},[462,1635,1636],{"class":524},"[BROWSER]",[462,1638,601],{"class":501},[462,1640,509],{"class":501},[462,1642,1643],{"class":505}," JSON",[462,1645,644],{"class":501},[462,1647,1648],{"class":571},"stringify",[462,1650,574],{"class":583},[462,1652,1653],{"class":505},"entry",[462,1655,1656],{"class":583},"))\n",[462,1658,1659],{"class":493,"line":558},[462,1660,1661],{"class":501},"  }\n",[462,1663,1664,1667,1669,1672,1674,1677],{"class":493,"line":580},[462,1665,1666],{"class":505},"  res",[462,1668,644],{"class":501},[462,1670,1671],{"class":571},"sendStatus",[462,1673,574],{"class":583},[462,1675,1676],{"class":873},"204",[462,1678,613],{"class":583},[462,1680,1681,1683],{"class":493,"line":607},[462,1682,610],{"class":501},[462,1684,613],{"class":505},[747,1686,242],{"id":1687},"hono",[482,1689,1691],{"className":484,"code":1690,"filename":1537,"language":487,"meta":488,"style":488},"app.post('\u002Fv1\u002Fingest', async (c) => {\n  const body = await c.req.json()\n  for (const entry of body) {\n    console.log('[BROWSER]', JSON.stringify(entry))\n  }\n  return c.body(null, 204)\n})\n",[404,1692,1693,1725,1753,1771,1801,1805,1826],{"__ignoreMap":488},[462,1694,1695,1697,1699,1701,1703,1705,1707,1709,1711,1714,1716,1719,1721,1723],{"class":493,"line":494},[462,1696,1544],{"class":505},[462,1698,644],{"class":501},[462,1700,1549],{"class":571},[462,1702,574],{"class":505},[462,1704,601],{"class":501},[462,1706,1556],{"class":524},[462,1708,601],{"class":501},[462,1710,509],{"class":501},[462,1712,1713],{"class":561}," async",[462,1715,1576],{"class":501},[462,1717,1718],{"class":1579},"c",[462,1720,1240],{"class":501},[462,1722,1590],{"class":561},[462,1724,1427],{"class":501},[462,1726,1727,1730,1733,1736,1739,1742,1744,1746,1748,1750],{"class":493,"line":531},[462,1728,1729],{"class":561},"  const",[462,1731,1732],{"class":505}," body",[462,1734,1735],{"class":501}," =",[462,1737,1738],{"class":497}," await",[462,1740,1741],{"class":505}," c",[462,1743,644],{"class":501},[462,1745,1580],{"class":505},[462,1747,644],{"class":501},[462,1749,1568],{"class":571},[462,1751,1752],{"class":583},"()\n",[462,1754,1755,1757,1759,1761,1763,1765,1767,1769],{"class":493,"line":551},[462,1756,1597],{"class":497},[462,1758,1576],{"class":583},[462,1760,562],{"class":561},[462,1762,1604],{"class":505},[462,1764,1607],{"class":501},[462,1766,1732],{"class":505},[462,1768,1618],{"class":583},[462,1770,577],{"class":501},[462,1772,1773,1775,1777,1779,1781,1783,1785,1787,1789,1791,1793,1795,1797,1799],{"class":493,"line":558},[462,1774,1625],{"class":505},[462,1776,644],{"class":501},[462,1778,641],{"class":571},[462,1780,574],{"class":583},[462,1782,601],{"class":501},[462,1784,1636],{"class":524},[462,1786,601],{"class":501},[462,1788,509],{"class":501},[462,1790,1643],{"class":505},[462,1792,644],{"class":501},[462,1794,1648],{"class":571},[462,1796,574],{"class":583},[462,1798,1653],{"class":505},[462,1800,1656],{"class":583},[462,1802,1803],{"class":493,"line":580},[462,1804,1661],{"class":501},[462,1806,1807,1810,1812,1814,1816,1818,1821,1824],{"class":493,"line":607},[462,1808,1809],{"class":497},"  return",[462,1811,1741],{"class":505},[462,1813,644],{"class":501},[462,1815,1615],{"class":571},[462,1817,574],{"class":583},[462,1819,1820],{"class":501},"null,",[462,1822,1823],{"class":873}," 204",[462,1825,613],{"class":583},[462,1827,1828,1830],{"class":493,"line":616},[462,1829,610],{"class":501},[462,1831,613],{"class":505},[478,1833,1835],{"id":1834},"full-control","Full Control",[395,1837,1838,1839,719,1842,1845],{},"Combine ",[404,1840,1841],{},"createHttpDrain",[404,1843,1844],{},"createDrainPipeline"," for maximum flexibility:",[482,1847,1849],{"className":484,"code":1848,"filename":486,"language":487,"meta":488,"style":488},"import { initLogger, log } from 'evlog'\nimport type { DrainContext } from 'evlog'\nimport { createHttpDrain } from 'evlog\u002Fhttp'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: { size: 100, intervalMs: 10000 },\n  retry: { maxAttempts: 5, backoff: 'exponential' },\n  maxBufferSize: 500,\n  onDropped: (events) => {\n    console.warn(`Dropped ${events.length} client events`)\n  },\n})\n\nconst drain = pipeline(createHttpDrain({\n  endpoint: 'https:\u002F\u002Flogs.example.com\u002Fv1\u002Fingest',\n  timeout: 3000,\n}))\n\ninitLogger({ drain })\n\nlog.info({ action: 'app_init' })\n\n\u002F\u002F Flush on page unload\nwindow.addEventListener('beforeunload', () => drain.flush())\n",[404,1850,1851,1873,1893,1911,1929,1933,1953,1977,2007,2019,2037,2073,2077,2083,2088,2107,2122,2135,2142,2147,2162,2167,2195,2200,2207],{"__ignoreMap":488},[462,1852,1853,1855,1857,1859,1861,1863,1865,1867,1869,1871],{"class":493,"line":494},[462,1854,498],{"class":497},[462,1856,502],{"class":501},[462,1858,506],{"class":505},[462,1860,509],{"class":501},[462,1862,512],{"class":505},[462,1864,515],{"class":501},[462,1866,518],{"class":497},[462,1868,521],{"class":501},[462,1870,525],{"class":524},[462,1872,528],{"class":501},[462,1874,1875,1877,1879,1881,1883,1885,1887,1889,1891],{"class":493,"line":531},[462,1876,498],{"class":497},[462,1878,1014],{"class":497},[462,1880,502],{"class":501},[462,1882,1019],{"class":505},[462,1884,515],{"class":501},[462,1886,518],{"class":497},[462,1888,521],{"class":501},[462,1890,525],{"class":524},[462,1892,528],{"class":501},[462,1894,1895,1897,1899,1901,1903,1905,1907,1909],{"class":493,"line":551},[462,1896,498],{"class":497},[462,1898,502],{"class":501},[462,1900,977],{"class":505},[462,1902,515],{"class":501},[462,1904,518],{"class":497},[462,1906,521],{"class":501},[462,1908,415],{"class":524},[462,1910,528],{"class":501},[462,1912,1913,1915,1917,1919,1921,1923,1925,1927],{"class":493,"line":558},[462,1914,498],{"class":497},[462,1916,502],{"class":501},[462,1918,996],{"class":505},[462,1920,515],{"class":501},[462,1922,518],{"class":497},[462,1924,521],{"class":501},[462,1926,1005],{"class":524},[462,1928,528],{"class":501},[462,1930,1931],{"class":493,"line":580},[462,1932,555],{"emptyLinePlaceholder":554},[462,1934,1935,1937,1939,1941,1943,1945,1947,1949,1951],{"class":493,"line":607},[462,1936,562],{"class":561},[462,1938,1077],{"class":505},[462,1940,568],{"class":501},[462,1942,996],{"class":571},[462,1944,1084],{"class":501},[462,1946,1088],{"class":1087},[462,1948,1091],{"class":501},[462,1950,574],{"class":505},[462,1952,577],{"class":501},[462,1954,1955,1957,1959,1961,1963,1965,1967,1969,1971,1973,1975],{"class":493,"line":616},[462,1956,1100],{"class":583},[462,1958,587],{"class":501},[462,1960,502],{"class":501},[462,1962,868],{"class":583},[462,1964,587],{"class":501},[462,1966,1111],{"class":873},[462,1968,509],{"class":501},[462,1970,879],{"class":583},[462,1972,587],{"class":501},[462,1974,1120],{"class":873},[462,1976,604],{"class":501},[462,1978,1979,1981,1983,1985,1987,1989,1991,1993,1996,1998,2000,2003,2005],{"class":493,"line":633},[462,1980,1127],{"class":583},[462,1982,587],{"class":501},[462,1984,502],{"class":501},[462,1986,1134],{"class":583},[462,1988,587],{"class":501},[462,1990,1139],{"class":873},[462,1992,509],{"class":501},[462,1994,1995],{"class":583}," backoff",[462,1997,587],{"class":501},[462,1999,521],{"class":501},[462,2001,2002],{"class":524},"exponential",[462,2004,601],{"class":501},[462,2006,604],{"class":501},[462,2008,2009,2012,2014,2017],{"class":493,"line":638},[462,2010,2011],{"class":583},"  maxBufferSize",[462,2013,587],{"class":501},[462,2015,2016],{"class":873}," 500",[462,2018,1064],{"class":501},[462,2020,2021,2024,2026,2028,2031,2033,2035],{"class":493,"line":915},[462,2022,2023],{"class":571},"  onDropped",[462,2025,587],{"class":501},[462,2027,1576],{"class":501},[462,2029,2030],{"class":1579},"events",[462,2032,1240],{"class":501},[462,2034,1590],{"class":561},[462,2036,1427],{"class":501},[462,2038,2039,2041,2043,2046,2048,2051,2054,2057,2059,2061,2064,2066,2069,2071],{"class":493,"line":1144},[462,2040,1625],{"class":505},[462,2042,644],{"class":501},[462,2044,2045],{"class":571},"warn",[462,2047,574],{"class":583},[462,2049,2050],{"class":501},"`",[462,2052,2053],{"class":524},"Dropped ",[462,2055,2056],{"class":501},"${",[462,2058,2030],{"class":505},[462,2060,644],{"class":501},[462,2062,2063],{"class":505},"length",[462,2065,610],{"class":501},[462,2067,2068],{"class":524}," client events",[462,2070,2050],{"class":501},[462,2072,613],{"class":583},[462,2074,2075],{"class":493,"line":1151},[462,2076,1487],{"class":501},[462,2078,2079,2081],{"class":493,"line":1156},[462,2080,610],{"class":501},[462,2082,613],{"class":505},[462,2084,2086],{"class":493,"line":2085},14,[462,2087,555],{"emptyLinePlaceholder":554},[462,2089,2091,2093,2095,2097,2099,2101,2103,2105],{"class":493,"line":2090},15,[462,2092,562],{"class":561},[462,2094,565],{"class":505},[462,2096,568],{"class":501},[462,2098,1165],{"class":571},[462,2100,574],{"class":505},[462,2102,1841],{"class":571},[462,2104,574],{"class":505},[462,2106,577],{"class":501},[462,2108,2110,2112,2114,2116,2118,2120],{"class":493,"line":2109},16,[462,2111,1053],{"class":583},[462,2113,587],{"class":501},[462,2115,521],{"class":501},[462,2117,448],{"class":524},[462,2119,601],{"class":501},[462,2121,1064],{"class":501},[462,2123,2125,2128,2130,2133],{"class":493,"line":2124},17,[462,2126,2127],{"class":583},"  timeout",[462,2129,587],{"class":501},[462,2131,2132],{"class":873}," 3000",[462,2134,1064],{"class":501},[462,2136,2138,2140],{"class":493,"line":2137},18,[462,2139,610],{"class":501},[462,2141,1656],{"class":505},[462,2143,2145],{"class":493,"line":2144},19,[462,2146,555],{"emptyLinePlaceholder":554},[462,2148,2150,2152,2154,2156,2158,2160],{"class":493,"line":2149},20,[462,2151,619],{"class":571},[462,2153,574],{"class":505},[462,2155,624],{"class":501},[462,2157,565],{"class":505},[462,2159,610],{"class":501},[462,2161,613],{"class":505},[462,2163,2165],{"class":493,"line":2164},21,[462,2166,555],{"emptyLinePlaceholder":554},[462,2168,2170,2172,2174,2176,2178,2180,2182,2184,2186,2189,2191,2193],{"class":493,"line":2169},22,[462,2171,641],{"class":505},[462,2173,644],{"class":501},[462,2175,647],{"class":571},[462,2177,574],{"class":505},[462,2179,624],{"class":501},[462,2181,654],{"class":583},[462,2183,587],{"class":501},[462,2185,521],{"class":501},[462,2187,2188],{"class":524},"app_init",[462,2190,601],{"class":501},[462,2192,515],{"class":501},[462,2194,613],{"class":505},[462,2196,2198],{"class":493,"line":2197},23,[462,2199,555],{"emptyLinePlaceholder":554},[462,2201,2203],{"class":493,"line":2202},24,[462,2204,2206],{"class":2205},"sHwdD","\u002F\u002F Flush on page unload\n",[462,2208,2210,2213,2215,2218,2220,2222,2225,2227,2229,2232,2234,2237,2239,2242],{"class":493,"line":2209},25,[462,2211,2212],{"class":505},"window",[462,2214,644],{"class":501},[462,2216,2217],{"class":571},"addEventListener",[462,2219,574],{"class":505},[462,2221,601],{"class":501},[462,2223,2224],{"class":524},"beforeunload",[462,2226,601],{"class":501},[462,2228,509],{"class":501},[462,2230,2231],{"class":501}," ()",[462,2233,1590],{"class":561},[462,2235,2236],{"class":505}," drain",[462,2238,644],{"class":501},[462,2240,2241],{"class":571},"flush",[462,2243,2244],{"class":505},"())\n",[399,2246,2248,2249,2254],{"color":401,"icon":2247},"i-lucide-arrow-right","See the full ",[446,2250,2253],{"href":2251,"rel":2252},"https:\u002F\u002Fgithub.com\u002Fhugorcd\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Fbrowser",[450],"browser example"," for a working Hono server + browser page that demonstrates the complete flow end to end.",[399,2256,2257,2258,2261],{"color":401,"icon":78},"See the ",[446,2259,2260],{"href":213},"Next.js guide"," for a working implementation.",[478,2263,2265],{"id":2264},"next-steps","Next Steps",[433,2267,2268,2274,2279],{},[436,2269,2270,2273],{},[446,2271,2272],{"href":291},"Adapters Overview"," - Available built-in adapters",[436,2275,2276,2278],{},[446,2277,354],{"href":355}," - Batching, retry, and buffer overflow handling",[436,2280,2281,2283],{},[446,2282,364],{"href":365}," - Build your own drain function",[2285,2286,2287],"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 .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":488,"searchDepth":531,"depth":531,"links":2289},[2290,2291,2292,2296,2300,2301,2302,2306,2307],{"id":480,"depth":531,"text":20},{"id":685,"depth":531,"text":686},{"id":744,"depth":531,"text":745,"children":2293},[2294,2295],{"id":749,"depth":551,"text":752},{"id":957,"depth":551,"text":960},{"id":1171,"depth":531,"text":1172,"children":2297},[2298,2299],{"id":1175,"depth":551,"text":1178},{"id":1304,"depth":551,"text":1307},{"id":1373,"depth":531,"text":1374},{"id":1395,"depth":531,"text":1396},{"id":1523,"depth":531,"text":1524,"children":2303},[2304,2305],{"id":1533,"depth":551,"text":237},{"id":1687,"depth":551,"text":242},{"id":1834,"depth":531,"text":1835},{"id":2264,"depth":531,"text":2265},"Framework-agnostic HTTP log transport for sending client-side logs to your server via fetch or sendBeacon. Works in the browser or any environment with fetch. Use the `evlog\u002Fhttp` entry point.","md",[2311,2314],{"label":2272,"icon":2312,"to":291,"color":401,"variant":2313},"i-custom-plug","subtle",{"label":354,"icon":357,"to":355,"color":401,"variant":2313},{},{"title":359,"icon":362},{"title":390,"description":2308},"2DU1KAmq-ibPl2rFfDf3SpVjzShnZp2X2OUXYAoxWlo",[2320,2322],{"title":354,"path":355,"stem":356,"description":2321,"icon":357,"children":-1},"Batch events, retry on failure, and protect against buffer overflow with the shared drain pipeline. Supports fan-out to multiple adapters.",{"title":364,"path":365,"stem":366,"description":2323,"icon":78,"children":-1},"Build your own adapter to send logs to any destination using defineHttpDrain — config resolution, retries, timeouts, and error handling are handled for you.",1777924951457]