[{"data":1,"prerenderedAt":1544},["ShallowReactive",2],{"navigation_docs":3,"-adapters-better-stack":258,"-adapters-better-stack-surround":1539},[4,30,115,174,228,244],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24],{"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",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Frameworks","\u002Fframeworks","2.frameworks",[35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Fframeworks\u002Foverview","2.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":41,"path":42,"stem":43,"icon":44},"Nuxt","\u002Fframeworks\u002Fnuxt","2.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":46,"path":47,"stem":48,"icon":49},"Next.js","\u002Fframeworks\u002Fnextjs","2.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":51,"path":52,"stem":53,"icon":54},"SvelteKit","\u002Fframeworks\u002Fsveltekit","2.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":56,"path":57,"stem":58,"icon":59},"Nitro","\u002Fframeworks\u002Fnitro","2.frameworks\u002F04.nitro","i-custom-nitro",{"title":61,"path":62,"stem":63,"icon":64},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","2.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":66,"path":67,"stem":68,"icon":69},"NestJS","\u002Fframeworks\u002Fnestjs","2.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":71,"path":72,"stem":73,"icon":74},"Express","\u002Fframeworks\u002Fexpress","2.frameworks\u002F07.express","i-simple-icons-express",{"title":76,"path":77,"stem":78,"icon":79},"Hono","\u002Fframeworks\u002Fhono","2.frameworks\u002F08.hono","i-simple-icons-hono",{"title":81,"path":82,"stem":83,"icon":84},"Fastify","\u002Fframeworks\u002Ffastify","2.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":86,"path":87,"stem":88,"icon":89},"Elysia","\u002Fframeworks\u002Felysia","2.frameworks\u002F10.elysia","i-custom-elysia",{"title":91,"path":92,"stem":93,"icon":94},"React Router","\u002Fframeworks\u002Freact-router","2.frameworks\u002F11.react-router","i-simple-icons-reactrouter",{"title":96,"path":97,"stem":98,"icon":99},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","2.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":101,"path":102,"stem":103,"icon":104},"Standalone","\u002Fframeworks\u002Fstandalone","2.frameworks\u002F13.standalone","i-simple-icons-typescript",{"title":106,"path":107,"stem":108,"icon":109},"Astro","\u002Fframeworks\u002Fastro","2.frameworks\u002F14.astro","i-simple-icons-astro",{"title":111,"path":112,"stem":113,"icon":114},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","2.frameworks\u002F15.custom-integration","i-lucide-puzzle",{"title":116,"path":117,"stem":118,"children":119,"page":29},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[120,125,130,135,140,145,150,154,159,164,169],{"title":121,"path":122,"stem":123,"icon":124},"Request Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":126,"path":127,"stem":128,"icon":129},"Wide Events","\u002Fcore-concepts\u002Fwide-events","3.core-concepts\u002F1.wide-events","i-lucide-layers",{"title":131,"path":132,"stem":133,"icon":134},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F10.vite-plugin","i-custom-vite",{"title":136,"path":137,"stem":138,"icon":139},"AI SDK Integration","\u002Fcore-concepts\u002Fai-sdk","3.core-concepts\u002F11.ai-sdk","i-lucide-scan-eye",{"title":141,"path":142,"stem":143,"icon":144},"Structured Errors","\u002Fcore-concepts\u002Fstructured-errors","3.core-concepts\u002F2.structured-errors","i-lucide-shield-alert",{"title":146,"path":147,"stem":148,"icon":149},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F3.best-practices","i-lucide-shield-check",{"title":151,"path":152,"stem":153,"icon":104},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F4.typed-fields",{"title":155,"path":156,"stem":157,"icon":158},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F5.sampling","i-lucide-filter",{"title":160,"path":161,"stem":162,"icon":163},"Client Logging","\u002Fcore-concepts\u002Fclient-logging","3.core-concepts\u002F6.client-logging","i-lucide-monitor",{"title":165,"path":166,"stem":167,"icon":168},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F7.configuration","i-lucide-settings",{"title":170,"path":171,"stem":172,"icon":173},"Performance","\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F8.performance","i-lucide-gauge",{"title":175,"path":176,"stem":177,"children":178,"page":29},"Adapters","\u002Fadapters","4.adapters",[179,183,188,193,198,203,208,213,218,223],{"title":36,"path":180,"stem":181,"icon":182},"\u002Fadapters\u002Foverview","4.adapters\u002F1.overview","i-custom-plug",{"title":184,"path":185,"stem":186,"icon":187},"Browser","\u002Fadapters\u002Fbrowser","4.adapters\u002F10.browser","i-lucide-globe",{"title":189,"path":190,"stem":191,"icon":192},"Axiom","\u002Fadapters\u002Faxiom","4.adapters\u002F2.axiom","i-custom-axiom",{"title":194,"path":195,"stem":196,"icon":197},"OTLP","\u002Fadapters\u002Fotlp","4.adapters\u002F3.otlp","i-simple-icons-opentelemetry",{"title":199,"path":200,"stem":201,"icon":202},"PostHog","\u002Fadapters\u002Fposthog","4.adapters\u002F4.posthog","i-simple-icons-posthog",{"title":204,"path":205,"stem":206,"icon":207},"Sentry","\u002Fadapters\u002Fsentry","4.adapters\u002F5.sentry","i-simple-icons-sentry",{"title":209,"path":210,"stem":211,"icon":212},"Better Stack","\u002Fadapters\u002Fbetter-stack","4.adapters\u002F6.better-stack","i-simple-icons-betterstack",{"title":214,"path":215,"stem":216,"icon":217},"File System","\u002Fadapters\u002Ffs","4.adapters\u002F7.fs","i-lucide-hard-drive",{"title":219,"path":220,"stem":221,"icon":222},"Custom Adapters","\u002Fadapters\u002Fcustom","4.adapters\u002F8.custom","i-lucide-code",{"title":224,"path":225,"stem":226,"icon":227},"Pipeline","\u002Fadapters\u002Fpipeline","4.adapters\u002F9.pipeline","i-lucide-workflow",{"title":229,"path":230,"stem":231,"children":232,"page":29},"Enrichers","\u002Fenrichers","5.enrichers",[233,236,240],{"title":36,"path":234,"stem":235,"icon":28},"\u002Fenrichers\u002Foverview","5.enrichers\u002F1.overview",{"title":237,"path":238,"stem":239,"icon":114},"Built-in","\u002Fenrichers\u002Fbuilt-in","5.enrichers\u002F2.built-in",{"title":241,"path":242,"stem":243,"icon":222},"Custom","\u002Fenrichers\u002Fcustom","5.enrichers\u002F3.custom",{"title":245,"path":246,"stem":247,"children":248,"page":29},"NuxtHub","\u002Fnuxthub","6.nuxthub",[249,253],{"title":36,"path":250,"stem":251,"icon":252},"\u002Fnuxthub\u002Foverview","6.nuxthub\u002F1.overview","i-lucide-database",{"title":254,"path":255,"stem":256,"icon":257},"Retention","\u002Fnuxthub\u002Fretention","6.nuxthub\u002F2.retention","i-lucide-clock",{"id":259,"title":260,"body":261,"description":1524,"extension":1525,"links":1526,"meta":1535,"navigation":1536,"path":210,"seo":1537,"stem":211,"__hash__":1538},"docs\u002F4.adapters\u002F6.better-stack.md","Better Stack Adapter",{"type":262,"value":263,"toc":1501},"minimark",[264,274,356,360,363,400,403,408,433,437,456,460,902,905,908,911,945,949,1001,1005,1012,1080,1084,1087,1144,1148,1223,1227,1233,1256,1259,1263,1266,1306,1310,1314,1322,1325,1329,1335,1339,1342,1346,1349,1474,1478,1497],[265,266,267,273],"p",{},[268,269,209],"a",{"href":270,"rel":271},"https:\u002F\u002Fbetterstack.com",[272],"nofollow"," is a DX-first log management platform with powerful search, alerting, and dashboards. The evlog Better Stack adapter sends your wide events to the Better Stack HTTP ingestion API.",[275,276,277],"code-collapse",{},[278,279,285],"pre",{"className":280,"code":281,"filename":282,"language":283,"meta":284,"style":284},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Add the Better Stack drain adapter to send evlog wide events to Better Stack.\n\n1. Identify which framework I'm using and follow its evlog integration pattern\n2. Install evlog if not already installed\n3. Import createBetterStackDrain from 'evlog\u002Fbetter-stack'\n4. Wire createBetterStackDrain() into my framework's drain configuration\n5. Set BETTER_STACK_SOURCE_TOKEN environment variable\n6. Test by triggering a request and checking the Better Stack logs dashboard\n\nAdapter docs: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fbetter-stack\nFramework setup: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\n","Prompt","txt","",[286,287,288,296,303,309,315,321,327,333,339,344,350],"code",{"__ignoreMap":284},[289,290,293],"span",{"class":291,"line":292},"line",1,[289,294,295],{},"Add the Better Stack drain adapter to send evlog wide events to Better Stack.\n",[289,297,299],{"class":291,"line":298},2,[289,300,302],{"emptyLinePlaceholder":301},true,"\n",[289,304,306],{"class":291,"line":305},3,[289,307,308],{},"1. Identify which framework I'm using and follow its evlog integration pattern\n",[289,310,312],{"class":291,"line":311},4,[289,313,314],{},"2. Install evlog if not already installed\n",[289,316,318],{"class":291,"line":317},5,[289,319,320],{},"3. Import createBetterStackDrain from 'evlog\u002Fbetter-stack'\n",[289,322,324],{"class":291,"line":323},6,[289,325,326],{},"4. Wire createBetterStackDrain() into my framework's drain configuration\n",[289,328,330],{"class":291,"line":329},7,[289,331,332],{},"5. Set BETTER_STACK_SOURCE_TOKEN environment variable\n",[289,334,336],{"class":291,"line":335},8,[289,337,338],{},"6. Test by triggering a request and checking the Better Stack logs dashboard\n",[289,340,342],{"class":291,"line":341},9,[289,343,302],{"emptyLinePlaceholder":301},[289,345,347],{"class":291,"line":346},10,[289,348,349],{},"Adapter docs: https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fbetter-stack\n",[289,351,353],{"class":291,"line":352},11,[289,354,355],{},"Framework setup: https:\u002F\u002Fwww.evlog.dev\u002Fframeworks\n",[357,358,15],"h2",{"id":359},"installation",[265,361,362],{},"The Better Stack adapter comes bundled with evlog:",[278,364,368],{"className":365,"code":366,"language":367,"meta":284,"style":284},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n","typescript",[286,369,370],{"__ignoreMap":284},[289,371,372,376,380,384,387,390,393,397],{"class":291,"line":292},[289,373,375],{"class":374},"s7zQu","import",[289,377,379],{"class":378},"sMK4o"," {",[289,381,383],{"class":382},"sTEyZ"," createBetterStackDrain",[289,385,386],{"class":378}," }",[289,388,389],{"class":374}," from",[289,391,392],{"class":378}," '",[289,394,396],{"class":395},"sfazB","evlog\u002Fbetter-stack",[289,398,399],{"class":378},"'\n",[357,401,20],{"id":402},"quick-start",[404,405,407],"h3",{"id":406},"_1-get-your-source-token","1. Get your source token",[409,410,411,419,427],"ol",{},[412,413,414,415],"li",{},"Create a ",[268,416,418],{"href":270,"rel":417},[272],"Better Stack account",[412,420,421,422,426],{},"Go to ",[423,424,425],"strong",{},"Telemetry > Sources"," and create a new source",[412,428,429,430],{},"Copy the ",[423,431,432],{},"Source Token",[404,434,436],{"id":435},"_2-set-environment-variables","2. Set environment variables",[278,438,443],{"className":439,"code":440,"filename":441,"language":442,"meta":284,"style":284},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","BETTER_STACK_SOURCE_TOKEN=your-source-token-here\n",".env","bash",[286,444,445],{"__ignoreMap":284},[289,446,447,450,453],{"class":291,"line":292},[289,448,449],{"class":382},"BETTER_STACK_SOURCE_TOKEN",[289,451,452],{"class":378},"=",[289,454,455],{"class":395},"your-source-token-here\n",[404,457,459],{"id":458},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[461,462,463,571,634,688,747,801,854],"code-group",{},[278,464,467],{"className":365,"code":465,"filename":466,"language":367,"meta":284,"style":284},"\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createBetterStackDrain())\n})\n","Nuxt \u002F Nitro",[286,468,469,475,493,497,528,563],{"__ignoreMap":284},[289,470,471],{"class":291,"line":292},[289,472,474],{"class":473},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[289,476,477,479,481,483,485,487,489,491],{"class":291,"line":298},[289,478,375],{"class":374},[289,480,379],{"class":378},[289,482,383],{"class":382},[289,484,386],{"class":378},[289,486,389],{"class":374},[289,488,392],{"class":378},[289,490,396],{"class":395},[289,492,399],{"class":378},[289,494,495],{"class":291,"line":305},[289,496,302],{"emptyLinePlaceholder":301},[289,498,499,502,505,509,512,514,518,521,525],{"class":291,"line":311},[289,500,501],{"class":374},"export",[289,503,504],{"class":374}," default",[289,506,508],{"class":507},"s2Zo4"," defineNitroPlugin",[289,510,511],{"class":382},"(",[289,513,511],{"class":378},[289,515,517],{"class":516},"sHdIc","nitroApp",[289,519,520],{"class":378},")",[289,522,524],{"class":523},"spNyl"," =>",[289,526,527],{"class":378}," {\n",[289,529,530,533,536,539,541,544,547,550,553,555,558,560],{"class":291,"line":317},[289,531,532],{"class":382},"  nitroApp",[289,534,535],{"class":378},".",[289,537,538],{"class":382},"hooks",[289,540,535],{"class":378},[289,542,543],{"class":507},"hook",[289,545,511],{"class":546},"swJcz",[289,548,549],{"class":378},"'",[289,551,552],{"class":395},"evlog:drain",[289,554,549],{"class":378},[289,556,557],{"class":378},",",[289,559,383],{"class":507},[289,561,562],{"class":546},"())\n",[289,564,565,568],{"class":291,"line":323},[289,566,567],{"class":378},"}",[289,569,570],{"class":382},")\n",[278,572,574],{"className":365,"code":573,"filename":76,"language":367,"meta":284,"style":284},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\napp.use(evlog({ drain: createBetterStackDrain() }))\n",[286,575,576,594,598],{"__ignoreMap":284},[289,577,578,580,582,584,586,588,590,592],{"class":291,"line":292},[289,579,375],{"class":374},[289,581,379],{"class":378},[289,583,383],{"class":382},[289,585,386],{"class":378},[289,587,389],{"class":374},[289,589,392],{"class":378},[289,591,396],{"class":395},[289,593,399],{"class":378},[289,595,596],{"class":291,"line":298},[289,597,302],{"emptyLinePlaceholder":301},[289,599,600,603,605,608,610,613,615,618,621,624,626,629,631],{"class":291,"line":305},[289,601,602],{"class":382},"app",[289,604,535],{"class":378},[289,606,607],{"class":507},"use",[289,609,511],{"class":382},[289,611,612],{"class":507},"evlog",[289,614,511],{"class":382},[289,616,617],{"class":378},"{",[289,619,620],{"class":546}," drain",[289,622,623],{"class":378},":",[289,625,383],{"class":507},[289,627,628],{"class":382},"() ",[289,630,567],{"class":378},[289,632,633],{"class":382},"))\n",[278,635,636],{"className":365,"code":573,"filename":71,"language":367,"meta":284,"style":284},[286,637,638,656,660],{"__ignoreMap":284},[289,639,640,642,644,646,648,650,652,654],{"class":291,"line":292},[289,641,375],{"class":374},[289,643,379],{"class":378},[289,645,383],{"class":382},[289,647,386],{"class":378},[289,649,389],{"class":374},[289,651,392],{"class":378},[289,653,396],{"class":395},[289,655,399],{"class":378},[289,657,658],{"class":291,"line":298},[289,659,302],{"emptyLinePlaceholder":301},[289,661,662,664,666,668,670,672,674,676,678,680,682,684,686],{"class":291,"line":305},[289,663,602],{"class":382},[289,665,535],{"class":378},[289,667,607],{"class":507},[289,669,511],{"class":382},[289,671,612],{"class":507},[289,673,511],{"class":382},[289,675,617],{"class":378},[289,677,620],{"class":546},[289,679,623],{"class":378},[289,681,383],{"class":507},[289,683,628],{"class":382},[289,685,567],{"class":378},[289,687,633],{"class":382},[278,689,691],{"className":365,"code":690,"filename":81,"language":367,"meta":284,"style":284},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nawait app.register(evlog, { drain: createBetterStackDrain() })\n",[286,692,693,711,715],{"__ignoreMap":284},[289,694,695,697,699,701,703,705,707,709],{"class":291,"line":292},[289,696,375],{"class":374},[289,698,379],{"class":378},[289,700,383],{"class":382},[289,702,386],{"class":378},[289,704,389],{"class":374},[289,706,392],{"class":378},[289,708,396],{"class":395},[289,710,399],{"class":378},[289,712,713],{"class":291,"line":298},[289,714,302],{"emptyLinePlaceholder":301},[289,716,717,720,723,725,728,731,733,735,737,739,741,743,745],{"class":291,"line":305},[289,718,719],{"class":374},"await",[289,721,722],{"class":382}," app",[289,724,535],{"class":378},[289,726,727],{"class":507},"register",[289,729,730],{"class":382},"(evlog",[289,732,557],{"class":378},[289,734,379],{"class":378},[289,736,620],{"class":546},[289,738,623],{"class":378},[289,740,383],{"class":507},[289,742,628],{"class":382},[289,744,567],{"class":378},[289,746,570],{"class":382},[278,748,749],{"className":365,"code":573,"filename":86,"language":367,"meta":284,"style":284},[286,750,751,769,773],{"__ignoreMap":284},[289,752,753,755,757,759,761,763,765,767],{"class":291,"line":292},[289,754,375],{"class":374},[289,756,379],{"class":378},[289,758,383],{"class":382},[289,760,386],{"class":378},[289,762,389],{"class":374},[289,764,392],{"class":378},[289,766,396],{"class":395},[289,768,399],{"class":378},[289,770,771],{"class":291,"line":298},[289,772,302],{"emptyLinePlaceholder":301},[289,774,775,777,779,781,783,785,787,789,791,793,795,797,799],{"class":291,"line":305},[289,776,602],{"class":382},[289,778,535],{"class":378},[289,780,607],{"class":507},[289,782,511],{"class":382},[289,784,612],{"class":507},[289,786,511],{"class":382},[289,788,617],{"class":378},[289,790,620],{"class":546},[289,792,623],{"class":378},[289,794,383],{"class":507},[289,796,628],{"class":382},[289,798,567],{"class":378},[289,800,633],{"class":382},[278,802,804],{"className":365,"code":803,"filename":66,"language":367,"meta":284,"style":284},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\nEvlogModule.forRoot({ drain: createBetterStackDrain() })\n",[286,805,806,824,828],{"__ignoreMap":284},[289,807,808,810,812,814,816,818,820,822],{"class":291,"line":292},[289,809,375],{"class":374},[289,811,379],{"class":378},[289,813,383],{"class":382},[289,815,386],{"class":378},[289,817,389],{"class":374},[289,819,392],{"class":378},[289,821,396],{"class":395},[289,823,399],{"class":378},[289,825,826],{"class":291,"line":298},[289,827,302],{"emptyLinePlaceholder":301},[289,829,830,833,835,838,840,842,844,846,848,850,852],{"class":291,"line":305},[289,831,832],{"class":382},"EvlogModule",[289,834,535],{"class":378},[289,836,837],{"class":507},"forRoot",[289,839,511],{"class":382},[289,841,617],{"class":378},[289,843,620],{"class":546},[289,845,623],{"class":378},[289,847,383],{"class":507},[289,849,628],{"class":382},[289,851,567],{"class":378},[289,853,570],{"class":382},[278,855,857],{"className":365,"code":856,"filename":101,"language":367,"meta":284,"style":284},"import { createBetterStackDrain } from 'evlog\u002Fbetter-stack'\n\ninitLogger({ drain: createBetterStackDrain() })\n",[286,858,859,877,881],{"__ignoreMap":284},[289,860,861,863,865,867,869,871,873,875],{"class":291,"line":292},[289,862,375],{"class":374},[289,864,379],{"class":378},[289,866,383],{"class":382},[289,868,386],{"class":378},[289,870,389],{"class":374},[289,872,392],{"class":378},[289,874,396],{"class":395},[289,876,399],{"class":378},[289,878,879],{"class":291,"line":298},[289,880,302],{"emptyLinePlaceholder":301},[289,882,883,886,888,890,892,894,896,898,900],{"class":291,"line":305},[289,884,885],{"class":507},"initLogger",[289,887,511],{"class":382},[289,889,617],{"class":378},[289,891,620],{"class":546},[289,893,623],{"class":378},[289,895,383],{"class":507},[289,897,628],{"class":382},[289,899,567],{"class":378},[289,901,570],{"class":382},[265,903,904],{},"That's it! Your logs will now appear in Better Stack.",[357,906,165],{"id":907},"configuration",[265,909,910],{},"The adapter reads configuration from multiple sources (highest priority first):",[409,912,913,922,932],{},[412,914,915,918,919],{},[423,916,917],{},"Overrides"," passed to ",[286,920,921],{},"createBetterStackDrain()",[412,923,924,927,928,931],{},[423,925,926],{},"Runtime config"," at ",[286,929,930],{},"runtimeConfig.betterStack"," (Nuxt\u002FNitro only)",[412,933,934,937,938,941,942,520],{},[423,935,936],{},"Environment variables"," (",[286,939,940],{},"BETTER_STACK_*"," or ",[286,943,944],{},"NUXT_BETTER_STACK_*",[404,946,948],{"id":947},"environment-variables","Environment Variables",[950,951,952,968],"table",{},[953,954,955],"thead",{},[956,957,958,962,965],"tr",{},[959,960,961],"th",{},"Variable",[959,963,964],{},"Nuxt alias",[959,966,967],{},"Description",[969,970,971,986],"tbody",{},[956,972,973,978,983],{},[974,975,976],"td",{},[286,977,449],{},[974,979,980],{},[286,981,982],{},"NUXT_BETTER_STACK_SOURCE_TOKEN",[974,984,985],{},"Better Stack source token (required)",[956,987,988,993,998],{},[974,989,990],{},[286,991,992],{},"BETTER_STACK_ENDPOINT",[974,994,995],{},[286,996,997],{},"NUXT_BETTER_STACK_ENDPOINT",[974,999,1000],{},"Custom ingestion endpoint",[404,1002,1004],{"id":1003},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[265,1006,1007,1008,1011],{},"Configure via ",[286,1009,1010],{},"nuxt.config.ts"," for type-safe configuration:",[278,1013,1015],{"className":365,"code":1014,"filename":1010,"language":367,"meta":284,"style":284},"export default defineNuxtConfig({\n  runtimeConfig: {\n    betterStack: {\n      sourceToken: '', \u002F\u002F Set via NUXT_BETTER_STACK_SOURCE_TOKEN\n    },\n  },\n})\n",[286,1016,1017,1031,1040,1049,1064,1069,1074],{"__ignoreMap":284},[289,1018,1019,1021,1023,1026,1028],{"class":291,"line":292},[289,1020,501],{"class":374},[289,1022,504],{"class":374},[289,1024,1025],{"class":507}," defineNuxtConfig",[289,1027,511],{"class":382},[289,1029,1030],{"class":378},"{\n",[289,1032,1033,1036,1038],{"class":291,"line":298},[289,1034,1035],{"class":546},"  runtimeConfig",[289,1037,623],{"class":378},[289,1039,527],{"class":378},[289,1041,1042,1045,1047],{"class":291,"line":305},[289,1043,1044],{"class":546},"    betterStack",[289,1046,623],{"class":378},[289,1048,527],{"class":378},[289,1050,1051,1054,1056,1059,1061],{"class":291,"line":311},[289,1052,1053],{"class":546},"      sourceToken",[289,1055,623],{"class":378},[289,1057,1058],{"class":378}," ''",[289,1060,557],{"class":378},[289,1062,1063],{"class":473}," \u002F\u002F Set via NUXT_BETTER_STACK_SOURCE_TOKEN\n",[289,1065,1066],{"class":291,"line":317},[289,1067,1068],{"class":378},"    },\n",[289,1070,1071],{"class":291,"line":323},[289,1072,1073],{"class":378},"  },\n",[289,1075,1076,1078],{"class":291,"line":329},[289,1077,567],{"class":378},[289,1079,570],{"class":382},[404,1081,1083],{"id":1082},"override-options","Override Options",[265,1085,1086],{},"Pass options directly to override any configuration:",[278,1088,1090],{"className":365,"code":1089,"language":367,"meta":284,"style":284},"const drain = createBetterStackDrain({\n  sourceToken: 'my-token',\n  timeout: 10000,\n})\n",[286,1091,1092,1108,1125,1138],{"__ignoreMap":284},[289,1093,1094,1097,1100,1102,1104,1106],{"class":291,"line":292},[289,1095,1096],{"class":523},"const",[289,1098,1099],{"class":382}," drain ",[289,1101,452],{"class":378},[289,1103,383],{"class":507},[289,1105,511],{"class":382},[289,1107,1030],{"class":378},[289,1109,1110,1113,1115,1117,1120,1122],{"class":291,"line":298},[289,1111,1112],{"class":546},"  sourceToken",[289,1114,623],{"class":378},[289,1116,392],{"class":378},[289,1118,1119],{"class":395},"my-token",[289,1121,549],{"class":378},[289,1123,1124],{"class":378},",\n",[289,1126,1127,1130,1132,1136],{"class":291,"line":305},[289,1128,1129],{"class":546},"  timeout",[289,1131,623],{"class":378},[289,1133,1135],{"class":1134},"sbssI"," 10000",[289,1137,1124],{"class":378},[289,1139,1140,1142],{"class":291,"line":311},[289,1141,567],{"class":378},[289,1143,570],{"class":382},[404,1145,1147],{"id":1146},"full-configuration-reference","Full Configuration Reference",[950,1149,1150,1165],{},[953,1151,1152],{},[956,1153,1154,1157,1160,1163],{},[959,1155,1156],{},"Option",[959,1158,1159],{},"Type",[959,1161,1162],{},"Default",[959,1164,967],{},[969,1166,1167,1184,1203],{},[956,1168,1169,1174,1179,1182],{},[974,1170,1171],{},[286,1172,1173],{},"sourceToken",[974,1175,1176],{},[286,1177,1178],{},"string",[974,1180,1181],{},"-",[974,1183,985],{},[956,1185,1186,1191,1195,1200],{},[974,1187,1188],{},[286,1189,1190],{},"endpoint",[974,1192,1193],{},[286,1194,1178],{},[974,1196,1197],{},[286,1198,1199],{},"https:\u002F\u002Fin.logs.betterstack.com",[974,1201,1202],{},"Ingestion endpoint",[956,1204,1205,1210,1215,1220],{},[974,1206,1207],{},[286,1208,1209],{},"timeout",[974,1211,1212],{},[286,1213,1214],{},"number",[974,1216,1217],{},[286,1218,1219],{},"5000",[974,1221,1222],{},"Request timeout in milliseconds",[357,1224,1226],{"id":1225},"log-transformation","Log Transformation",[265,1228,1229,1230,623],{},"evlog wide events are transformed using ",[286,1231,1232],{},"toBetterStackEvent()",[1234,1235,1236,1250],"ul",{},[412,1237,1238,1241,1242,1245,1246,1249],{},[423,1239,1240],{},"Timestamp",": ",[286,1243,1244],{},"timestamp"," is mapped to ",[286,1247,1248],{},"dt"," (Better Stack's expected ISO-8601 timestamp field)",[412,1251,1252,1255],{},[423,1253,1254],{},"All other fields",": Spread as-is into the event body",[265,1257,1258],{},"Better Stack accepts arbitrary JSON fields, so all your wide event context (level, service, action, user data, etc.) is automatically searchable.",[357,1260,1262],{"id":1261},"querying-logs-in-better-stack","Querying Logs in Better Stack",[265,1264,1265],{},"Better Stack provides a powerful log search interface:",[1234,1267,1268,1274,1280,1294,1300],{},[412,1269,1270,1273],{},[423,1271,1272],{},"Live tail",": Stream logs in real time",[412,1275,1276,1279],{},[423,1277,1278],{},"Full-text search",": Search across all fields",[412,1281,1282,1285,1286,1289,1290,1293],{},[423,1283,1284],{},"Structured queries",": Filter by ",[286,1287,1288],{},"level:error",", ",[286,1291,1292],{},"service:my-app",", or any wide event field",[412,1295,1296,1299],{},[423,1297,1298],{},"Dashboards",": Create custom dashboards from your wide event data",[412,1301,1302,1305],{},[423,1303,1304],{},"Alerts",": Set up alerts based on log patterns or thresholds",[357,1307,1309],{"id":1308},"troubleshooting","Troubleshooting",[404,1311,1313],{"id":1312},"missing-source-token-error","Missing source token error",[278,1315,1320],{"className":1316,"code":1318,"language":1319},[1317],"language-text","[evlog\u002Fbetter-stack] Missing source token. Set BETTER_STACK_SOURCE_TOKEN env var or pass to createBetterStackDrain()\n","text",[286,1321,1318],{"__ignoreMap":284},[265,1323,1324],{},"Make sure your environment variable is set and the server was restarted after adding it.",[404,1326,1328],{"id":1327},"_401-unauthorized","401 Unauthorized",[265,1330,1331,1332,1334],{},"Your source token may be invalid or revoked. Generate a new source token in ",[423,1333,425],{}," in the Better Stack dashboard.",[404,1336,1338],{"id":1337},"_403-forbidden","403 Forbidden",[265,1340,1341],{},"The source may be archived or deleted. Create a new source in Better Stack.",[357,1343,1345],{"id":1344},"direct-api-usage","Direct API Usage",[265,1347,1348],{},"For advanced use cases, you can use the lower-level functions:",[278,1350,1353],{"className":365,"code":1351,"filename":1352,"language":367,"meta":284,"style":284},"import { sendToBetterStack, sendBatchToBetterStack } from 'evlog\u002Fbetter-stack'\n\n\u002F\u002F Send a single event\nawait sendToBetterStack(event, {\n  sourceToken: process.env.BETTER_STACK_SOURCE_TOKEN!,\n})\n\n\u002F\u002F Send multiple events in one request\nawait sendBatchToBetterStack(events, {\n  sourceToken: process.env.BETTER_STACK_SOURCE_TOKEN!,\n})\n","server\u002Futils\u002Fbetter-stack.ts",[286,1354,1355,1379,1383,1388,1401,1422,1428,1432,1437,1450,1468],{"__ignoreMap":284},[289,1356,1357,1359,1361,1364,1366,1369,1371,1373,1375,1377],{"class":291,"line":292},[289,1358,375],{"class":374},[289,1360,379],{"class":378},[289,1362,1363],{"class":382}," sendToBetterStack",[289,1365,557],{"class":378},[289,1367,1368],{"class":382}," sendBatchToBetterStack",[289,1370,386],{"class":378},[289,1372,389],{"class":374},[289,1374,392],{"class":378},[289,1376,396],{"class":395},[289,1378,399],{"class":378},[289,1380,1381],{"class":291,"line":298},[289,1382,302],{"emptyLinePlaceholder":301},[289,1384,1385],{"class":291,"line":305},[289,1386,1387],{"class":473},"\u002F\u002F Send a single event\n",[289,1389,1390,1392,1394,1397,1399],{"class":291,"line":311},[289,1391,719],{"class":374},[289,1393,1363],{"class":507},[289,1395,1396],{"class":382},"(event",[289,1398,557],{"class":378},[289,1400,527],{"class":378},[289,1402,1403,1405,1407,1410,1412,1415,1417,1419],{"class":291,"line":317},[289,1404,1112],{"class":546},[289,1406,623],{"class":378},[289,1408,1409],{"class":382}," process",[289,1411,535],{"class":378},[289,1413,1414],{"class":382},"env",[289,1416,535],{"class":378},[289,1418,449],{"class":382},[289,1420,1421],{"class":378},"!,\n",[289,1423,1424,1426],{"class":291,"line":323},[289,1425,567],{"class":378},[289,1427,570],{"class":382},[289,1429,1430],{"class":291,"line":329},[289,1431,302],{"emptyLinePlaceholder":301},[289,1433,1434],{"class":291,"line":335},[289,1435,1436],{"class":473},"\u002F\u002F Send multiple events in one request\n",[289,1438,1439,1441,1443,1446,1448],{"class":291,"line":341},[289,1440,719],{"class":374},[289,1442,1368],{"class":507},[289,1444,1445],{"class":382},"(events",[289,1447,557],{"class":378},[289,1449,527],{"class":378},[289,1451,1452,1454,1456,1458,1460,1462,1464,1466],{"class":291,"line":346},[289,1453,1112],{"class":546},[289,1455,623],{"class":378},[289,1457,1409],{"class":382},[289,1459,535],{"class":378},[289,1461,1414],{"class":382},[289,1463,535],{"class":378},[289,1465,449],{"class":382},[289,1467,1421],{"class":378},[289,1469,1470,1472],{"class":291,"line":352},[289,1471,567],{"class":378},[289,1473,570],{"class":382},[357,1475,1477],{"id":1476},"next-steps","Next Steps",[1234,1479,1480,1486,1492],{},[412,1481,1482,1485],{},[268,1483,1484],{"href":190},"Axiom Adapter"," - Send logs to Axiom for querying and dashboards",[412,1487,1488,1491],{},[268,1489,1490],{"href":195},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[412,1493,1494,1496],{},[268,1495,219],{"href":220}," - Build your own adapter",[1498,1499,1500],"style",{},"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 .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 .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}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":284,"searchDepth":298,"depth":298,"links":1502},[1503,1504,1509,1515,1516,1517,1522,1523],{"id":359,"depth":298,"text":15},{"id":402,"depth":298,"text":20,"children":1505},[1506,1507,1508],{"id":406,"depth":305,"text":407},{"id":435,"depth":305,"text":436},{"id":458,"depth":305,"text":459},{"id":907,"depth":298,"text":165,"children":1510},[1511,1512,1513,1514],{"id":947,"depth":305,"text":948},{"id":1003,"depth":305,"text":1004},{"id":1082,"depth":305,"text":1083},{"id":1146,"depth":305,"text":1147},{"id":1225,"depth":298,"text":1226},{"id":1261,"depth":298,"text":1262},{"id":1308,"depth":298,"text":1309,"children":1518},[1519,1520,1521],{"id":1312,"depth":305,"text":1313},{"id":1327,"depth":305,"text":1328},{"id":1337,"depth":305,"text":1338},{"id":1344,"depth":298,"text":1345},{"id":1476,"depth":298,"text":1477},"Send wide events to Better Stack (formerly Logtail) for log management, alerting, and dashboards. Zero-config setup with environment variables.","md",[1527,1534],{"label":1528,"icon":1529,"to":1530,"target":1531,"color":1532,"variant":1533},"Better Stack Dashboard","i-lucide-external-link","https:\u002F\u002Flogs.betterstack.com","_blank","neutral","subtle",{"label":1484,"icon":192,"to":190,"color":1532,"variant":1533},{},{"title":209,"icon":212},{"title":260,"description":1524},"oZylWWV8ErmH0pSq_SbLuyyWARBbsYv13uw2UbHOBOk",[1540,1542],{"title":204,"path":205,"stem":206,"description":1541,"icon":207,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",{"title":214,"path":215,"stem":216,"description":1543,"icon":217,"children":-1},"Write wide events to the local file system as NDJSON for local debugging, AI agent integration, and production backup.",1774103713755]