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