[{"data":1,"prerenderedAt":1985},["ShallowReactive",2],{"navigation_docs":3,"-adapters-posthog":171,"-adapters-posthog-surround":1980},[4,30,55,105,122,136],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Core Concepts","/core-concepts","2.core-concepts",[35,40,45,50],{"title":36,"path":37,"stem":38,"icon":39},"Wide Events","/core-concepts/wide-events","2.core-concepts/1.wide-events","i-lucide-layers",{"title":41,"path":42,"stem":43,"icon":44},"Structured Errors","/core-concepts/structured-errors","2.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":46,"path":47,"stem":48,"icon":49},"Best Practices","/core-concepts/best-practices","2.core-concepts/3.best-practices","i-lucide-shield-check",{"title":51,"path":52,"stem":53,"icon":54},"Typed Fields","/core-concepts/typed-fields","2.core-concepts/4.typed-fields","i-simple-icons-typescript",{"title":56,"path":57,"stem":58,"children":59,"page":29},"Adapters","/adapters","3.adapters",[60,65,70,75,80,85,90,95,100],{"title":61,"path":62,"stem":63,"icon":64},"Overview","/adapters/overview","3.adapters/1.overview","i-custom-plug",{"title":66,"path":67,"stem":68,"icon":69},"Axiom","/adapters/axiom","3.adapters/2.axiom","i-custom-axiom",{"title":71,"path":72,"stem":73,"icon":74},"OTLP","/adapters/otlp","3.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":76,"path":77,"stem":78,"icon":79},"PostHog","/adapters/posthog","3.adapters/4.posthog","i-simple-icons-posthog",{"title":81,"path":82,"stem":83,"icon":84},"Sentry","/adapters/sentry","3.adapters/5.sentry","i-simple-icons-sentry",{"title":86,"path":87,"stem":88,"icon":89},"Better Stack","/adapters/better-stack","3.adapters/6.better-stack","i-simple-icons-betterstack",{"title":91,"path":92,"stem":93,"icon":94},"Custom Adapters","/adapters/custom","3.adapters/7.custom","i-lucide-code",{"title":96,"path":97,"stem":98,"icon":99},"Pipeline","/adapters/pipeline","3.adapters/8.pipeline","i-lucide-workflow",{"title":101,"path":102,"stem":103,"icon":104},"Browser","/adapters/browser","3.adapters/9.browser","i-lucide-globe",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Enrichers","/enrichers","4.enrichers",[110,113,118],{"title":61,"path":111,"stem":112,"icon":28},"/enrichers/overview","4.enrichers/1.overview",{"title":114,"path":115,"stem":116,"icon":117},"Built-in","/enrichers/built-in","4.enrichers/2.built-in","i-lucide-puzzle",{"title":119,"path":120,"stem":121,"icon":94},"Custom","/enrichers/custom","4.enrichers/3.custom",{"title":123,"path":124,"stem":125,"children":126,"page":29},"NuxtHub","/nuxthub","5.nuxthub",[127,131],{"title":61,"path":128,"stem":129,"icon":130},"/nuxthub/overview","5.nuxthub/1.overview","i-lucide-database",{"title":132,"path":133,"stem":134,"icon":135},"Retention","/nuxthub/retention","5.nuxthub/2.retention","i-lucide-clock",{"title":137,"path":138,"stem":139,"children":140,"page":29},"Examples","/examples","6.examples",[141,146,151,156,161,166],{"title":142,"path":143,"stem":144,"icon":145},"Next.js","/examples/nextjs","6.examples/1.nextjs","i-simple-icons-nextdotjs",{"title":147,"path":148,"stem":149,"icon":150},"TanStack Start","/examples/tanstack-start","6.examples/2.tanstack-start","i-custom-tanstack",{"title":152,"path":153,"stem":154,"icon":155},"Hono","/examples/hono","6.examples/3.hono","i-simple-icons-hono",{"title":157,"path":158,"stem":159,"icon":160},"Express","/examples/express","6.examples/4.express","i-simple-icons-express",{"title":162,"path":163,"stem":164,"icon":165},"Elysia","/examples/elysia","6.examples/5.elysia","i-custom-elysia",{"title":167,"path":168,"stem":169,"icon":170},"Fastify","/examples/fastify","6.examples/6.fastify","i-simple-icons-fastify",{"id":172,"title":173,"body":174,"description":1966,"extension":1967,"links":1968,"meta":1976,"navigation":1977,"path":77,"seo":1978,"stem":78,"__hash__":1979},"docs/3.adapters/4.posthog.md","PostHog Adapter",{"type":175,"value":176,"toc":1936},"minimark",[177,193,197,200,244,247,252,285,289,308,312,418,421,425,428,468,472,513,524,528,535,622,626,629,748,752,828,832,842,874,878,884,924,952,956,963,976,980,986,1106,1114,1118,1222,1226,1229,1317,1321,1327,1353,1357,1432,1435,1544,1548,1552,1560,1563,1567,1570,1590,1594,1600,1613,1617,1620,1740,1743,1904,1908,1932],[178,179,180,186,187,192],"p",{},[181,182,76],"a",{"href":183,"rel":184},"https://posthog.com",[185],"nofollow"," is an open-source product analytics platform. The evlog PostHog adapter sends your wide events to ",[181,188,191],{"href":189,"rel":190},"https://posthog.com/docs/logs",[185],"PostHog Logs"," via the standard OTLP format, giving you a dedicated log viewer with filtering, search, and tail mode — all using your existing PostHog API key.",[194,195,15],"h2",{"id":196},"installation",[178,198,199],{},"The PostHog adapter comes bundled with evlog:",[201,202,208],"pre",{"className":203,"code":204,"filename":205,"language":206,"meta":207,"style":207},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostHogDrain } from 'evlog/posthog'\n","server/plugins/evlog-drain.ts","typescript","",[209,210,211],"code",{"__ignoreMap":207},[212,213,216,220,224,228,231,234,237,241],"span",{"class":214,"line":215},"line",1,[212,217,219],{"class":218},"s7zQu","import",[212,221,223],{"class":222},"sMK4o"," {",[212,225,227],{"class":226},"sTEyZ"," createPostHogDrain",[212,229,230],{"class":222}," }",[212,232,233],{"class":218}," from",[212,235,236],{"class":222}," '",[212,238,240],{"class":239},"sfazB","evlog/posthog",[212,242,243],{"class":222},"'\n",[194,245,20],{"id":246},"quick-start",[248,249,251],"h3",{"id":250},"_1-get-your-posthog-project-api-key","1. Get your PostHog project API key",[253,254,255,264,278],"ol",{},[256,257,258,259],"li",{},"Log in to your ",[181,260,263],{"href":261,"rel":262},"https://app.posthog.com",[185],"PostHog dashboard",[256,265,266,267,271,272,271,275],{},"Go to ",[268,269,270],"strong",{},"Settings"," > ",[268,273,274],{},"Project",[268,276,277],{},"Project API Key",[256,279,280,281,284],{},"Copy the key (starts with ",[209,282,283],{},"phc_",")",[248,286,288],{"id":287},"_2-set-environment-variables","2. Set environment variables",[201,290,295],{"className":291,"code":292,"filename":293,"language":294,"meta":207,"style":207},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","NUXT_POSTHOG_API_KEY=phc_your-project-api-key\n",".env","bash",[209,296,297],{"__ignoreMap":207},[212,298,299,302,305],{"class":214,"line":215},[212,300,301],{"class":226},"NUXT_POSTHOG_API_KEY",[212,303,304],{"class":222},"=",[212,306,307],{"class":239},"phc_your-project-api-key\n",[248,309,311],{"id":310},"_3-create-the-drain-plugin","3. Create the drain plugin",[201,313,315],{"className":203,"code":314,"filename":205,"language":206,"meta":207,"style":207},"import { createPostHogDrain } from 'evlog/posthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n})\n",[209,316,317,335,342,373,409],{"__ignoreMap":207},[212,318,319,321,323,325,327,329,331,333],{"class":214,"line":215},[212,320,219],{"class":218},[212,322,223],{"class":222},[212,324,227],{"class":226},[212,326,230],{"class":222},[212,328,233],{"class":218},[212,330,236],{"class":222},[212,332,240],{"class":239},[212,334,243],{"class":222},[212,336,338],{"class":214,"line":337},2,[212,339,341],{"emptyLinePlaceholder":340},true,"\n",[212,343,345,348,351,355,358,360,364,366,370],{"class":214,"line":344},3,[212,346,347],{"class":218},"export",[212,349,350],{"class":218}," default",[212,352,354],{"class":353},"s2Zo4"," defineNitroPlugin",[212,356,357],{"class":226},"(",[212,359,357],{"class":222},[212,361,363],{"class":362},"sHdIc","nitroApp",[212,365,284],{"class":222},[212,367,369],{"class":368},"spNyl"," =>",[212,371,372],{"class":222}," {\n",[212,374,376,379,382,385,387,390,393,396,399,401,404,406],{"class":214,"line":375},4,[212,377,378],{"class":226},"  nitroApp",[212,380,381],{"class":222},".",[212,383,384],{"class":226},"hooks",[212,386,381],{"class":222},[212,388,389],{"class":353},"hook",[212,391,357],{"class":392},"swJcz",[212,394,395],{"class":222},"'",[212,397,398],{"class":239},"evlog:drain",[212,400,395],{"class":222},[212,402,403],{"class":222},",",[212,405,227],{"class":353},[212,407,408],{"class":392},"())\n",[212,410,412,415],{"class":214,"line":411},5,[212,413,414],{"class":222},"}",[212,416,417],{"class":226},")\n",[178,419,420],{},"That's it! Your wide events will now appear in PostHog Logs with full OTLP structure including severity levels, trace context, and structured attributes.",[194,422,424],{"id":423},"configuration","Configuration",[178,426,427],{},"The adapter reads configuration from multiple sources (highest priority first):",[253,429,430,439,448,455],{},[256,431,432,435,436],{},[268,433,434],{},"Overrides"," passed to ",[209,437,438],{},"createPostHogDrain()",[256,440,441,444,445],{},[268,442,443],{},"Runtime config"," at ",[209,446,447],{},"runtimeConfig.evlog.posthog",[256,449,450,444,452],{},[268,451,443],{},[209,453,454],{},"runtimeConfig.posthog",[256,456,457,460,461,464,465,284],{},[268,458,459],{},"Environment variables"," (",[209,462,463],{},"NUXT_POSTHOG_*"," or ",[209,466,467],{},"POSTHOG_*",[248,469,471],{"id":470},"environment-variables","Environment Variables",[473,474,475,488],"table",{},[476,477,478],"thead",{},[479,480,481,485],"tr",{},[482,483,484],"th",{},"Variable",[482,486,487],{},"Description",[489,490,491,503],"tbody",{},[479,492,493,498],{},[494,495,496],"td",{},[209,497,301],{},[494,499,500,501,284],{},"Project API key (starts with ",[209,502,283],{},[479,504,505,510],{},[494,506,507],{},[209,508,509],{},"NUXT_POSTHOG_HOST",[494,511,512],{},"PostHog host URL (for EU or self-hosted)",[178,514,515,516,519,520,523],{},"You can also use ",[209,517,518],{},"POSTHOG_API_KEY"," and ",[209,521,522],{},"POSTHOG_HOST"," as fallbacks.",[248,525,527],{"id":526},"runtime-config","Runtime Config",[178,529,530,531,534],{},"Configure via ",[209,532,533],{},"nuxt.config.ts"," for type-safe configuration:",[201,536,538],{"className":203,"code":537,"filename":533,"language":206,"meta":207,"style":207},"export default defineNuxtConfig({\n  runtimeConfig: {\n    posthog: {\n      apiKey: '', // Set via NUXT_POSTHOG_API_KEY\n      host: '', // Set via NUXT_POSTHOG_HOST\n    },\n  },\n})\n",[209,539,540,554,564,573,589,603,609,615],{"__ignoreMap":207},[212,541,542,544,546,549,551],{"class":214,"line":215},[212,543,347],{"class":218},[212,545,350],{"class":218},[212,547,548],{"class":353}," defineNuxtConfig",[212,550,357],{"class":226},[212,552,553],{"class":222},"{\n",[212,555,556,559,562],{"class":214,"line":337},[212,557,558],{"class":392},"  runtimeConfig",[212,560,561],{"class":222},":",[212,563,372],{"class":222},[212,565,566,569,571],{"class":214,"line":344},[212,567,568],{"class":392},"    posthog",[212,570,561],{"class":222},[212,572,372],{"class":222},[212,574,575,578,580,583,585],{"class":214,"line":375},[212,576,577],{"class":392},"      apiKey",[212,579,561],{"class":222},[212,581,582],{"class":222}," ''",[212,584,403],{"class":222},[212,586,588],{"class":587},"sHwdD"," // Set via NUXT_POSTHOG_API_KEY\n",[212,590,591,594,596,598,600],{"class":214,"line":411},[212,592,593],{"class":392},"      host",[212,595,561],{"class":222},[212,597,582],{"class":222},[212,599,403],{"class":222},[212,601,602],{"class":587}," // Set via NUXT_POSTHOG_HOST\n",[212,604,606],{"class":214,"line":605},6,[212,607,608],{"class":222},"    },\n",[212,610,612],{"class":214,"line":611},7,[212,613,614],{"class":222},"  },\n",[212,616,618,620],{"class":214,"line":617},8,[212,619,414],{"class":222},[212,621,417],{"class":226},[248,623,625],{"id":624},"override-options","Override Options",[178,627,628],{},"Pass options directly to override any configuration:",[201,630,632],{"className":203,"code":631,"filename":205,"language":206,"meta":207,"style":207},"import { createPostHogDrain } from 'evlog/posthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain({\n    host: 'https://eu.i.posthog.com',\n    timeout: 10000,\n  }))\n})\n",[209,633,634,652,656,676,704,721,734,742],{"__ignoreMap":207},[212,635,636,638,640,642,644,646,648,650],{"class":214,"line":215},[212,637,219],{"class":218},[212,639,223],{"class":222},[212,641,227],{"class":226},[212,643,230],{"class":222},[212,645,233],{"class":218},[212,647,236],{"class":222},[212,649,240],{"class":239},[212,651,243],{"class":222},[212,653,654],{"class":214,"line":337},[212,655,341],{"emptyLinePlaceholder":340},[212,657,658,660,662,664,666,668,670,672,674],{"class":214,"line":344},[212,659,347],{"class":218},[212,661,350],{"class":218},[212,663,354],{"class":353},[212,665,357],{"class":226},[212,667,357],{"class":222},[212,669,363],{"class":362},[212,671,284],{"class":222},[212,673,369],{"class":368},[212,675,372],{"class":222},[212,677,678,680,682,684,686,688,690,692,694,696,698,700,702],{"class":214,"line":375},[212,679,378],{"class":226},[212,681,381],{"class":222},[212,683,384],{"class":226},[212,685,381],{"class":222},[212,687,389],{"class":353},[212,689,357],{"class":392},[212,691,395],{"class":222},[212,693,398],{"class":239},[212,695,395],{"class":222},[212,697,403],{"class":222},[212,699,227],{"class":353},[212,701,357],{"class":392},[212,703,553],{"class":222},[212,705,706,709,711,713,716,718],{"class":214,"line":411},[212,707,708],{"class":392},"    host",[212,710,561],{"class":222},[212,712,236],{"class":222},[212,714,715],{"class":239},"https://eu.i.posthog.com",[212,717,395],{"class":222},[212,719,720],{"class":222},",\n",[212,722,723,726,728,732],{"class":214,"line":605},[212,724,725],{"class":392},"    timeout",[212,727,561],{"class":222},[212,729,731],{"class":730},"sbssI"," 10000",[212,733,720],{"class":222},[212,735,736,739],{"class":214,"line":611},[212,737,738],{"class":222},"  }",[212,740,741],{"class":392},"))\n",[212,743,744,746],{"class":214,"line":617},[212,745,414],{"class":222},[212,747,417],{"class":226},[248,749,751],{"id":750},"full-configuration-reference","Full Configuration Reference",[473,753,754,769],{},[476,755,756],{},[479,757,758,761,764,767],{},[482,759,760],{},"Option",[482,762,763],{},"Type",[482,765,766],{},"Default",[482,768,487],{},[489,770,771,789,808],{},[479,772,773,778,783,786],{},[494,774,775],{},[209,776,777],{},"apiKey",[494,779,780],{},[209,781,782],{},"string",[494,784,785],{},"-",[494,787,788],{},"Project API key (required)",[479,790,791,796,800,805],{},[494,792,793],{},[209,794,795],{},"host",[494,797,798],{},[209,799,782],{},[494,801,802],{},[209,803,804],{},"https://us.i.posthog.com",[494,806,807],{},"PostHog host URL",[479,809,810,815,820,825],{},[494,811,812],{},[209,813,814],{},"timeout",[494,816,817],{},[209,818,819],{},"number",[494,821,822],{},[209,823,824],{},"5000",[494,826,827],{},"Request timeout in milliseconds",[194,829,831],{"id":830},"how-it-works","How It Works",[178,833,834,835,837,838,841],{},"Under the hood, ",[209,836,438],{}," wraps the OTLP adapter's ",[209,839,840],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[843,844,845,855,864],"ul",{},[256,846,847,850,851,854],{},[268,848,849],{},"Endpoint",": ",[209,852,853],{},"{host}/i/v1/logs"," (PostHog's OTLP log ingest endpoint)",[256,856,857,850,860,863],{},[268,858,859],{},"Auth",[209,861,862],{},"Authorization: Bearer {apiKey}"," header",[256,865,866,869,870,873],{},[268,867,868],{},"Format",": Standard OTLP ",[209,871,872],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[194,875,877],{"id":876},"regions","Regions",[178,879,880,881,883],{},"PostHog offers US and EU cloud hosting. Set the ",[209,882,795],{}," to match your region:",[473,885,886,896],{},[476,887,888],{},[479,889,890,893],{},[482,891,892],{},"Region",[482,894,895],{},"Host",[489,897,898,907,916],{},[479,899,900,903],{},[494,901,902],{},"US (default)",[494,904,905],{},[209,906,804],{},[479,908,909,912],{},[494,910,911],{},"EU",[494,913,914],{},[209,915,715],{},[479,917,918,921],{},[494,919,920],{},"Self-hosted",[494,922,923],{},"Your instance URL",[201,925,927],{"className":291,"code":926,"filename":293,"language":294,"meta":207,"style":207},"# EU region\nNUXT_POSTHOG_API_KEY=phc_xxx\nNUXT_POSTHOG_HOST=https://eu.i.posthog.com\n",[209,928,929,934,943],{"__ignoreMap":207},[212,930,931],{"class":214,"line":215},[212,932,933],{"class":587},"# EU region\n",[212,935,936,938,940],{"class":214,"line":337},[212,937,301],{"class":226},[212,939,304],{"class":222},[212,941,942],{"class":239},"phc_xxx\n",[212,944,945,947,949],{"class":214,"line":344},[212,946,509],{"class":226},[212,948,304],{"class":222},[212,950,951],{"class":239},"https://eu.i.posthog.com\n",[194,953,955],{"id":954},"querying-logs-in-posthog","Querying Logs in PostHog",[178,957,958,959,962],{},"Once your logs are flowing, use the ",[268,960,961],{},"Logs"," tab in PostHog to query them:",[253,964,965,970,973],{},[256,966,266,967,969],{},[268,968,961],{}," and filter by service, severity, or any structured attribute",[256,971,972],{},"Use the search bar to find specific log entries",[256,974,975],{},"Click on a log entry to see all structured attributes",[194,977,979],{"id":978},"posthog-events-custom-events","PostHog Events (Custom Events)",[178,981,982,983,561],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[209,984,985],{},"createPostHogEventsDrain()",[201,987,989],{"className":203,"code":988,"filename":205,"language":206,"meta":207,"style":207},"import { createPostHogEventsDrain } from 'evlog/posthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogEventsDrain({\n    eventName: 'server_request',\n    distinctId: 'my-backend-service',\n  }))\n})\n",[209,990,991,1010,1014,1034,1062,1078,1094,1100],{"__ignoreMap":207},[212,992,993,995,997,1000,1002,1004,1006,1008],{"class":214,"line":215},[212,994,219],{"class":218},[212,996,223],{"class":222},[212,998,999],{"class":226}," createPostHogEventsDrain",[212,1001,230],{"class":222},[212,1003,233],{"class":218},[212,1005,236],{"class":222},[212,1007,240],{"class":239},[212,1009,243],{"class":222},[212,1011,1012],{"class":214,"line":337},[212,1013,341],{"emptyLinePlaceholder":340},[212,1015,1016,1018,1020,1022,1024,1026,1028,1030,1032],{"class":214,"line":344},[212,1017,347],{"class":218},[212,1019,350],{"class":218},[212,1021,354],{"class":353},[212,1023,357],{"class":226},[212,1025,357],{"class":222},[212,1027,363],{"class":362},[212,1029,284],{"class":222},[212,1031,369],{"class":368},[212,1033,372],{"class":222},[212,1035,1036,1038,1040,1042,1044,1046,1048,1050,1052,1054,1056,1058,1060],{"class":214,"line":375},[212,1037,378],{"class":226},[212,1039,381],{"class":222},[212,1041,384],{"class":226},[212,1043,381],{"class":222},[212,1045,389],{"class":353},[212,1047,357],{"class":392},[212,1049,395],{"class":222},[212,1051,398],{"class":239},[212,1053,395],{"class":222},[212,1055,403],{"class":222},[212,1057,999],{"class":353},[212,1059,357],{"class":392},[212,1061,553],{"class":222},[212,1063,1064,1067,1069,1071,1074,1076],{"class":214,"line":411},[212,1065,1066],{"class":392},"    eventName",[212,1068,561],{"class":222},[212,1070,236],{"class":222},[212,1072,1073],{"class":239},"server_request",[212,1075,395],{"class":222},[212,1077,720],{"class":222},[212,1079,1080,1083,1085,1087,1090,1092],{"class":214,"line":605},[212,1081,1082],{"class":392},"    distinctId",[212,1084,561],{"class":222},[212,1086,236],{"class":222},[212,1088,1089],{"class":239},"my-backend-service",[212,1091,395],{"class":222},[212,1093,720],{"class":222},[212,1095,1096,1098],{"class":214,"line":611},[212,1097,738],{"class":222},[212,1099,741],{"class":392},[212,1101,1102,1104],{"class":214,"line":617},[212,1103,414],{"class":222},[212,1105,417],{"class":226},[1107,1108,1110,1111,1113],"callout",{"color":1109,"icon":13},"info","Custom events count towards your PostHog event quota. PostHog Logs (the default ",[209,1112,438],{},") is significantly cheaper.",[248,1115,1117],{"id":1116},"events-configuration","Events Configuration",[473,1119,1120,1132],{},[476,1121,1122],{},[479,1123,1124,1126,1128,1130],{},[482,1125,760],{},[482,1127,763],{},[482,1129,766],{},[482,1131,487],{},[489,1133,1134,1148,1164,1183,1206],{},[479,1135,1136,1140,1144,1146],{},[494,1137,1138],{},[209,1139,777],{},[494,1141,1142],{},[209,1143,782],{},[494,1145,785],{},[494,1147,788],{},[479,1149,1150,1154,1158,1162],{},[494,1151,1152],{},[209,1153,795],{},[494,1155,1156],{},[209,1157,782],{},[494,1159,1160],{},[209,1161,804],{},[494,1163,807],{},[479,1165,1166,1171,1175,1180],{},[494,1167,1168],{},[209,1169,1170],{},"eventName",[494,1172,1173],{},[209,1174,782],{},[494,1176,1177],{},[209,1178,1179],{},"evlog_wide_event",[494,1181,1182],{},"PostHog event name",[479,1184,1185,1190,1194,1199],{},[494,1186,1187],{},[209,1188,1189],{},"distinctId",[494,1191,1192],{},[209,1193,782],{},[494,1195,1196],{},[209,1197,1198],{},"event.service",[494,1200,1201,1202,1205],{},"Override ",[209,1203,1204],{},"distinct_id"," for all events",[479,1207,1208,1212,1216,1220],{},[494,1209,1210],{},[209,1211,814],{},[494,1213,1214],{},[209,1215,819],{},[494,1217,1218],{},[209,1219,824],{},[494,1221,827],{},[248,1223,1225],{"id":1224},"event-format","Event Format",[178,1227,1228],{},"evlog maps wide events to PostHog events:",[473,1230,1231,1241],{},[476,1232,1233],{},[479,1234,1235,1238],{},[482,1236,1237],{},"evlog Field",[482,1239,1240],{},"PostHog Field",[489,1242,1243,1261,1272,1284,1295,1307],{},[479,1244,1245,1256],{},[494,1246,1247,464,1250,464,1253],{},[209,1248,1249],{},"config.distinctId",[209,1251,1252],{},"userId",[209,1254,1255],{},"service",[494,1257,1258,1260],{},[209,1259,1204],{}," (fallback chain)",[479,1262,1263,1268],{},[494,1264,1265],{},[209,1266,1267],{},"timestamp",[494,1269,1270],{},[209,1271,1267],{},[479,1273,1274,1279],{},[494,1275,1276],{},[209,1277,1278],{},"level",[494,1280,1281],{},[209,1282,1283],{},"properties.level",[479,1285,1286,1290],{},[494,1287,1288],{},[209,1289,1255],{},[494,1291,1292],{},[209,1293,1294],{},"properties.service",[479,1296,1297,1302],{},[494,1298,1299],{},[209,1300,1301],{},"environment",[494,1303,1304],{},[209,1305,1306],{},"properties.environment",[479,1308,1309,1312],{},[494,1310,1311],{},"All other fields",[494,1313,1314],{},[209,1315,1316],{},"properties.*",[248,1318,1320],{"id":1319},"distinct-id-resolution","Distinct ID Resolution",[178,1322,1323,1324,1326],{},"The ",[209,1325,1204],{}," follows a fallback chain:",[253,1328,1329,1338,1346],{},[256,1330,1331,1335,1336],{},[268,1332,1333],{},[209,1334,1249],{}," — explicit override in ",[209,1337,985],{},[256,1339,1340,1345],{},[268,1341,1342],{},[209,1343,1344],{},"event.userId"," — automatically picked up if present as a string",[256,1347,1348,1352],{},[268,1349,1350],{},[209,1351,1198],{}," — final fallback",[248,1354,1356],{"id":1355},"logs-vs-events","Logs vs Events",[473,1358,1359,1373],{},[476,1360,1361],{},[479,1362,1363,1365,1369],{},[482,1364],{},[482,1366,1367],{},[209,1368,438],{},[482,1370,1371],{},[209,1372,985],{},[489,1374,1375,1393,1406,1419],{},[479,1376,1377,1381,1387],{},[494,1378,1379],{},[268,1380,868],{},[494,1382,1383,1384,284],{},"OTLP Logs (",[209,1385,1386],{},"/i/v1/logs",[494,1388,1389,1390,284],{},"PostHog Events (",[209,1391,1392],{},"/batch/",[479,1394,1395,1400,1403],{},[494,1396,1397],{},[268,1398,1399],{},"PostHog UI",[494,1401,1402],{},"Logs viewer",[494,1404,1405],{},"Events explorer",[479,1407,1408,1413,1416],{},[494,1409,1410],{},[268,1411,1412],{},"Cost",[494,1414,1415],{},"Lower (dedicated logs pipeline)",[494,1417,1418],{},"Higher (counts as events)",[479,1420,1421,1426,1429],{},[494,1422,1423],{},[268,1424,1425],{},"Best for",[494,1427,1428],{},"Debugging, log search, observability",[494,1430,1431],{},"Product analytics, cohorts, funnels",[178,1433,1434],{},"You can use both drains simultaneously to get the best of both worlds:",[201,1436,1438],{"className":203,"code":1437,"filename":205,"language":206,"meta":207,"style":207},"import { createPostHogDrain, createPostHogEventsDrain } from 'evlog/posthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n  nitroApp.hooks.hook('evlog:drain', createPostHogEventsDrain())\n})\n",[209,1439,1440,1462,1466,1486,1512,1538],{"__ignoreMap":207},[212,1441,1442,1444,1446,1448,1450,1452,1454,1456,1458,1460],{"class":214,"line":215},[212,1443,219],{"class":218},[212,1445,223],{"class":222},[212,1447,227],{"class":226},[212,1449,403],{"class":222},[212,1451,999],{"class":226},[212,1453,230],{"class":222},[212,1455,233],{"class":218},[212,1457,236],{"class":222},[212,1459,240],{"class":239},[212,1461,243],{"class":222},[212,1463,1464],{"class":214,"line":337},[212,1465,341],{"emptyLinePlaceholder":340},[212,1467,1468,1470,1472,1474,1476,1478,1480,1482,1484],{"class":214,"line":344},[212,1469,347],{"class":218},[212,1471,350],{"class":218},[212,1473,354],{"class":353},[212,1475,357],{"class":226},[212,1477,357],{"class":222},[212,1479,363],{"class":362},[212,1481,284],{"class":222},[212,1483,369],{"class":368},[212,1485,372],{"class":222},[212,1487,1488,1490,1492,1494,1496,1498,1500,1502,1504,1506,1508,1510],{"class":214,"line":375},[212,1489,378],{"class":226},[212,1491,381],{"class":222},[212,1493,384],{"class":226},[212,1495,381],{"class":222},[212,1497,389],{"class":353},[212,1499,357],{"class":392},[212,1501,395],{"class":222},[212,1503,398],{"class":239},[212,1505,395],{"class":222},[212,1507,403],{"class":222},[212,1509,227],{"class":353},[212,1511,408],{"class":392},[212,1513,1514,1516,1518,1520,1522,1524,1526,1528,1530,1532,1534,1536],{"class":214,"line":411},[212,1515,378],{"class":226},[212,1517,381],{"class":222},[212,1519,384],{"class":226},[212,1521,381],{"class":222},[212,1523,389],{"class":353},[212,1525,357],{"class":392},[212,1527,395],{"class":222},[212,1529,398],{"class":239},[212,1531,395],{"class":222},[212,1533,403],{"class":222},[212,1535,999],{"class":353},[212,1537,408],{"class":392},[212,1539,1540,1542],{"class":214,"line":605},[212,1541,414],{"class":222},[212,1543,417],{"class":226},[194,1545,1547],{"id":1546},"troubleshooting","Troubleshooting",[248,1549,1551],{"id":1550},"missing-apikey-error","Missing apiKey error",[201,1553,1558],{"className":1554,"code":1556,"language":1557},[1555],"language-text","[evlog/posthog] Missing apiKey. Set NUXT_POSTHOG_API_KEY/POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","text",[209,1559,1556],{"__ignoreMap":207},[178,1561,1562],{},"Make sure your environment variable is set and the server was restarted after adding it.",[248,1564,1566],{"id":1565},"events-not-appearing","Events not appearing",[178,1568,1569],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[253,1571,1572,1579,1584],{},[256,1573,1574,1575,1578],{},"Check the server console for ",[209,1576,1577],{},"[evlog/posthog]"," error messages",[256,1580,1581,1582],{},"Verify your API key is correct and starts with ",[209,1583,283],{},[256,1585,1586,1587,1589],{},"Confirm your ",[209,1588,795],{}," matches your PostHog region (US vs EU)",[248,1591,1593],{"id":1592},"wrong-region","Wrong region",[178,1595,1596,1597,1599],{},"If you're on PostHog EU but using the default US host, event delivery will fail and the adapter will log errors (for example under ",[209,1598,1577],{},") to your server console. Set the correct host:",[201,1601,1603],{"className":291,"code":1602,"filename":293,"language":294,"meta":207,"style":207},"NUXT_POSTHOG_HOST=https://eu.i.posthog.com\n",[209,1604,1605],{"__ignoreMap":207},[212,1606,1607,1609,1611],{"class":214,"line":215},[212,1608,509],{"class":226},[212,1610,304],{"class":222},[212,1612,951],{"class":239},[194,1614,1616],{"id":1615},"direct-api-usage","Direct API Usage",[178,1618,1619],{},"For advanced use cases, you can use the lower-level functions:",[201,1621,1624],{"className":203,"code":1622,"filename":1623,"language":206,"meta":207,"style":207},"import { sendToPostHog, sendBatchToPostHog } from 'evlog/posthog'\n\n// Send a single event to PostHog Logs (OTLP)\nawait sendToPostHog(event, {\n  apiKey: 'phc_xxx',\n})\n\n// Send multiple events in one request\nawait sendBatchToPostHog(events, {\n  apiKey: 'phc_xxx',\n})\n","server/utils/posthog.ts",[209,1625,1626,1650,1654,1659,1673,1689,1695,1699,1704,1718,1733],{"__ignoreMap":207},[212,1627,1628,1630,1632,1635,1637,1640,1642,1644,1646,1648],{"class":214,"line":215},[212,1629,219],{"class":218},[212,1631,223],{"class":222},[212,1633,1634],{"class":226}," sendToPostHog",[212,1636,403],{"class":222},[212,1638,1639],{"class":226}," sendBatchToPostHog",[212,1641,230],{"class":222},[212,1643,233],{"class":218},[212,1645,236],{"class":222},[212,1647,240],{"class":239},[212,1649,243],{"class":222},[212,1651,1652],{"class":214,"line":337},[212,1653,341],{"emptyLinePlaceholder":340},[212,1655,1656],{"class":214,"line":344},[212,1657,1658],{"class":587},"// Send a single event to PostHog Logs (OTLP)\n",[212,1660,1661,1664,1666,1669,1671],{"class":214,"line":375},[212,1662,1663],{"class":218},"await",[212,1665,1634],{"class":353},[212,1667,1668],{"class":226},"(event",[212,1670,403],{"class":222},[212,1672,372],{"class":222},[212,1674,1675,1678,1680,1682,1685,1687],{"class":214,"line":411},[212,1676,1677],{"class":392},"  apiKey",[212,1679,561],{"class":222},[212,1681,236],{"class":222},[212,1683,1684],{"class":239},"phc_xxx",[212,1686,395],{"class":222},[212,1688,720],{"class":222},[212,1690,1691,1693],{"class":214,"line":605},[212,1692,414],{"class":222},[212,1694,417],{"class":226},[212,1696,1697],{"class":214,"line":611},[212,1698,341],{"emptyLinePlaceholder":340},[212,1700,1701],{"class":214,"line":617},[212,1702,1703],{"class":587},"// Send multiple events in one request\n",[212,1705,1707,1709,1711,1714,1716],{"class":214,"line":1706},9,[212,1708,1663],{"class":218},[212,1710,1639],{"class":353},[212,1712,1713],{"class":226},"(events",[212,1715,403],{"class":222},[212,1717,372],{"class":222},[212,1719,1721,1723,1725,1727,1729,1731],{"class":214,"line":1720},10,[212,1722,1677],{"class":392},[212,1724,561],{"class":222},[212,1726,236],{"class":222},[212,1728,1684],{"class":239},[212,1730,395],{"class":222},[212,1732,720],{"class":222},[212,1734,1736,1738],{"class":214,"line":1735},11,[212,1737,414],{"class":222},[212,1739,417],{"class":226},[178,1741,1742],{},"For custom events, use the events-specific functions:",[201,1744,1746],{"className":203,"code":1745,"filename":1623,"language":206,"meta":207,"style":207},"import { sendToPostHogEvents, sendBatchToPostHogEvents, toPostHogEvent } from 'evlog/posthog'\n\n// Send a single custom event\nawait sendToPostHogEvents(event, {\n  apiKey: 'phc_xxx',\n})\n\n// Send multiple custom events in one request\nawait sendBatchToPostHogEvents(events, {\n  apiKey: 'phc_xxx',\n})\n\n// Convert event to PostHog format (for inspection)\nconst posthogEvent = toPostHogEvent(event, { apiKey: 'phc_xxx' })\n",[209,1747,1748,1777,1781,1786,1798,1812,1818,1822,1827,1839,1853,1859,1864,1870],{"__ignoreMap":207},[212,1749,1750,1752,1754,1757,1759,1762,1764,1767,1769,1771,1773,1775],{"class":214,"line":215},[212,1751,219],{"class":218},[212,1753,223],{"class":222},[212,1755,1756],{"class":226}," sendToPostHogEvents",[212,1758,403],{"class":222},[212,1760,1761],{"class":226}," sendBatchToPostHogEvents",[212,1763,403],{"class":222},[212,1765,1766],{"class":226}," toPostHogEvent",[212,1768,230],{"class":222},[212,1770,233],{"class":218},[212,1772,236],{"class":222},[212,1774,240],{"class":239},[212,1776,243],{"class":222},[212,1778,1779],{"class":214,"line":337},[212,1780,341],{"emptyLinePlaceholder":340},[212,1782,1783],{"class":214,"line":344},[212,1784,1785],{"class":587},"// Send a single custom event\n",[212,1787,1788,1790,1792,1794,1796],{"class":214,"line":375},[212,1789,1663],{"class":218},[212,1791,1756],{"class":353},[212,1793,1668],{"class":226},[212,1795,403],{"class":222},[212,1797,372],{"class":222},[212,1799,1800,1802,1804,1806,1808,1810],{"class":214,"line":411},[212,1801,1677],{"class":392},[212,1803,561],{"class":222},[212,1805,236],{"class":222},[212,1807,1684],{"class":239},[212,1809,395],{"class":222},[212,1811,720],{"class":222},[212,1813,1814,1816],{"class":214,"line":605},[212,1815,414],{"class":222},[212,1817,417],{"class":226},[212,1819,1820],{"class":214,"line":611},[212,1821,341],{"emptyLinePlaceholder":340},[212,1823,1824],{"class":214,"line":617},[212,1825,1826],{"class":587},"// Send multiple custom events in one request\n",[212,1828,1829,1831,1833,1835,1837],{"class":214,"line":1706},[212,1830,1663],{"class":218},[212,1832,1761],{"class":353},[212,1834,1713],{"class":226},[212,1836,403],{"class":222},[212,1838,372],{"class":222},[212,1840,1841,1843,1845,1847,1849,1851],{"class":214,"line":1720},[212,1842,1677],{"class":392},[212,1844,561],{"class":222},[212,1846,236],{"class":222},[212,1848,1684],{"class":239},[212,1850,395],{"class":222},[212,1852,720],{"class":222},[212,1854,1855,1857],{"class":214,"line":1735},[212,1856,414],{"class":222},[212,1858,417],{"class":226},[212,1860,1862],{"class":214,"line":1861},12,[212,1863,341],{"emptyLinePlaceholder":340},[212,1865,1867],{"class":214,"line":1866},13,[212,1868,1869],{"class":587},"// Convert event to PostHog format (for inspection)\n",[212,1871,1873,1876,1879,1881,1883,1885,1887,1889,1892,1894,1896,1898,1900,1902],{"class":214,"line":1872},14,[212,1874,1875],{"class":368},"const",[212,1877,1878],{"class":226}," posthogEvent ",[212,1880,304],{"class":222},[212,1882,1766],{"class":353},[212,1884,1668],{"class":226},[212,1886,403],{"class":222},[212,1888,223],{"class":222},[212,1890,1891],{"class":392}," apiKey",[212,1893,561],{"class":222},[212,1895,236],{"class":222},[212,1897,1684],{"class":239},[212,1899,395],{"class":222},[212,1901,230],{"class":222},[212,1903,417],{"class":226},[194,1905,1907],{"id":1906},"next-steps","Next Steps",[843,1909,1910,1916,1922,1927],{},[256,1911,1912,1915],{},[181,1913,1914],{"href":67},"Axiom Adapter"," - Send logs to Axiom",[256,1917,1918,1921],{},[181,1919,1920],{"href":72},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[256,1923,1924,1926],{},[181,1925,91],{"href":92}," - Build your own adapter",[256,1928,1929,1931],{},[181,1930,46],{"href":47}," - Security and production tips",[1933,1934,1935],"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 .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 .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 .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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":207,"searchDepth":337,"depth":337,"links":1937},[1938,1939,1944,1950,1951,1952,1953,1959,1964,1965],{"id":196,"depth":337,"text":15},{"id":246,"depth":337,"text":20,"children":1940},[1941,1942,1943],{"id":250,"depth":344,"text":251},{"id":287,"depth":344,"text":288},{"id":310,"depth":344,"text":311},{"id":423,"depth":337,"text":424,"children":1945},[1946,1947,1948,1949],{"id":470,"depth":344,"text":471},{"id":526,"depth":344,"text":527},{"id":624,"depth":344,"text":625},{"id":750,"depth":344,"text":751},{"id":830,"depth":337,"text":831},{"id":876,"depth":337,"text":877},{"id":954,"depth":337,"text":955},{"id":978,"depth":337,"text":979,"children":1954},[1955,1956,1957,1958],{"id":1116,"depth":344,"text":1117},{"id":1224,"depth":344,"text":1225},{"id":1319,"depth":344,"text":1320},{"id":1355,"depth":344,"text":1356},{"id":1546,"depth":337,"text":1547,"children":1960},[1961,1962,1963],{"id":1550,"depth":344,"text":1551},{"id":1565,"depth":344,"text":1566},{"id":1592,"depth":344,"text":1593},{"id":1615,"depth":337,"text":1616},{"id":1906,"depth":337,"text":1907},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[1969,1975],{"label":1970,"icon":1971,"to":261,"target":1972,"color":1973,"variant":1974},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":1914,"icon":69,"to":67,"color":1973,"variant":1974},{},{"title":76,"icon":79},{"title":173,"description":1966},"b1vTeji73_62h6glXyE4QX7-PAZECQV548tSQ71oEBY",[1981,1983],{"title":71,"path":72,"stem":73,"description":1982,"icon":74,"children":-1},"Send logs via OpenTelemetry Protocol (OTLP) to Grafana, Datadog, Honeycomb, and any compatible backend. Supports gRPC and HTTP transports.",{"title":81,"path":82,"stem":83,"description":1984,"icon":84,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1772880295121]