[{"data":1,"prerenderedAt":3527},["ShallowReactive",2],{"navigation_docs":3,"-integrate-adapters-cloud-posthog":538,"-integrate-adapters-cloud-posthog-surround":3522},[4,30,80,128,308,440,499],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Start","\u002Fstart","1.start",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Learn","\u002Flearn","2.learn",[35,40,45,50,55,60,65,70,75],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":61,"path":62,"stem":63,"icon":64},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":66,"path":67,"stem":68,"icon":69},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":71,"path":72,"stem":73,"icon":74},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":76,"path":77,"stem":78,"icon":79},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":81,"path":82,"stem":83,"children":84,"page":29},"CLI","\u002Fcli","3.cli",[85,88,93,98,103,108,113,118,123],{"title":36,"path":86,"stem":87,"icon":44},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":89,"path":90,"stem":91,"icon":92},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":94,"path":95,"stem":96,"icon":97},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":99,"path":100,"stem":101,"icon":102},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":104,"path":105,"stem":106,"icon":107},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":109,"path":110,"stem":111,"icon":112},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":114,"path":115,"stem":116,"icon":117},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":119,"path":120,"stem":121,"icon":122},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":124,"path":125,"stem":126,"icon":127},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":129,"path":130,"stem":131,"children":132,"page":29},"Integrate","\u002Fintegrate","4.integrate",[133,137,220],{"title":36,"path":134,"stem":135,"icon":136},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":138,"path":139,"stem":140,"children":141,"page":29},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[142,145,175,200],{"title":36,"path":143,"stem":144,"icon":39},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":146,"path":147,"stem":148,"children":149,"page":29},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[150,155,160,165,170],{"title":151,"path":152,"stem":153,"icon":154},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":156,"path":157,"stem":158,"icon":159},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":161,"path":162,"stem":163,"icon":164},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":166,"path":167,"stem":168,"icon":169},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":171,"path":172,"stem":173,"icon":174},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":176,"path":177,"stem":178,"children":179,"page":29},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[180,185,190,195],{"title":181,"path":182,"stem":183,"icon":184},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":186,"path":187,"stem":188,"icon":189},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":191,"path":192,"stem":193,"icon":194},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":196,"path":197,"stem":198,"icon":199},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":201,"path":202,"stem":203,"children":204,"page":29},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[205,210,215],{"title":206,"path":207,"stem":208,"icon":209},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":211,"path":212,"stem":213,"icon":214},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":216,"path":217,"stem":218,"icon":219},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":221,"path":222,"stem":223,"children":224,"page":29},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[225,229,234,239,244,249,254,259,264,269,274,279,284,289,293,298,303],{"title":36,"path":226,"stem":227,"icon":228},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":230,"path":231,"stem":232,"icon":233},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":235,"path":236,"stem":237,"icon":238},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":240,"path":241,"stem":242,"icon":243},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":245,"path":246,"stem":247,"icon":248},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":250,"path":251,"stem":252,"icon":253},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":255,"path":256,"stem":257,"icon":258},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":260,"path":261,"stem":262,"icon":263},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":270,"path":271,"stem":272,"icon":273},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":275,"path":276,"stem":277,"icon":278},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":280,"path":281,"stem":282,"icon":283},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":285,"path":286,"stem":287,"icon":288},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":290,"path":291,"stem":292,"icon":74},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":294,"path":295,"stem":296,"icon":297},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":299,"path":300,"stem":301,"icon":302},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":304,"path":305,"stem":306,"icon":307},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":309,"path":310,"stem":311,"children":312,"page":29},"Use Cases","\u002Fuse-cases","5.use-cases",[313,316,321,350,377,409,430,435],{"title":36,"path":314,"stem":315,"icon":102},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":317,"path":318,"stem":319,"icon":320},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":322,"icon":323,"path":324,"stem":325,"children":326,"page":29},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[327,330,335,340,345],{"title":36,"path":328,"stem":329,"icon":39},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":331,"path":332,"stem":333,"icon":334},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":336,"path":337,"stem":338,"icon":339},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":341,"path":342,"stem":343,"icon":344},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":346,"path":347,"stem":348,"icon":349},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":351,"icon":352,"path":353,"stem":354,"children":355,"page":29},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[356,359,364,369,373],{"title":36,"path":357,"stem":358,"icon":39},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":360,"path":361,"stem":362,"icon":363},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":365,"path":366,"stem":367,"icon":368},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":370,"path":371,"stem":372,"icon":320},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":374,"path":375,"stem":376,"icon":107},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":29},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[383,386,391,396,401,405],{"title":36,"path":384,"stem":385,"icon":39},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":387,"path":388,"stem":389,"icon":390},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":392,"path":393,"stem":394,"icon":395},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":397,"path":398,"stem":399,"icon":400},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":402,"path":403,"stem":404,"icon":379},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":406,"path":407,"stem":408,"icon":79},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":346,"icon":107,"path":410,"stem":411,"children":412,"page":29},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[413,416,421,426],{"title":36,"path":414,"stem":415,"icon":39},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":417,"path":418,"stem":419,"icon":420},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":422,"path":423,"stem":424,"icon":425},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":427,"path":428,"stem":429,"icon":79},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":431,"path":432,"stem":433,"icon":434},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":436,"path":437,"stem":438,"icon":439},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":441,"path":442,"stem":443,"children":444,"page":29},"Extend","\u002Fextend","6.extend",[445,449,454,459,463,468,472,476,480,484,489,494],{"title":36,"path":446,"stem":447,"icon":448},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":450,"path":451,"stem":452,"icon":453},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":455,"path":456,"stem":457,"icon":458},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":460,"path":461,"stem":462,"icon":453},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","6.extend\u002F11.diagnostics-channel",{"title":464,"path":465,"stem":466,"icon":467},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":406,"path":469,"stem":470,"icon":471},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":473,"path":474,"stem":475,"icon":448},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":477,"path":478,"stem":479,"icon":434},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":481,"path":482,"stem":483,"icon":64},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling",{"title":485,"path":486,"stem":487,"icon":488},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":490,"path":491,"stem":492,"icon":493},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":495,"path":496,"stem":497,"icon":498},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":427,"path":500,"stem":501,"children":502,"page":29},"\u002Freference","7.reference",[503,507,512,515,520,524,529,533],{"title":36,"path":504,"stem":505,"icon":506},"\u002Freference\u002Foverview","7.reference\u002F0.overview","i-lucide-book-marked",{"title":508,"path":509,"stem":510,"icon":511},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":374,"path":513,"stem":514,"icon":107},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":516,"path":517,"stem":518,"icon":519},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":521,"path":522,"stem":523,"icon":379},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":525,"path":526,"stem":527,"icon":528},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":530,"path":531,"stem":532,"icon":434},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"title":534,"path":535,"stem":536,"icon":537},"Cost","\u002Freference\u002Fcost","7.reference\u002F7.cost","i-lucide-receipt",{"id":539,"title":540,"body":541,"description":3508,"extension":3509,"links":3510,"meta":3518,"navigation":3519,"path":157,"seo":3520,"stem":158,"__hash__":3521},"docs\u002F4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog.md","PostHog Adapter",{"type":542,"value":543,"toc":3473},"minimark",[544,560,605,609,612,656,659,664,695,699,718,722,1300,1303,1306,1309,1339,1343,1384,1388,1395,1476,1480,1483,1540,1544,1717,1721,1731,1775,1779,1794,1807,1841,1844,1854,1858,1865,1874,1957,1964,2068,2072,2075,2132,2139,2175,2181,2196,2200,2206,2246,2274,2278,2284,2297,2301,2310,2405,2416,2422,2438,2442,2584,2588,2591,2679,2706,2710,2716,2746,2750,2757,2767,2858,2861,2865,2939,2942,3081,3085,3089,3098,3101,3105,3108,3128,3132,3138,3151,3155,3158,3277,3280,3440,3444,3469],[545,546,547,553,554,559],"p",{},[548,549,156],"a",{"href":550,"rel":551},"https:\u002F\u002Fposthog.com",[552],"nofollow"," is an open-source product analytics platform. The evlog PostHog adapter sends your wide events to ",[548,555,558],{"href":556,"rel":557},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Flogs",[552],"PostHog Logs"," via the standard OTLP format, giving you a dedicated log viewer with filtering, search, and tail mode using your existing PostHog API key.",[561,562,565,568,593],"prompt",{":actions":563,"description":564,"icon":159},"[\"copy\",\"cursor\",\"claude\"]","Add the PostHog drain adapter",[545,566,567],{},"Add the PostHog drain adapter to send evlog wide events to PostHog Logs.",[569,570,571,575,578,581,584,587,590],"ol",{},[572,573,574],"li",{},"Identify which framework I'm using and follow its evlog integration pattern",[572,576,577],{},"Install evlog if not already installed",[572,579,580],{},"Import createPostHogDrain from 'evlog\u002Fposthog'",[572,582,583],{},"Wire createPostHogDrain() into my framework's drain configuration",[572,585,586],{},"Set POSTHOG_API_KEY environment variable",[572,588,589],{},"Optionally set POSTHOG_HOST for EU or self-hosted instances",[572,591,592],{},"Test by triggering a request and checking PostHog > Logs",[545,594,595,596,600,601],{},"Adapter docs: ",[548,597,598],{"href":598,"rel":599},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog",[552],"\nFramework setup: ",[548,602,603],{"href":603,"rel":604},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fframeworks\u002Foverview",[552],[606,607,20],"h2",{"id":608},"installation",[545,610,611],{},"The PostHog adapter comes bundled with evlog:",[613,614,620],"pre",{"className":615,"code":616,"filename":617,"language":618,"meta":619,"style":619},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostHogDrain } from 'evlog\u002Fposthog'\n","src\u002Findex.ts","typescript","",[621,622,623],"code",{"__ignoreMap":619},[624,625,628,632,636,640,643,646,649,653],"span",{"class":626,"line":627},"line",1,[624,629,631],{"class":630},"s7zQu","import",[624,633,635],{"class":634},"sMK4o"," {",[624,637,639],{"class":638},"sTEyZ"," createPostHogDrain",[624,641,642],{"class":634}," }",[624,644,645],{"class":630}," from",[624,647,648],{"class":634}," '",[624,650,652],{"class":651},"sfazB","evlog\u002Fposthog",[624,654,655],{"class":634},"'\n",[606,657,25],{"id":658},"quick-start",[660,661,663],"h3",{"id":662},"_1-get-your-posthog-project-api-key","1. Get your PostHog project API key",[569,665,666,674,688],{},[572,667,668,669],{},"Log in to your ",[548,670,673],{"href":671,"rel":672},"https:\u002F\u002Fapp.posthog.com",[552],"PostHog dashboard",[572,675,676,677,681,682,681,685],{},"Go to ",[678,679,680],"strong",{},"Settings"," > ",[678,683,684],{},"Project",[678,686,687],{},"Project API Key",[572,689,690,691,694],{},"Copy the key (starts with ",[621,692,693],{},"phc_",")",[660,696,698],{"id":697},"_2-set-environment-variables","2. Set environment variables",[613,700,705],{"className":701,"code":702,"filename":703,"language":704,"meta":619,"style":619},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POSTHOG_API_KEY=phc_your-project-api-key\n",".env","bash",[621,706,707],{"__ignoreMap":619},[624,708,709,712,715],{"class":626,"line":627},[624,710,711],{"class":638},"POSTHOG_API_KEY",[624,713,714],{"class":634},"=",[624,716,717],{"class":651},"phc_your-project-api-key\n",[660,719,721],{"id":720},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[723,724,725,839,970,1032,1086,1145,1199,1252],"code-group",{},[613,726,729],{"className":615,"code":727,"filename":728,"language":618,"meta":619,"style":619},"\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n})\n","Nuxt \u002F Nitro",[621,730,731,737,756,763,794,830],{"__ignoreMap":619},[624,732,733],{"class":626,"line":627},[624,734,736],{"class":735},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[624,738,740,742,744,746,748,750,752,754],{"class":626,"line":739},2,[624,741,631],{"class":630},[624,743,635],{"class":634},[624,745,639],{"class":638},[624,747,642],{"class":634},[624,749,645],{"class":630},[624,751,648],{"class":634},[624,753,652],{"class":651},[624,755,655],{"class":634},[624,757,759],{"class":626,"line":758},3,[624,760,762],{"emptyLinePlaceholder":761},true,"\n",[624,764,766,769,772,776,779,781,785,787,791],{"class":626,"line":765},4,[624,767,768],{"class":630},"export",[624,770,771],{"class":630}," default",[624,773,775],{"class":774},"s2Zo4"," defineNitroPlugin",[624,777,778],{"class":638},"(",[624,780,778],{"class":634},[624,782,784],{"class":783},"sHdIc","nitroApp",[624,786,694],{"class":634},[624,788,790],{"class":789},"spNyl"," =>",[624,792,793],{"class":634}," {\n",[624,795,797,800,803,806,808,811,814,817,820,822,825,827],{"class":626,"line":796},5,[624,798,799],{"class":638},"  nitroApp",[624,801,802],{"class":634},".",[624,804,805],{"class":638},"hooks",[624,807,802],{"class":634},[624,809,810],{"class":774},"hook",[624,812,778],{"class":813},"swJcz",[624,815,816],{"class":634},"'",[624,818,819],{"class":651},"evlog:drain",[624,821,816],{"class":634},[624,823,824],{"class":634},",",[624,826,639],{"class":774},[624,828,829],{"class":813},"())\n",[624,831,833,836],{"class":626,"line":832},6,[624,834,835],{"class":634},"}",[624,837,838],{"class":638},")\n",[613,840,842],{"className":615,"code":841,"filename":235,"language":618,"meta":619,"style":619},"\u002F\u002F lib\u002Fevlog.ts\nimport { createEvlog } from 'evlog\u002Fnext'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport const { withEvlog, useLogger, log, createError } = createEvlog({\n  service: 'my-app',\n  drain: createPostHogDrain(),\n})\n",[621,843,844,849,869,887,891,930,948,963],{"__ignoreMap":619},[624,845,846],{"class":626,"line":627},[624,847,848],{"class":735},"\u002F\u002F lib\u002Fevlog.ts\n",[624,850,851,853,855,858,860,862,864,867],{"class":626,"line":739},[624,852,631],{"class":630},[624,854,635],{"class":634},[624,856,857],{"class":638}," createEvlog",[624,859,642],{"class":634},[624,861,645],{"class":630},[624,863,648],{"class":634},[624,865,866],{"class":651},"evlog\u002Fnext",[624,868,655],{"class":634},[624,870,871,873,875,877,879,881,883,885],{"class":626,"line":758},[624,872,631],{"class":630},[624,874,635],{"class":634},[624,876,639],{"class":638},[624,878,642],{"class":634},[624,880,645],{"class":630},[624,882,648],{"class":634},[624,884,652],{"class":651},[624,886,655],{"class":634},[624,888,889],{"class":626,"line":765},[624,890,762],{"emptyLinePlaceholder":761},[624,892,893,895,898,900,903,905,908,910,913,915,918,920,923,925,927],{"class":626,"line":796},[624,894,768],{"class":630},[624,896,897],{"class":789}," const",[624,899,635],{"class":634},[624,901,902],{"class":638}," withEvlog",[624,904,824],{"class":634},[624,906,907],{"class":638}," useLogger",[624,909,824],{"class":634},[624,911,912],{"class":638}," log",[624,914,824],{"class":634},[624,916,917],{"class":638}," createError ",[624,919,835],{"class":634},[624,921,922],{"class":634}," =",[624,924,857],{"class":774},[624,926,778],{"class":638},[624,928,929],{"class":634},"{\n",[624,931,932,935,938,940,943,945],{"class":626,"line":832},[624,933,934],{"class":813},"  service",[624,936,937],{"class":634},":",[624,939,648],{"class":634},[624,941,942],{"class":651},"my-app",[624,944,816],{"class":634},[624,946,947],{"class":634},",\n",[624,949,951,954,956,958,961],{"class":626,"line":950},7,[624,952,953],{"class":813},"  drain",[624,955,937],{"class":634},[624,957,639],{"class":774},[624,959,960],{"class":638},"()",[624,962,947],{"class":634},[624,964,966,968],{"class":626,"line":965},8,[624,967,835],{"class":634},[624,969,838],{"class":638},[613,971,973],{"className":615,"code":972,"filename":265,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\napp.use(evlog({ drain: createPostHogDrain() }))\n",[621,974,975,993,997],{"__ignoreMap":619},[624,976,977,979,981,983,985,987,989,991],{"class":626,"line":627},[624,978,631],{"class":630},[624,980,635],{"class":634},[624,982,639],{"class":638},[624,984,642],{"class":634},[624,986,645],{"class":630},[624,988,648],{"class":634},[624,990,652],{"class":651},[624,992,655],{"class":634},[624,994,995],{"class":626,"line":739},[624,996,762],{"emptyLinePlaceholder":761},[624,998,999,1002,1004,1007,1009,1012,1014,1017,1020,1022,1024,1027,1029],{"class":626,"line":758},[624,1000,1001],{"class":638},"app",[624,1003,802],{"class":634},[624,1005,1006],{"class":774},"use",[624,1008,778],{"class":638},[624,1010,1011],{"class":774},"evlog",[624,1013,778],{"class":638},[624,1015,1016],{"class":634},"{",[624,1018,1019],{"class":813}," drain",[624,1021,937],{"class":634},[624,1023,639],{"class":774},[624,1025,1026],{"class":638},"() ",[624,1028,835],{"class":634},[624,1030,1031],{"class":638},"))\n",[613,1033,1034],{"className":615,"code":972,"filename":260,"language":618,"meta":619,"style":619},[621,1035,1036,1054,1058],{"__ignoreMap":619},[624,1037,1038,1040,1042,1044,1046,1048,1050,1052],{"class":626,"line":627},[624,1039,631],{"class":630},[624,1041,635],{"class":634},[624,1043,639],{"class":638},[624,1045,642],{"class":634},[624,1047,645],{"class":630},[624,1049,648],{"class":634},[624,1051,652],{"class":651},[624,1053,655],{"class":634},[624,1055,1056],{"class":626,"line":739},[624,1057,762],{"emptyLinePlaceholder":761},[624,1059,1060,1062,1064,1066,1068,1070,1072,1074,1076,1078,1080,1082,1084],{"class":626,"line":758},[624,1061,1001],{"class":638},[624,1063,802],{"class":634},[624,1065,1006],{"class":774},[624,1067,778],{"class":638},[624,1069,1011],{"class":774},[624,1071,778],{"class":638},[624,1073,1016],{"class":634},[624,1075,1019],{"class":813},[624,1077,937],{"class":634},[624,1079,639],{"class":774},[624,1081,1026],{"class":638},[624,1083,835],{"class":634},[624,1085,1031],{"class":638},[613,1087,1089],{"className":615,"code":1088,"filename":270,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nawait app.register(evlog, { drain: createPostHogDrain() })\n",[621,1090,1091,1109,1113],{"__ignoreMap":619},[624,1092,1093,1095,1097,1099,1101,1103,1105,1107],{"class":626,"line":627},[624,1094,631],{"class":630},[624,1096,635],{"class":634},[624,1098,639],{"class":638},[624,1100,642],{"class":634},[624,1102,645],{"class":630},[624,1104,648],{"class":634},[624,1106,652],{"class":651},[624,1108,655],{"class":634},[624,1110,1111],{"class":626,"line":739},[624,1112,762],{"emptyLinePlaceholder":761},[624,1114,1115,1118,1121,1123,1126,1129,1131,1133,1135,1137,1139,1141,1143],{"class":626,"line":758},[624,1116,1117],{"class":630},"await",[624,1119,1120],{"class":638}," app",[624,1122,802],{"class":634},[624,1124,1125],{"class":774},"register",[624,1127,1128],{"class":638},"(evlog",[624,1130,824],{"class":634},[624,1132,635],{"class":634},[624,1134,1019],{"class":813},[624,1136,937],{"class":634},[624,1138,639],{"class":774},[624,1140,1026],{"class":638},[624,1142,835],{"class":634},[624,1144,838],{"class":638},[613,1146,1147],{"className":615,"code":972,"filename":275,"language":618,"meta":619,"style":619},[621,1148,1149,1167,1171],{"__ignoreMap":619},[624,1150,1151,1153,1155,1157,1159,1161,1163,1165],{"class":626,"line":627},[624,1152,631],{"class":630},[624,1154,635],{"class":634},[624,1156,639],{"class":638},[624,1158,642],{"class":634},[624,1160,645],{"class":630},[624,1162,648],{"class":634},[624,1164,652],{"class":651},[624,1166,655],{"class":634},[624,1168,1169],{"class":626,"line":739},[624,1170,762],{"emptyLinePlaceholder":761},[624,1172,1173,1175,1177,1179,1181,1183,1185,1187,1189,1191,1193,1195,1197],{"class":626,"line":758},[624,1174,1001],{"class":638},[624,1176,802],{"class":634},[624,1178,1006],{"class":774},[624,1180,778],{"class":638},[624,1182,1011],{"class":774},[624,1184,778],{"class":638},[624,1186,1016],{"class":634},[624,1188,1019],{"class":813},[624,1190,937],{"class":634},[624,1192,639],{"class":774},[624,1194,1026],{"class":638},[624,1196,835],{"class":634},[624,1198,1031],{"class":638},[613,1200,1202],{"className":615,"code":1201,"filename":255,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nEvlogModule.forRoot({ drain: createPostHogDrain() })\n",[621,1203,1204,1222,1226],{"__ignoreMap":619},[624,1205,1206,1208,1210,1212,1214,1216,1218,1220],{"class":626,"line":627},[624,1207,631],{"class":630},[624,1209,635],{"class":634},[624,1211,639],{"class":638},[624,1213,642],{"class":634},[624,1215,645],{"class":630},[624,1217,648],{"class":634},[624,1219,652],{"class":651},[624,1221,655],{"class":634},[624,1223,1224],{"class":626,"line":739},[624,1225,762],{"emptyLinePlaceholder":761},[624,1227,1228,1231,1233,1236,1238,1240,1242,1244,1246,1248,1250],{"class":626,"line":758},[624,1229,1230],{"class":638},"EvlogModule",[624,1232,802],{"class":634},[624,1234,1235],{"class":774},"forRoot",[624,1237,778],{"class":638},[624,1239,1016],{"class":634},[624,1241,1019],{"class":813},[624,1243,937],{"class":634},[624,1245,639],{"class":774},[624,1247,1026],{"class":638},[624,1249,835],{"class":634},[624,1251,838],{"class":638},[613,1253,1255],{"className":615,"code":1254,"filename":290,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\ninitLogger({ drain: createPostHogDrain() })\n",[621,1256,1257,1275,1279],{"__ignoreMap":619},[624,1258,1259,1261,1263,1265,1267,1269,1271,1273],{"class":626,"line":627},[624,1260,631],{"class":630},[624,1262,635],{"class":634},[624,1264,639],{"class":638},[624,1266,642],{"class":634},[624,1268,645],{"class":630},[624,1270,648],{"class":634},[624,1272,652],{"class":651},[624,1274,655],{"class":634},[624,1276,1277],{"class":626,"line":739},[624,1278,762],{"emptyLinePlaceholder":761},[624,1280,1281,1284,1286,1288,1290,1292,1294,1296,1298],{"class":626,"line":758},[624,1282,1283],{"class":774},"initLogger",[624,1285,778],{"class":638},[624,1287,1016],{"class":634},[624,1289,1019],{"class":813},[624,1291,937],{"class":634},[624,1293,639],{"class":774},[624,1295,1026],{"class":638},[624,1297,835],{"class":634},[624,1299,838],{"class":638},[545,1301,1302],{},"That's it! Your wide events will now appear in PostHog Logs with full OTLP structure including severity levels, trace context, and structured attributes.",[606,1304,508],{"id":1305},"configuration",[545,1307,1308],{},"The adapter reads configuration from multiple sources (highest priority first):",[569,1310,1311,1320,1330],{},[572,1312,1313,1316,1317],{},[678,1314,1315],{},"Overrides"," passed to ",[621,1318,1319],{},"createPostHogDrain()",[572,1321,1322,1325,1326,1329],{},[678,1323,1324],{},"Runtime config"," at ",[621,1327,1328],{},"runtimeConfig.posthog"," (Nuxt\u002FNitro only)",[572,1331,1332,1335,1336,694],{},[678,1333,1334],{},"Environment variables"," (",[621,1337,1338],{},"POSTHOG_*",[660,1340,1342],{"id":1341},"environment-variables","Environment Variables",[1344,1345,1346,1359],"table",{},[1347,1348,1349],"thead",{},[1350,1351,1352,1356],"tr",{},[1353,1354,1355],"th",{},"Variable",[1353,1357,1358],{},"Description",[1360,1361,1362,1374],"tbody",{},[1350,1363,1364,1369],{},[1365,1366,1367],"td",{},[621,1368,711],{},[1365,1370,1371,1372,694],{},"Project API key (starts with ",[621,1373,693],{},[1350,1375,1376,1381],{},[1365,1377,1378],{},[621,1379,1380],{},"POSTHOG_HOST",[1365,1382,1383],{},"PostHog host URL (for EU or self-hosted)",[660,1385,1387],{"id":1386},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[545,1389,1390,1391,1394],{},"Configure via ",[621,1392,1393],{},"nuxt.config.ts"," for type-safe configuration:",[613,1396,1398],{"className":615,"code":1397,"filename":1393,"language":618,"meta":619,"style":619},"export default defineNuxtConfig({\n  runtimeConfig: {\n    posthog: {\n      apiKey: '', \u002F\u002F Set via POSTHOG_API_KEY\n      host: '', \u002F\u002F Set via POSTHOG_HOST\n    },\n  },\n})\n",[621,1399,1400,1413,1422,1431,1446,1460,1465,1470],{"__ignoreMap":619},[624,1401,1402,1404,1406,1409,1411],{"class":626,"line":627},[624,1403,768],{"class":630},[624,1405,771],{"class":630},[624,1407,1408],{"class":774}," defineNuxtConfig",[624,1410,778],{"class":638},[624,1412,929],{"class":634},[624,1414,1415,1418,1420],{"class":626,"line":739},[624,1416,1417],{"class":813},"  runtimeConfig",[624,1419,937],{"class":634},[624,1421,793],{"class":634},[624,1423,1424,1427,1429],{"class":626,"line":758},[624,1425,1426],{"class":813},"    posthog",[624,1428,937],{"class":634},[624,1430,793],{"class":634},[624,1432,1433,1436,1438,1441,1443],{"class":626,"line":765},[624,1434,1435],{"class":813},"      apiKey",[624,1437,937],{"class":634},[624,1439,1440],{"class":634}," ''",[624,1442,824],{"class":634},[624,1444,1445],{"class":735}," \u002F\u002F Set via POSTHOG_API_KEY\n",[624,1447,1448,1451,1453,1455,1457],{"class":626,"line":796},[624,1449,1450],{"class":813},"      host",[624,1452,937],{"class":634},[624,1454,1440],{"class":634},[624,1456,824],{"class":634},[624,1458,1459],{"class":735}," \u002F\u002F Set via POSTHOG_HOST\n",[624,1461,1462],{"class":626,"line":832},[624,1463,1464],{"class":634},"    },\n",[624,1466,1467],{"class":626,"line":950},[624,1468,1469],{"class":634},"  },\n",[624,1471,1472,1474],{"class":626,"line":965},[624,1473,835],{"class":634},[624,1475,838],{"class":638},[660,1477,1479],{"id":1478},"override-options","Override Options",[545,1481,1482],{},"Pass options directly to override any configuration:",[613,1484,1487],{"className":615,"code":1485,"filename":1486,"language":618,"meta":619,"style":619},"const drain = createPostHogDrain({\n  host: 'https:\u002F\u002Feu.i.posthog.com',\n  timeout: 10000,\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[621,1488,1489,1505,1521,1534],{"__ignoreMap":619},[624,1490,1491,1494,1497,1499,1501,1503],{"class":626,"line":627},[624,1492,1493],{"class":789},"const",[624,1495,1496],{"class":638}," drain ",[624,1498,714],{"class":634},[624,1500,639],{"class":774},[624,1502,778],{"class":638},[624,1504,929],{"class":634},[624,1506,1507,1510,1512,1514,1517,1519],{"class":626,"line":739},[624,1508,1509],{"class":813},"  host",[624,1511,937],{"class":634},[624,1513,648],{"class":634},[624,1515,1516],{"class":651},"https:\u002F\u002Feu.i.posthog.com",[624,1518,816],{"class":634},[624,1520,947],{"class":634},[624,1522,1523,1526,1528,1532],{"class":626,"line":758},[624,1524,1525],{"class":813},"  timeout",[624,1527,937],{"class":634},[624,1529,1531],{"class":1530},"sbssI"," 10000",[624,1533,947],{"class":634},[624,1535,1536,1538],{"class":626,"line":765},[624,1537,835],{"class":634},[624,1539,838],{"class":638},[660,1541,1543],{"id":1542},"full-configuration-reference","Full Configuration Reference",[1344,1545,1546,1561],{},[1347,1547,1548],{},[1350,1549,1550,1553,1556,1559],{},[1353,1551,1552],{},"Option",[1353,1554,1555],{},"Type",[1353,1557,1558],{},"Default",[1353,1560,1358],{},[1360,1562,1563,1581,1600,1616,1635,1654,1678,1698],{},[1350,1564,1565,1570,1575,1578],{},[1365,1566,1567],{},[621,1568,1569],{},"apiKey",[1365,1571,1572],{},[621,1573,1574],{},"string",[1365,1576,1577],{},"-",[1365,1579,1580],{},"Project API key (required)",[1350,1582,1583,1588,1592,1597],{},[1365,1584,1585],{},[621,1586,1587],{},"host",[1365,1589,1590],{},[621,1591,1574],{},[1365,1593,1594],{},[621,1595,1596],{},"https:\u002F\u002Fus.i.posthog.com",[1365,1598,1599],{},"PostHog host URL",[1350,1601,1602,1607,1611,1613],{},[1365,1603,1604],{},[621,1605,1606],{},"distinctId",[1365,1608,1609],{},[621,1610,1574],{},[1365,1612,1577],{},[1365,1614,1615],{},"Static person identifier for every event",[1350,1617,1618,1623,1627,1632],{},[1365,1619,1620],{},[621,1621,1622],{},"distinctIdField",[1365,1624,1625],{},[621,1626,1574],{},[1365,1628,1629],{},[621,1630,1631],{},"userId",[1365,1633,1634],{},"Event field holding the person identifier (dot path)",[1350,1636,1637,1642,1646,1651],{},[1365,1638,1639],{},[621,1640,1641],{},"sessionIdField",[1365,1643,1644],{},[621,1645,1574],{},[1365,1647,1648],{},[621,1649,1650],{},"sessionId",[1365,1652,1653],{},"Event field holding the PostHog session id (dot path)",[1350,1655,1656,1661,1666,1671],{},[1365,1657,1658],{},[621,1659,1660],{},"recordShape",[1365,1662,1663],{},[621,1664,1665],{},"'json' | 'compact'",[1365,1667,1668],{},[621,1669,1670],{},"'json'",[1365,1672,1673,1674],{},"Log record shape, see ",[548,1675,1677],{"href":1676},"#choose-a-record-shape","below",[1350,1679,1680,1685,1690,1695],{},[1365,1681,1682],{},[621,1683,1684],{},"timeout",[1365,1686,1687],{},[621,1688,1689],{},"number",[1365,1691,1692],{},[621,1693,1694],{},"5000",[1365,1696,1697],{},"Request timeout in milliseconds",[1350,1699,1700,1705,1709,1714],{},[1365,1701,1702],{},[621,1703,1704],{},"retries",[1365,1706,1707],{},[621,1708,1689],{},[1365,1710,1711],{},[621,1712,1713],{},"2",[1365,1715,1716],{},"Retry attempts on transient failures",[606,1718,1720],{"id":1719},"what-happens-between-a-log-and-posthog","What happens between a log and PostHog",[545,1722,1723,1724,1726,1727,1730],{},"Under the hood, ",[621,1725,1319],{}," wraps the OTLP adapter's ",[621,1728,1729],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[1732,1733,1734,1744,1753,1763],"ul",{},[572,1735,1736,1739,1740,1743],{},[678,1737,1738],{},"Endpoint",": ",[621,1741,1742],{},"{host}\u002Fi\u002Fv1\u002Flogs"," (PostHog's OTLP log ingest endpoint)",[572,1745,1746,1739,1749,1752],{},[678,1747,1748],{},"Auth",[621,1750,1751],{},"Authorization: Bearer {apiKey}"," header",[572,1754,1755,1758,1759,1762],{},[678,1756,1757],{},"Format",": Standard OTLP ",[621,1760,1761],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[572,1764,1765,1739,1768,1771,1772,1774],{},[678,1766,1767],{},"Identity",[621,1769,1770],{},"posthogDistinctId"," and ",[621,1773,1650],{}," attributes, which is how PostHog joins a log to the rest of your project data",[606,1776,1778],{"id":1777},"choose-a-record-shape","Choose a record shape",[545,1780,1781,1782,1785,1786,1789,1790,1793],{},"PostHog treats log attributes as facets: you filter, break down, and alert on them. With the default ",[621,1783,1784],{},"json"," shape a nested field arrives as one serialized attribute (",[621,1787,1788],{},"ai"," = ",[621,1791,1792],{},"{\"calls\":2,\"costUsd\":0.0012}","), which PostHog can display but not chart.",[545,1795,1796,1799,1800,1771,1803,1806],{},[621,1797,1798],{},"compact"," flattens those into ",[621,1801,1802],{},"ai.calls",[621,1804,1805],{},"ai.costUsd",", and replaces the body with a one-line summary instead of repeating the whole event:",[613,1808,1810],{"className":615,"code":1809,"filename":1486,"language":618,"meta":619,"style":619},"const drain = createPostHogDrain({ recordShape: 'compact' })\n",[621,1811,1812],{"__ignoreMap":619},[624,1813,1814,1816,1818,1820,1822,1824,1826,1829,1831,1833,1835,1837,1839],{"class":626,"line":627},[624,1815,1493],{"class":789},[624,1817,1496],{"class":638},[624,1819,714],{"class":634},[624,1821,639],{"class":774},[624,1823,778],{"class":638},[624,1825,1016],{"class":634},[624,1827,1828],{"class":813}," recordShape",[624,1830,937],{"class":634},[624,1832,648],{"class":634},[624,1834,1798],{"class":651},[624,1836,816],{"class":634},[624,1838,642],{"class":634},[624,1840,838],{"class":638},[545,1842,1843],{},"This is the recommended shape for PostHog. It also cuts what you send: Logs is billed per GB ingested, and the default shape transmits every field twice: once in the body, once in the attributes.",[1845,1846,1848,1850,1851,1853],"callout",{"color":1847,"icon":13},"info",[621,1849,1798],{}," becomes the default in the next major. Set it on a new project now; switching later means rewriting the saved views and alerts built on the ",[621,1852,1784],{}," shape.",[606,1855,1857],{"id":1856},"link-a-log-to-a-person-and-a-session-replay","Link a log to a person and a session replay",[545,1859,1860,1861,1864],{},"A log that carries a person identifier shows up on that person's profile in PostHog, under the ",[678,1862,1863],{},"Logs"," tab, with no service-name guessing to find what a specific user hit. Carry a session id too and the log links to their session replay.",[545,1866,1867,1868,1870,1871,1873],{},"PostHog reads both from log attributes: ",[621,1869,1770],{}," for the person, ",[621,1872,1650],{}," for the replay. The adapter fills them from your wide event, so this works as soon as your event carries the values:",[613,1875,1878],{"className":615,"code":1876,"filename":1877,"language":618,"meta":619,"style":619},"const log = useLogger(event)\n\nlog.set({\n  userId: user.id, \u002F\u002F → posthogDistinctId, links to the person\n  sessionId: body.sessionId, \u002F\u002F → sessionId, links to the session replay\n})\n","server\u002Fapi\u002Fcheckout.post.ts",[621,1879,1880,1894,1898,1912,1932,1951],{"__ignoreMap":619},[624,1881,1882,1884,1887,1889,1891],{"class":626,"line":627},[624,1883,1493],{"class":789},[624,1885,1886],{"class":638}," log ",[624,1888,714],{"class":634},[624,1890,907],{"class":774},[624,1892,1893],{"class":638},"(event)\n",[624,1895,1896],{"class":626,"line":739},[624,1897,762],{"emptyLinePlaceholder":761},[624,1899,1900,1903,1905,1908,1910],{"class":626,"line":758},[624,1901,1902],{"class":638},"log",[624,1904,802],{"class":634},[624,1906,1907],{"class":774},"set",[624,1909,778],{"class":638},[624,1911,929],{"class":634},[624,1913,1914,1917,1919,1922,1924,1927,1929],{"class":626,"line":765},[624,1915,1916],{"class":813},"  userId",[624,1918,937],{"class":634},[624,1920,1921],{"class":638}," user",[624,1923,802],{"class":634},[624,1925,1926],{"class":638},"id",[624,1928,824],{"class":634},[624,1930,1931],{"class":735}," \u002F\u002F → posthogDistinctId, links to the person\n",[624,1933,1934,1937,1939,1942,1944,1946,1948],{"class":626,"line":796},[624,1935,1936],{"class":813},"  sessionId",[624,1938,937],{"class":634},[624,1940,1941],{"class":638}," body",[624,1943,802],{"class":634},[624,1945,1650],{"class":638},[624,1947,824],{"class":634},[624,1949,1950],{"class":735}," \u002F\u002F → sessionId, links to the session replay\n",[624,1952,1953,1955],{"class":626,"line":832},[624,1954,835],{"class":634},[624,1956,838],{"class":638},[545,1958,1959,1960,1963],{},"The session id comes from the frontend. Read it with ",[621,1961,1962],{},"posthog.get_session_id()"," and send it along with the request:",[613,1965,1968],{"className":615,"code":1966,"filename":1967,"language":618,"meta":619,"style":619},"import posthog from 'posthog-js'\n\nawait $fetch('\u002Fapi\u002Fcheckout', {\n  method: 'POST',\n  body: { ...payload, sessionId: posthog.get_session_id() },\n})\n","app\u002Fcheckout.ts",[621,1969,1970,1987,1991,2011,2027,2062],{"__ignoreMap":619},[624,1971,1972,1974,1977,1980,1982,1985],{"class":626,"line":627},[624,1973,631],{"class":630},[624,1975,1976],{"class":638}," posthog ",[624,1978,1979],{"class":630},"from",[624,1981,648],{"class":634},[624,1983,1984],{"class":651},"posthog-js",[624,1986,655],{"class":634},[624,1988,1989],{"class":626,"line":739},[624,1990,762],{"emptyLinePlaceholder":761},[624,1992,1993,1995,1998,2000,2002,2005,2007,2009],{"class":626,"line":758},[624,1994,1117],{"class":630},[624,1996,1997],{"class":774}," $fetch",[624,1999,778],{"class":638},[624,2001,816],{"class":634},[624,2003,2004],{"class":651},"\u002Fapi\u002Fcheckout",[624,2006,816],{"class":634},[624,2008,824],{"class":634},[624,2010,793],{"class":634},[624,2012,2013,2016,2018,2020,2023,2025],{"class":626,"line":765},[624,2014,2015],{"class":813},"  method",[624,2017,937],{"class":634},[624,2019,648],{"class":634},[624,2021,2022],{"class":651},"POST",[624,2024,816],{"class":634},[624,2026,947],{"class":634},[624,2028,2029,2032,2034,2036,2039,2042,2044,2047,2049,2052,2054,2057,2059],{"class":626,"line":796},[624,2030,2031],{"class":813},"  body",[624,2033,937],{"class":634},[624,2035,635],{"class":634},[624,2037,2038],{"class":634}," ...",[624,2040,2041],{"class":638},"payload",[624,2043,824],{"class":634},[624,2045,2046],{"class":813}," sessionId",[624,2048,937],{"class":634},[624,2050,2051],{"class":638}," posthog",[624,2053,802],{"class":634},[624,2055,2056],{"class":774},"get_session_id",[624,2058,1026],{"class":638},[624,2060,2061],{"class":634},"},\n",[624,2063,2064,2066],{"class":626,"line":832},[624,2065,835],{"class":634},[624,2067,838],{"class":638},[660,2069,2071],{"id":2070},"point-at-your-own-fields","Point at your own fields",[545,2073,2074],{},"When identity lives somewhere else on your events, point the adapter at it. Both options take a dot path:",[613,2076,2078],{"className":615,"code":2077,"filename":1486,"language":618,"meta":619,"style":619},"const drain = createPostHogDrain({\n  distinctIdField: 'user.id',\n  sessionIdField: 'session.id',\n})\n",[621,2079,2080,2094,2110,2126],{"__ignoreMap":619},[624,2081,2082,2084,2086,2088,2090,2092],{"class":626,"line":627},[624,2083,1493],{"class":789},[624,2085,1496],{"class":638},[624,2087,714],{"class":634},[624,2089,639],{"class":774},[624,2091,778],{"class":638},[624,2093,929],{"class":634},[624,2095,2096,2099,2101,2103,2106,2108],{"class":626,"line":739},[624,2097,2098],{"class":813},"  distinctIdField",[624,2100,937],{"class":634},[624,2102,648],{"class":634},[624,2104,2105],{"class":651},"user.id",[624,2107,816],{"class":634},[624,2109,947],{"class":634},[624,2111,2112,2115,2117,2119,2122,2124],{"class":626,"line":758},[624,2113,2114],{"class":813},"  sessionIdField",[624,2116,937],{"class":634},[624,2118,648],{"class":634},[624,2120,2121],{"class":651},"session.id",[624,2123,816],{"class":634},[624,2125,947],{"class":634},[624,2127,2128,2130],{"class":626,"line":765},[624,2129,835],{"class":634},[624,2131,838],{"class":638},[545,2133,2134,2135,2138],{},"For an ",[548,2136,2137],{"href":437},"eve agent",", the caller principal is the identity eve itself routes on:",[613,2140,2143],{"className":615,"code":2141,"filename":2142,"language":618,"meta":619,"style":619},"const drain = createPostHogDrain({ distinctIdField: 'eve.caller.principalId' })\n","agent\u002Fhooks\u002Fevlog.ts",[621,2144,2145],{"__ignoreMap":619},[624,2146,2147,2149,2151,2153,2155,2157,2159,2162,2164,2166,2169,2171,2173],{"class":626,"line":627},[624,2148,1493],{"class":789},[624,2150,1496],{"class":638},[624,2152,714],{"class":634},[624,2154,639],{"class":774},[624,2156,778],{"class":638},[624,2158,1016],{"class":634},[624,2160,2161],{"class":813}," distinctIdField",[624,2163,937],{"class":634},[624,2165,648],{"class":634},[624,2167,2168],{"class":651},"eve.caller.principalId",[624,2170,816],{"class":634},[624,2172,642],{"class":634},[624,2174,838],{"class":638},[545,2176,2177,2178,2180],{},"A static ",[621,2179,1606],{}," overrides the field lookup entirely. Use it for a backend that acts as one identity rather than on behalf of users.",[1845,2182,2183,2184,2187,2188,681,2190,2192,2193,2195],{"color":1847,"icon":13},"PostHog matches the attribute value against every ",[621,2185,2186],{},"distinct_id"," it knows for a person, so any one of their identifiers works. The attribute key is configurable per project under ",[678,2189,680],{},[678,2191,1863],{},". Leave it at the default ",[621,2194,1770],{}," and this works out of the box.",[606,2197,2199],{"id":2198},"regions","Regions",[545,2201,2202,2203,2205],{},"PostHog offers US and EU cloud hosting. Set the ",[621,2204,1587],{}," to match your region:",[1344,2207,2208,2218],{},[1347,2209,2210],{},[1350,2211,2212,2215],{},[1353,2213,2214],{},"Region",[1353,2216,2217],{},"Host",[1360,2219,2220,2229,2238],{},[1350,2221,2222,2225],{},[1365,2223,2224],{},"US (default)",[1365,2226,2227],{},[621,2228,1596],{},[1350,2230,2231,2234],{},[1365,2232,2233],{},"EU",[1365,2235,2236],{},[621,2237,1516],{},[1350,2239,2240,2243],{},[1365,2241,2242],{},"Self-hosted",[1365,2244,2245],{},"Your instance URL",[613,2247,2249],{"className":701,"code":2248,"filename":703,"language":704,"meta":619,"style":619},"# EU region\nPOSTHOG_API_KEY=phc_xxx\nPOSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[621,2250,2251,2256,2265],{"__ignoreMap":619},[624,2252,2253],{"class":626,"line":627},[624,2254,2255],{"class":735},"# EU region\n",[624,2257,2258,2260,2262],{"class":626,"line":739},[624,2259,711],{"class":638},[624,2261,714],{"class":634},[624,2263,2264],{"class":651},"phc_xxx\n",[624,2266,2267,2269,2271],{"class":626,"line":758},[624,2268,1380],{"class":638},[624,2270,714],{"class":634},[624,2272,2273],{"class":651},"https:\u002F\u002Feu.i.posthog.com\n",[606,2275,2277],{"id":2276},"query-the-logs-in-posthog","Query the logs in PostHog",[545,2279,2280,2281,2283],{},"Once your logs are flowing, use the ",[678,2282,1863],{}," tab in PostHog to query them:",[569,2285,2286,2291,2294],{},[572,2287,676,2288,2290],{},[678,2289,1863],{}," and filter by service, severity, or any structured attribute",[572,2292,2293],{},"Use the search bar to find specific log entries",[572,2295,2296],{},"Click on a log entry to see all structured attributes",[606,2298,2300],{"id":2299},"send-custom-events-alongside-logs","Send custom events alongside logs",[545,2302,2303,2304,2306,2307,937],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[621,2305,1319],{}," with ",[621,2308,2309],{},"mode: 'events'",[613,2311,2313],{"className":615,"code":2312,"filename":1486,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst drain = createPostHogDrain({\n  mode: 'events',\n  eventName: 'server_request',\n  distinctId: 'my-backend-service',\n})\n",[621,2314,2315,2333,2337,2351,2367,2383,2399],{"__ignoreMap":619},[624,2316,2317,2319,2321,2323,2325,2327,2329,2331],{"class":626,"line":627},[624,2318,631],{"class":630},[624,2320,635],{"class":634},[624,2322,639],{"class":638},[624,2324,642],{"class":634},[624,2326,645],{"class":630},[624,2328,648],{"class":634},[624,2330,652],{"class":651},[624,2332,655],{"class":634},[624,2334,2335],{"class":626,"line":739},[624,2336,762],{"emptyLinePlaceholder":761},[624,2338,2339,2341,2343,2345,2347,2349],{"class":626,"line":758},[624,2340,1493],{"class":789},[624,2342,1496],{"class":638},[624,2344,714],{"class":634},[624,2346,639],{"class":774},[624,2348,778],{"class":638},[624,2350,929],{"class":634},[624,2352,2353,2356,2358,2360,2363,2365],{"class":626,"line":765},[624,2354,2355],{"class":813},"  mode",[624,2357,937],{"class":634},[624,2359,648],{"class":634},[624,2361,2362],{"class":651},"events",[624,2364,816],{"class":634},[624,2366,947],{"class":634},[624,2368,2369,2372,2374,2376,2379,2381],{"class":626,"line":796},[624,2370,2371],{"class":813},"  eventName",[624,2373,937],{"class":634},[624,2375,648],{"class":634},[624,2377,2378],{"class":651},"server_request",[624,2380,816],{"class":634},[624,2382,947],{"class":634},[624,2384,2385,2388,2390,2392,2395,2397],{"class":626,"line":832},[624,2386,2387],{"class":813},"  distinctId",[624,2389,937],{"class":634},[624,2391,648],{"class":634},[624,2393,2394],{"class":651},"my-backend-service",[624,2396,816],{"class":634},[624,2398,947],{"class":634},[624,2400,2401,2403],{"class":626,"line":950},[624,2402,835],{"class":634},[624,2404,838],{"class":638},[545,2406,2407,2408,2411,2412,2415],{},"Then pass ",[621,2409,2410],{},"drain"," to your framework the same way as the default logs drain (see ",[548,2413,25],{"href":2414},"#quick-start"," above).",[1845,2417,2418,2419,2421],{"color":1847,"icon":13},"Custom events count towards your PostHog event quota. PostHog Logs (the default ",[621,2420,1319],{},") is significantly cheaper.",[1845,2423,2426,2429,2430,2433,2434,2437],{"color":2424,"icon":2425},"warning","i-lucide-triangle-alert",[678,2427,2428],{},"Legacy:"," ",[621,2431,2432],{},"createPostHogEventsDrain()"," is deprecated and re-routes to ",[621,2435,2436],{},"createPostHogDrain({ mode: 'events' })",". It will be removed in the next major release.",[660,2439,2441],{"id":2440},"configure-which-events-go-out","Configure which events go out",[1344,2443,2444,2456],{},[1347,2445,2446],{},[1350,2447,2448,2450,2452,2454],{},[1353,2449,1552],{},[1353,2451,1555],{},[1353,2453,1558],{},[1353,2455,1358],{},[1360,2457,2458,2472,2488,2507,2525,2545,2568],{},[1350,2459,2460,2464,2468,2470],{},[1365,2461,2462],{},[621,2463,1569],{},[1365,2465,2466],{},[621,2467,1574],{},[1365,2469,1577],{},[1365,2471,1580],{},[1350,2473,2474,2478,2482,2486],{},[1365,2475,2476],{},[621,2477,1587],{},[1365,2479,2480],{},[621,2481,1574],{},[1365,2483,2484],{},[621,2485,1596],{},[1365,2487,1599],{},[1350,2489,2490,2495,2499,2504],{},[1365,2491,2492],{},[621,2493,2494],{},"eventName",[1365,2496,2497],{},[621,2498,1574],{},[1365,2500,2501],{},[621,2502,2503],{},"evlog_wide_event",[1365,2505,2506],{},"PostHog event name",[1350,2508,2509,2513,2517,2519],{},[1365,2510,2511],{},[621,2512,1606],{},[1365,2514,2515],{},[621,2516,1574],{},[1365,2518,1577],{},[1365,2520,2521,2522,2524],{},"Static ",[621,2523,2186],{}," for all events",[1350,2526,2527,2531,2535,2539],{},[1365,2528,2529],{},[621,2530,1622],{},[1365,2532,2533],{},[621,2534,1574],{},[1365,2536,2537],{},[621,2538,1631],{},[1365,2540,2541,2542,2544],{},"Event field holding the ",[621,2543,2186],{}," (dot path)",[1350,2546,2547,2551,2555,2559],{},[1365,2548,2549],{},[621,2550,1660],{},[1365,2552,2553],{},[621,2554,1665],{},[1365,2556,2557],{},[621,2558,1670],{},[1365,2560,2561,2562,2564,2565,694],{},"Event property shape: ",[621,2563,1798],{}," flattens nested fields (see ",[548,2566,1677],{"href":2567},"#event-format",[1350,2569,2570,2574,2578,2582],{},[1365,2571,2572],{},[621,2573,1684],{},[1365,2575,2576],{},[621,2577,1689],{},[1365,2579,2580],{},[621,2581,1694],{},[1365,2583,1697],{},[660,2585,2587],{"id":2586},"event-format","Event Format",[545,2589,2590],{},"evlog maps wide events to PostHog events:",[1344,2592,2593,2603],{},[1347,2594,2595],{},[1350,2596,2597,2600],{},[1353,2598,2599],{},"evlog Field",[1353,2601,2602],{},"PostHog Field",[1360,2604,2605,2623,2634,2646,2657,2669],{},[1350,2606,2607,2618],{},[1365,2608,2609,2612,2613,2612,2615],{},[621,2610,2611],{},"config.distinctId"," or ",[621,2614,1631],{},[621,2616,2617],{},"service",[1365,2619,2620,2622],{},[621,2621,2186],{}," (fallback chain)",[1350,2624,2625,2630],{},[1365,2626,2627],{},[621,2628,2629],{},"timestamp",[1365,2631,2632],{},[621,2633,2629],{},[1350,2635,2636,2641],{},[1365,2637,2638],{},[621,2639,2640],{},"level",[1365,2642,2643],{},[621,2644,2645],{},"properties.level",[1350,2647,2648,2652],{},[1365,2649,2650],{},[621,2651,2617],{},[1365,2653,2654],{},[621,2655,2656],{},"properties.service",[1350,2658,2659,2664],{},[1365,2660,2661],{},[621,2662,2663],{},"environment",[1365,2665,2666],{},[621,2667,2668],{},"properties.environment",[1350,2670,2671,2674],{},[1365,2672,2673],{},"All other fields",[1365,2675,2676],{},[621,2677,2678],{},"properties.*",[545,2680,2681,2682,2685,2686,2688,2689,1771,2692,2695,2696,2699,2700,2702,2703,2705],{},"With ",[621,2683,2684],{},"recordShape: 'compact'",", the other fields are flattened into dotted keys the same way as in logs mode: a nested ",[621,2687,1788],{}," object arrives as ",[621,2690,2691],{},"properties.ai.costUsd",[621,2693,2694],{},"properties.ai.calls"," instead of one opaque ",[621,2697,2698],{},"properties.ai"," value. PostHog can filter and break down on those individual properties; the default ",[621,2701,1784],{}," shape keeps the nested object as a single serialized property. See ",[548,2704,1778],{"href":1676}," for the trade-off and how it affects your saved views and alerts.",[660,2707,2709],{"id":2708},"how-the-distinct-id-is-resolved","How the distinct ID is resolved",[545,2711,2712,2713,2715],{},"The ",[621,2714,2186],{}," follows a fallback chain:",[569,2717,2718,2727,2738],{},[572,2719,2720,2724,2725],{},[678,2721,2722],{},[621,2723,2611],{}," - explicit override in ",[621,2726,2436],{},[572,2728,2729,2734,2735,2737],{},[678,2730,2731],{},[621,2732,2733],{},"event.userId"," - or whatever ",[621,2736,1622],{}," points at, when it holds a string or a number",[572,2739,2740,2745],{},[678,2741,2742],{},[621,2743,2744],{},"event.service"," - final fallback, sent as an anonymous event",[660,2747,2749],{"id":2748},"identified-and-anonymous-events","Identified and anonymous events",[545,2751,2752,2753,2756],{},"An event that resolves to a real person is an ",[678,2754,2755],{},"identified"," event: PostHog creates a person profile for it and attaches person properties.",[545,2758,2759,2760,1335,2763,2766],{},"When no identifier resolves, the event is sent as ",[678,2761,2762],{},"anonymous",[621,2764,2765],{},"$process_person_profile: false",") rather than piling every request onto one \"person\" named after your service. PostHog bills anonymous events at a lower rate and keeps them out of person profiles.",[613,2768,2770],{"className":615,"code":2769,"filename":1486,"language":618,"meta":619,"style":619},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\nconst drain = createPostHogDrain({ mode: 'events' })\n\n\u002F\u002F Identified as one backend identity, whatever the request\nconst service = createPostHogDrain({ mode: 'events', distinctId: 'checkout-worker' })\n",[621,2771,2772,2777,2806,2810,2815],{"__ignoreMap":619},[624,2773,2774],{"class":626,"line":627},[624,2775,2776],{"class":735},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\n",[624,2778,2779,2781,2783,2785,2787,2789,2791,2794,2796,2798,2800,2802,2804],{"class":626,"line":739},[624,2780,1493],{"class":789},[624,2782,1496],{"class":638},[624,2784,714],{"class":634},[624,2786,639],{"class":774},[624,2788,778],{"class":638},[624,2790,1016],{"class":634},[624,2792,2793],{"class":813}," mode",[624,2795,937],{"class":634},[624,2797,648],{"class":634},[624,2799,2362],{"class":651},[624,2801,816],{"class":634},[624,2803,642],{"class":634},[624,2805,838],{"class":638},[624,2807,2808],{"class":626,"line":758},[624,2809,762],{"emptyLinePlaceholder":761},[624,2811,2812],{"class":626,"line":765},[624,2813,2814],{"class":735},"\u002F\u002F Identified as one backend identity, whatever the request\n",[624,2816,2817,2819,2822,2824,2826,2828,2830,2832,2834,2836,2838,2840,2842,2845,2847,2849,2852,2854,2856],{"class":626,"line":796},[624,2818,1493],{"class":789},[624,2820,2821],{"class":638}," service ",[624,2823,714],{"class":634},[624,2825,639],{"class":774},[624,2827,778],{"class":638},[624,2829,1016],{"class":634},[624,2831,2793],{"class":813},[624,2833,937],{"class":634},[624,2835,648],{"class":634},[624,2837,2362],{"class":651},[624,2839,816],{"class":634},[624,2841,824],{"class":634},[624,2843,2844],{"class":813}," distinctId",[624,2846,937],{"class":634},[624,2848,648],{"class":634},[624,2850,2851],{"class":651},"checkout-worker",[624,2853,816],{"class":634},[624,2855,642],{"class":634},[624,2857,838],{"class":638},[1845,2859,2860],{"color":1847,"icon":13},"Anonymous events can be up to 4× cheaper than identified ones. Only set an identity on the events where you actually need per-person analysis.",[660,2862,2864],{"id":2863},"when-to-use-a-log-and-when-to-use-an-event","When to use a log and when to use an event",[1344,2866,2867,2881],{},[1347,2868,2869],{},[1350,2870,2871,2873,2877],{},[1353,2872],{},[1353,2874,2875],{},[621,2876,1319],{},[1353,2878,2879],{},[621,2880,2436],{},[1360,2882,2883,2901,2914,2926],{},[1350,2884,2885,2889,2895],{},[1365,2886,2887],{},[678,2888,1757],{},[1365,2890,2891,2892,694],{},"OTLP Logs (",[621,2893,2894],{},"\u002Fi\u002Fv1\u002Flogs",[1365,2896,2897,2898,694],{},"PostHog Events (",[621,2899,2900],{},"\u002Fbatch\u002F",[1350,2902,2903,2908,2911],{},[1365,2904,2905],{},[678,2906,2907],{},"PostHog UI",[1365,2909,2910],{},"Logs viewer",[1365,2912,2913],{},"Events explorer",[1350,2915,2916,2920,2923],{},[1365,2917,2918],{},[678,2919,534],{},[1365,2921,2922],{},"Lower (dedicated logs pipeline)",[1365,2924,2925],{},"Higher (counts as events)",[1350,2927,2928,2933,2936],{},[1365,2929,2930],{},[678,2931,2932],{},"Best for",[1365,2934,2935],{},"Debugging, log search, observability",[1365,2937,2938],{},"Product analytics, cohorts, funnels",[545,2940,2941],{},"You can use both drains simultaneously to get the best of both worlds:",[613,2943,2945],{"className":615,"code":2944,"filename":1486,"language":618,"meta":619,"style":619},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst logs = createPostHogDrain()\nconst events = createPostHogDrain({ mode: 'events' })\n\nconst drain = async (ctx) => {\n  await Promise.allSettled([logs(ctx), events(ctx)])\n}\n",[621,2946,2947,2965,2969,2983,3012,3016,3038,3076],{"__ignoreMap":619},[624,2948,2949,2951,2953,2955,2957,2959,2961,2963],{"class":626,"line":627},[624,2950,631],{"class":630},[624,2952,635],{"class":634},[624,2954,639],{"class":638},[624,2956,642],{"class":634},[624,2958,645],{"class":630},[624,2960,648],{"class":634},[624,2962,652],{"class":651},[624,2964,655],{"class":634},[624,2966,2967],{"class":626,"line":739},[624,2968,762],{"emptyLinePlaceholder":761},[624,2970,2971,2973,2976,2978,2980],{"class":626,"line":758},[624,2972,1493],{"class":789},[624,2974,2975],{"class":638}," logs ",[624,2977,714],{"class":634},[624,2979,639],{"class":774},[624,2981,2982],{"class":638},"()\n",[624,2984,2985,2987,2990,2992,2994,2996,2998,3000,3002,3004,3006,3008,3010],{"class":626,"line":765},[624,2986,1493],{"class":789},[624,2988,2989],{"class":638}," events ",[624,2991,714],{"class":634},[624,2993,639],{"class":774},[624,2995,778],{"class":638},[624,2997,1016],{"class":634},[624,2999,2793],{"class":813},[624,3001,937],{"class":634},[624,3003,648],{"class":634},[624,3005,2362],{"class":651},[624,3007,816],{"class":634},[624,3009,642],{"class":634},[624,3011,838],{"class":638},[624,3013,3014],{"class":626,"line":796},[624,3015,762],{"emptyLinePlaceholder":761},[624,3017,3018,3020,3022,3024,3027,3029,3032,3034,3036],{"class":626,"line":832},[624,3019,1493],{"class":789},[624,3021,1496],{"class":638},[624,3023,714],{"class":634},[624,3025,3026],{"class":789}," async",[624,3028,1335],{"class":634},[624,3030,3031],{"class":783},"ctx",[624,3033,694],{"class":634},[624,3035,790],{"class":789},[624,3037,793],{"class":634},[624,3039,3040,3043,3047,3049,3052,3055,3058,3060,3062,3064,3066,3069,3071,3073],{"class":626,"line":950},[624,3041,3042],{"class":630},"  await",[624,3044,3046],{"class":3045},"sBMFI"," Promise",[624,3048,802],{"class":634},[624,3050,3051],{"class":774},"allSettled",[624,3053,3054],{"class":813},"([",[624,3056,3057],{"class":774},"logs",[624,3059,778],{"class":813},[624,3061,3031],{"class":638},[624,3063,694],{"class":813},[624,3065,824],{"class":634},[624,3067,3068],{"class":774}," events",[624,3070,778],{"class":813},[624,3072,3031],{"class":638},[624,3074,3075],{"class":813},")])\n",[624,3077,3078],{"class":626,"line":965},[624,3079,3080],{"class":634},"}\n",[606,3082,3084],{"id":3083},"troubleshooting","Troubleshooting",[660,3086,3088],{"id":3087},"missing-apikey-error","Missing apiKey error",[613,3090,3096],{"className":3091,"code":3093,"filename":3094,"language":3095,"meta":619},[3092],"language-text","[evlog\u002Fposthog] Missing apiKey. Set POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","Console","text",[621,3097,3093],{"__ignoreMap":619},[545,3099,3100],{},"Make sure your environment variable is set and the server was restarted after adding it.",[660,3102,3104],{"id":3103},"events-not-appearing","Events not appearing",[545,3106,3107],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[569,3109,3110,3117,3122],{},[572,3111,3112,3113,3116],{},"Check the server console for ",[621,3114,3115],{},"[evlog\u002Fposthog]"," error messages",[572,3118,3119,3120],{},"Verify your API key is correct and starts with ",[621,3121,693],{},[572,3123,3124,3125,3127],{},"Confirm your ",[621,3126,1587],{}," matches your PostHog region (US vs EU)",[660,3129,3131],{"id":3130},"wrong-region","Wrong region",[545,3133,3134,3135,3137],{},"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 ",[621,3136,3115],{},") to your server console. Set the correct host:",[613,3139,3141],{"className":701,"code":3140,"filename":703,"language":704,"meta":619,"style":619},"POSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[621,3142,3143],{"__ignoreMap":619},[624,3144,3145,3147,3149],{"class":626,"line":627},[624,3146,1380],{"class":638},[624,3148,714],{"class":634},[624,3150,2273],{"class":651},[606,3152,3154],{"id":3153},"call-the-drain-without-a-framework","Call the drain without a framework",[545,3156,3157],{},"For advanced use cases, you can use the lower-level functions:",[613,3159,3162],{"className":615,"code":3160,"filename":3161,"language":618,"meta":619,"style":619},"import { sendToPostHog, sendBatchToPostHog } from 'evlog\u002Fposthog'\n\n\u002F\u002F Send a single event to PostHog Logs (OTLP)\nawait sendToPostHog(event, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Send multiple events in one request\nawait sendBatchToPostHog(events, {\n  apiKey: 'phc_xxx',\n})\n","server\u002Futils\u002Fposthog.ts",[621,3163,3164,3188,3192,3197,3210,3226,3232,3236,3241,3255,3270],{"__ignoreMap":619},[624,3165,3166,3168,3170,3173,3175,3178,3180,3182,3184,3186],{"class":626,"line":627},[624,3167,631],{"class":630},[624,3169,635],{"class":634},[624,3171,3172],{"class":638}," sendToPostHog",[624,3174,824],{"class":634},[624,3176,3177],{"class":638}," sendBatchToPostHog",[624,3179,642],{"class":634},[624,3181,645],{"class":630},[624,3183,648],{"class":634},[624,3185,652],{"class":651},[624,3187,655],{"class":634},[624,3189,3190],{"class":626,"line":739},[624,3191,762],{"emptyLinePlaceholder":761},[624,3193,3194],{"class":626,"line":758},[624,3195,3196],{"class":735},"\u002F\u002F Send a single event to PostHog Logs (OTLP)\n",[624,3198,3199,3201,3203,3206,3208],{"class":626,"line":765},[624,3200,1117],{"class":630},[624,3202,3172],{"class":774},[624,3204,3205],{"class":638},"(event",[624,3207,824],{"class":634},[624,3209,793],{"class":634},[624,3211,3212,3215,3217,3219,3222,3224],{"class":626,"line":796},[624,3213,3214],{"class":813},"  apiKey",[624,3216,937],{"class":634},[624,3218,648],{"class":634},[624,3220,3221],{"class":651},"phc_xxx",[624,3223,816],{"class":634},[624,3225,947],{"class":634},[624,3227,3228,3230],{"class":626,"line":832},[624,3229,835],{"class":634},[624,3231,838],{"class":638},[624,3233,3234],{"class":626,"line":950},[624,3235,762],{"emptyLinePlaceholder":761},[624,3237,3238],{"class":626,"line":965},[624,3239,3240],{"class":735},"\u002F\u002F Send multiple events in one request\n",[624,3242,3244,3246,3248,3251,3253],{"class":626,"line":3243},9,[624,3245,1117],{"class":630},[624,3247,3177],{"class":774},[624,3249,3250],{"class":638},"(events",[624,3252,824],{"class":634},[624,3254,793],{"class":634},[624,3256,3258,3260,3262,3264,3266,3268],{"class":626,"line":3257},10,[624,3259,3214],{"class":813},[624,3261,937],{"class":634},[624,3263,648],{"class":634},[624,3265,3221],{"class":651},[624,3267,816],{"class":634},[624,3269,947],{"class":634},[624,3271,3273,3275],{"class":626,"line":3272},11,[624,3274,835],{"class":634},[624,3276,838],{"class":638},[545,3278,3279],{},"For custom events, use the events-specific functions:",[613,3281,3283],{"className":615,"code":3282,"filename":3161,"language":618,"meta":619,"style":619},"import { sendToPostHogEvents, sendBatchToPostHogEvents, toPostHogEvent } from 'evlog\u002Fposthog'\n\n\u002F\u002F Send a single custom event\nawait sendToPostHogEvents(event, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Send multiple custom events in one request\nawait sendBatchToPostHogEvents(events, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Convert event to PostHog format (for inspection)\nconst posthogEvent = toPostHogEvent(event, { apiKey: 'phc_xxx' })\n",[621,3284,3285,3314,3318,3323,3335,3349,3355,3359,3364,3376,3390,3396,3401,3407],{"__ignoreMap":619},[624,3286,3287,3289,3291,3294,3296,3299,3301,3304,3306,3308,3310,3312],{"class":626,"line":627},[624,3288,631],{"class":630},[624,3290,635],{"class":634},[624,3292,3293],{"class":638}," sendToPostHogEvents",[624,3295,824],{"class":634},[624,3297,3298],{"class":638}," sendBatchToPostHogEvents",[624,3300,824],{"class":634},[624,3302,3303],{"class":638}," toPostHogEvent",[624,3305,642],{"class":634},[624,3307,645],{"class":630},[624,3309,648],{"class":634},[624,3311,652],{"class":651},[624,3313,655],{"class":634},[624,3315,3316],{"class":626,"line":739},[624,3317,762],{"emptyLinePlaceholder":761},[624,3319,3320],{"class":626,"line":758},[624,3321,3322],{"class":735},"\u002F\u002F Send a single custom event\n",[624,3324,3325,3327,3329,3331,3333],{"class":626,"line":765},[624,3326,1117],{"class":630},[624,3328,3293],{"class":774},[624,3330,3205],{"class":638},[624,3332,824],{"class":634},[624,3334,793],{"class":634},[624,3336,3337,3339,3341,3343,3345,3347],{"class":626,"line":796},[624,3338,3214],{"class":813},[624,3340,937],{"class":634},[624,3342,648],{"class":634},[624,3344,3221],{"class":651},[624,3346,816],{"class":634},[624,3348,947],{"class":634},[624,3350,3351,3353],{"class":626,"line":832},[624,3352,835],{"class":634},[624,3354,838],{"class":638},[624,3356,3357],{"class":626,"line":950},[624,3358,762],{"emptyLinePlaceholder":761},[624,3360,3361],{"class":626,"line":965},[624,3362,3363],{"class":735},"\u002F\u002F Send multiple custom events in one request\n",[624,3365,3366,3368,3370,3372,3374],{"class":626,"line":3243},[624,3367,1117],{"class":630},[624,3369,3298],{"class":774},[624,3371,3250],{"class":638},[624,3373,824],{"class":634},[624,3375,793],{"class":634},[624,3377,3378,3380,3382,3384,3386,3388],{"class":626,"line":3257},[624,3379,3214],{"class":813},[624,3381,937],{"class":634},[624,3383,648],{"class":634},[624,3385,3221],{"class":651},[624,3387,816],{"class":634},[624,3389,947],{"class":634},[624,3391,3392,3394],{"class":626,"line":3272},[624,3393,835],{"class":634},[624,3395,838],{"class":638},[624,3397,3399],{"class":626,"line":3398},12,[624,3400,762],{"emptyLinePlaceholder":761},[624,3402,3404],{"class":626,"line":3403},13,[624,3405,3406],{"class":735},"\u002F\u002F Convert event to PostHog format (for inspection)\n",[624,3408,3410,3412,3415,3417,3419,3421,3423,3425,3428,3430,3432,3434,3436,3438],{"class":626,"line":3409},14,[624,3411,1493],{"class":789},[624,3413,3414],{"class":638}," posthogEvent ",[624,3416,714],{"class":634},[624,3418,3303],{"class":774},[624,3420,3205],{"class":638},[624,3422,824],{"class":634},[624,3424,635],{"class":634},[624,3426,3427],{"class":813}," apiKey",[624,3429,937],{"class":634},[624,3431,648],{"class":634},[624,3433,3221],{"class":651},[624,3435,816],{"class":634},[624,3437,642],{"class":634},[624,3439,838],{"class":638},[606,3441,3443],{"id":3442},"next-steps","Next Steps",[1732,3445,3446,3452,3458,3464],{},[572,3447,3448,3451],{},[548,3449,3450],{"href":152},"Axiom Adapter"," - Send logs to Axiom",[572,3453,3454,3457],{},[548,3455,3456],{"href":192},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[572,3459,3460,3463],{},[548,3461,3462],{"href":491},"Custom Adapters"," - Build your own adapter",[572,3465,3466,3468],{},[548,3467,521],{"href":522}," - Security and production tips",[3470,3471,3472],"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 .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}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":619,"searchDepth":739,"depth":739,"links":3474},[3475,3476,3481,3487,3488,3489,3492,3493,3494,3501,3506,3507],{"id":608,"depth":739,"text":20},{"id":658,"depth":739,"text":25,"children":3477},[3478,3479,3480],{"id":662,"depth":758,"text":663},{"id":697,"depth":758,"text":698},{"id":720,"depth":758,"text":721},{"id":1305,"depth":739,"text":508,"children":3482},[3483,3484,3485,3486],{"id":1341,"depth":758,"text":1342},{"id":1386,"depth":758,"text":1387},{"id":1478,"depth":758,"text":1479},{"id":1542,"depth":758,"text":1543},{"id":1719,"depth":739,"text":1720},{"id":1777,"depth":739,"text":1778},{"id":1856,"depth":739,"text":1857,"children":3490},[3491],{"id":2070,"depth":758,"text":2071},{"id":2198,"depth":739,"text":2199},{"id":2276,"depth":739,"text":2277},{"id":2299,"depth":739,"text":2300,"children":3495},[3496,3497,3498,3499,3500],{"id":2440,"depth":758,"text":2441},{"id":2586,"depth":758,"text":2587},{"id":2708,"depth":758,"text":2709},{"id":2748,"depth":758,"text":2749},{"id":2863,"depth":758,"text":2864},{"id":3083,"depth":739,"text":3084,"children":3502},[3503,3504,3505],{"id":3087,"depth":758,"text":3088},{"id":3103,"depth":758,"text":3104},{"id":3130,"depth":758,"text":3131},{"id":3153,"depth":739,"text":3154},{"id":3442,"depth":739,"text":3443},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[3511,3517],{"label":3512,"icon":3513,"to":671,"target":3514,"color":3515,"variant":3516},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":3450,"icon":154,"to":152,"color":3515,"variant":3516},{},{"title":156,"icon":159},{"title":540,"description":3508},"dwA78B71tyAF3ABrLw2YMKZSaqrdfXA5nrYwLNdeDnQ",[3523,3525],{"title":151,"path":152,"stem":153,"description":3524,"icon":154,"children":-1},"Send wide events to Axiom for powerful querying, dashboards, and alerting. Zero-config setup with environment variables and automatic batching.",{"title":161,"path":162,"stem":163,"description":3526,"icon":164,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1786817437031]