[{"data":1,"prerenderedAt":1872},["ShallowReactive",2],{"navigation_docs":3,"-integrations-analytics-posthog":367,"-integrations-analytics-posthog-surround":1867},[4,10,71,102,272,348],{"title":5,"path":6,"stem":7,"icon":8,"exact":9},"Introduction","\u002F","0.index","i-lucide-book-open",true,{"title":11,"icon":12,"modifiedAt":13,"path":14,"stem":15,"children":16,"page":12},"Getting Started",false,"2026-04-30T19:15:33.000Z","\u002Fgetting-started","1.getting-started",[17,22,27,32,37,42,47,61,66],{"title":18,"path":19,"stem":20,"icon":21},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F1.quickstart","i-lucide-fast-forward",{"title":23,"path":24,"stem":25,"icon":26},"Core Concepts","\u002Fgetting-started\u002Fcore-concepts","1.getting-started\u002F2.core-concepts","i-lucide-workflow",{"title":28,"path":29,"stem":30,"icon":31},"Configs Anatomy","\u002Fgetting-started\u002Fconfigs","1.getting-started\u002F3.configs","i-lucide-file-cog",{"title":33,"path":34,"stem":35,"icon":36},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture","i-lucide-layers",{"title":38,"path":39,"stem":40,"icon":41},"JSON Schema Validation","\u002Fgetting-started\u002Fjson-schema-validation","1.getting-started\u002F5.json-schema-validation","i-lucide-braces",{"title":43,"path":44,"stem":45,"icon":46},"Testing Rules","\u002Fgetting-started\u002Ftesting-targeting-rules","1.getting-started\u002F6.testing-targeting-rules","i-lucide-flask-conical",{"title":48,"modifiedAt":49,"icon":50,"defaultOpen":12,"path":51,"stem":52,"children":53},"Experiments","2026-11-10T01:16:18.000Z","i-lucide-flask-round","\u002Fgetting-started\u002Fexperiments","1.getting-started\u002F7.experiments\u002Findex",[54,56],{"title":55,"path":51,"stem":52,"icon":8},"Overview",{"title":57,"path":58,"stem":59,"icon":60},"How results are computed","\u002Fgetting-started\u002Fexperiments\u002Fhow-results-are-computed","1.getting-started\u002F7.experiments\u002F1.how-results-are-computed","i-lucide-sigma",{"title":62,"path":63,"stem":64,"icon":65},"Segments","\u002Fgetting-started\u002Fsegments","1.getting-started\u002F8.segments","i-lucide-squares-intersect",{"title":67,"path":68,"stem":69,"icon":70},"Pricing & Billing","\u002Fgetting-started\u002Fpricing-and-billing","1.getting-started\u002F9.pricing-and-billing","i-lucide-credit-card",{"title":72,"modifiedAt":73,"defaultOpen":9,"path":74,"stem":75,"children":76,"page":12},"Monitoring","2026-09-24T23:33:20.000Z","\u002Fmonitoring","2.monitoring",[77,82,87,92,97],{"title":78,"path":79,"stem":80,"icon":81},"Activity","\u002Fmonitoring\u002Factivity","2.monitoring\u002F1.activity","i-lucide-activity",{"title":83,"path":84,"stem":85,"icon":86},"Lifecycle","\u002Fmonitoring\u002Flifecycle","2.monitoring\u002F2.lifecycle","i-lucide-recycle",{"title":88,"path":89,"stem":90,"icon":91},"Alerts","\u002Fmonitoring\u002Falerts","2.monitoring\u002F3.alerts","i-lucide-bell",{"title":93,"path":94,"stem":95,"icon":96},"Dynamic Detection","\u002Fmonitoring\u002Fdynamic-detection","2.monitoring\u002F4.dynamic-detection","i-lucide-hat-glasses",{"title":98,"path":99,"stem":100,"icon":101},"Audit log","\u002Fmonitoring\u002Faudit-log","2.monitoring\u002F5.audit-log","i-lucide-logs",{"title":103,"modifiedAt":73,"defaultOpen":9,"path":104,"stem":105,"children":106,"page":12},"SDKs","\u002Fsdks","3.sdks",[107,112,133,158,174,215,267],{"title":108,"path":109,"stem":110,"icon":111},"Available SDKs","\u002Fsdks\u002Favailable-sdks","3.sdks\u002F1.available-sdks","i-lucide-list",{"title":113,"modifiedAt":73,"icon":114,"defaultOpen":12,"path":115,"stem":116,"children":117,"page":12},"Browser SDKs","i-lucide-monitor","\u002Fsdks\u002Fbrowser","3.sdks\u002F2.browser",[118,123,128],{"title":119,"path":120,"stem":121,"icon":122},"Javascript","\u002Fsdks\u002Fbrowser\u002Fjavascript","3.sdks\u002F2.browser\u002F1.javascript","cd-logos-javascript",{"title":124,"path":125,"stem":126,"icon":127},"React","\u002Fsdks\u002Fbrowser\u002Freact","3.sdks\u002F2.browser\u002F2.react","cd-logos-react-light",{"title":129,"path":130,"stem":131,"icon":132},"Vue","\u002Fsdks\u002Fbrowser\u002Fvue","3.sdks\u002F2.browser\u002F3.vue","cd-logos-vue",{"title":134,"modifiedAt":73,"icon":135,"defaultOpen":12,"path":136,"stem":137,"children":138,"page":12},"Mobile SDKs","i-lucide-smartphone","\u002Fsdks\u002Fmobile","3.sdks\u002F3.mobile",[139,143,148,153],{"title":140,"path":141,"stem":142,"icon":127},"React Native","\u002Fsdks\u002Fmobile\u002Freact-native","3.sdks\u002F3.mobile\u002F1.react-native",{"title":144,"path":145,"stem":146,"icon":147},"Flutter","\u002Fsdks\u002Fmobile\u002Fflutter","3.sdks\u002F3.mobile\u002F2.flutter","cd-logos-flutter",{"title":149,"path":150,"stem":151,"icon":152},"Swift","\u002Fsdks\u002Fmobile\u002Fswift","3.sdks\u002F3.mobile\u002F3.swift","cd-logos-swift",{"title":154,"path":155,"stem":156,"icon":157},"Android","\u002Fsdks\u002Fmobile\u002Fandroid","3.sdks\u002F3.mobile\u002F4.android","cd-logos-android",{"title":159,"modifiedAt":73,"icon":160,"defaultOpen":12,"path":161,"stem":162,"children":163,"page":12},"Meta-framework SDKs","i-lucide-monitor-smartphone","\u002Fsdks\u002Fmeta","3.sdks\u002F4.meta",[164,169],{"title":165,"path":166,"stem":167,"icon":168},"Next.js","\u002Fsdks\u002Fmeta\u002Fnextjs","3.sdks\u002F4.meta\u002F1.nextjs","cd-logos-nextjs",{"title":170,"path":171,"stem":172,"icon":173},"Nuxt","\u002Fsdks\u002Fmeta\u002Fnuxt","3.sdks\u002F4.meta\u002F2.nuxt","cd-logos-nuxt",{"title":175,"modifiedAt":73,"icon":176,"defaultOpen":12,"path":177,"stem":178,"children":179,"page":12},"Server SDKs","i-lucide-server","\u002Fsdks\u002Fserver","3.sdks\u002F5.server",[180,185,190,195,200,205,210],{"title":181,"path":182,"stem":183,"icon":184},"Node.js","\u002Fsdks\u002Fserver\u002Fnode-js","3.sdks\u002F5.server\u002F1.node-js","cd-logos-nodejs",{"title":186,"path":187,"stem":188,"icon":189},"Python","\u002Fsdks\u002Fserver\u002Fpython","3.sdks\u002F5.server\u002F2.python","cd-logos-python",{"title":191,"path":192,"stem":193,"icon":194},"Java","\u002Fsdks\u002Fserver\u002Fjava","3.sdks\u002F5.server\u002F3.java","cd-logos-java",{"title":196,"path":197,"stem":198,"icon":199},".NET","\u002Fsdks\u002Fserver\u002Fdotnet","3.sdks\u002F5.server\u002F4.dotnet","cd-logos-dotnet",{"title":201,"path":202,"stem":203,"icon":204},"Go","\u002Fsdks\u002Fserver\u002Fgo","3.sdks\u002F5.server\u002F5.go","cd-logos-go",{"title":206,"path":207,"stem":208,"icon":209},"PHP","\u002Fsdks\u002Fserver\u002Fphp","3.sdks\u002F5.server\u002F6.php","cd-logos-php",{"title":211,"path":212,"stem":213,"icon":214},"Ruby","\u002Fsdks\u002Fserver\u002Fruby","3.sdks\u002F5.server\u002F7.ruby","cd-logos-ruby",{"title":216,"modifiedAt":73,"icon":217,"defaultOpen":12,"path":218,"stem":219,"children":220},"OpenFeature Providers","cd-logos-openfeature","\u002Fsdks\u002Fopenfeature","3.sdks\u002F6.openfeature\u002Findex",[221,222,227,231,235,239,243,247,251,255,259,263],{"title":55,"path":218,"stem":219,"icon":217},{"title":223,"path":224,"stem":225,"icon":217,"icons":226},"Web","\u002Fsdks\u002Fopenfeature\u002Fweb","3.sdks\u002F6.openfeature\u002F1.web",[217,122],{"title":149,"path":228,"stem":229,"icon":217,"icons":230},"\u002Fsdks\u002Fopenfeature\u002Fswift","3.sdks\u002F6.openfeature\u002F2.swift",[217,152],{"title":154,"path":232,"stem":233,"icon":217,"icons":234},"\u002Fsdks\u002Fopenfeature\u002Fandroid","3.sdks\u002F6.openfeature\u002F3.android",[217,157],{"title":144,"path":236,"stem":237,"icon":217,"icons":238},"\u002Fsdks\u002Fopenfeature\u002Fflutter","3.sdks\u002F6.openfeature\u002F4.flutter",[217,147],{"title":181,"path":240,"stem":241,"icon":217,"icons":242},"\u002Fsdks\u002Fopenfeature\u002Fnode-js","3.sdks\u002F6.openfeature\u002F5.node-js",[217,184],{"title":186,"path":244,"stem":245,"icon":217,"icons":246},"\u002Fsdks\u002Fopenfeature\u002Fpython","3.sdks\u002F6.openfeature\u002F6.python",[217,189],{"title":191,"path":248,"stem":249,"icon":217,"icons":250},"\u002Fsdks\u002Fopenfeature\u002Fjava","3.sdks\u002F6.openfeature\u002F7.java",[217,194],{"title":196,"path":252,"stem":253,"icon":217,"icons":254},"\u002Fsdks\u002Fopenfeature\u002Fdotnet","3.sdks\u002F6.openfeature\u002F8.dotnet",[217,199],{"title":201,"path":256,"stem":257,"icon":217,"icons":258},"\u002Fsdks\u002Fopenfeature\u002Fgo","3.sdks\u002F6.openfeature\u002F9.go",[217,204],{"title":206,"path":260,"stem":261,"icon":217,"icons":262},"\u002Fsdks\u002Fopenfeature\u002Fphp","3.sdks\u002F6.openfeature\u002F90.php",[217,209],{"title":211,"path":264,"stem":265,"icon":217,"icons":266},"\u002Fsdks\u002Fopenfeature\u002Fruby","3.sdks\u002F6.openfeature\u002F91.ruby",[217,214],{"title":268,"path":269,"stem":270,"icon":271},"Maven Repository","\u002Fsdks\u002Fmaven-repository","3.sdks\u002F7.maven-repository","i-lucide-package",{"title":273,"modifiedAt":73,"defaultOpen":9,"path":274,"stem":275,"children":276,"page":12},"Integrations","\u002Fintegrations","4.integrations",[277,282,287,292,297,301,306,343],{"title":278,"path":279,"stem":280,"icon":281},"MCP","\u002Fintegrations\u002Fmcp","4.integrations\u002F1.mcp","cd-logos-mcp",{"title":283,"path":284,"stem":285,"icon":286},"Agent Skills","\u002Fintegrations\u002Fagents","4.integrations\u002F2.agents","i-lucide-bot",{"title":288,"path":289,"stem":290,"icon":291},"CLI","\u002Fintegrations\u002Fcli","4.integrations\u002F3.cli","cd-logos-cli",{"title":293,"path":294,"stem":295,"icon":296},"Terraform","\u002Fintegrations\u002Fterraform","4.integrations\u002F4.terraform","cd-logos-terraform",{"title":298,"path":299,"stem":300,"icon":41},"Admin API","\u002Fintegrations\u002Fadmin-api","4.integrations\u002F5.admin-api",{"title":302,"path":303,"stem":304,"icon":305},"Webhooks","\u002Fintegrations\u002Fwebhooks","4.integrations\u002F6.webhooks","i-lucide-webhook",{"title":307,"modifiedAt":308,"icon":309,"defaultOpen":12,"path":310,"stem":311,"children":312},"Analytics","2026-11-08T17:10:01.000Z","i-lucide-chart-line","\u002Fintegrations\u002Fanalytics","4.integrations\u002F7.analytics\u002Findex",[313,315,319,323,327,331,335,339],{"title":55,"path":310,"stem":311,"icon":314},"i-lucide-blocks",{"title":316,"path":317,"stem":318,"icon":309},"Amplitude","\u002Fintegrations\u002Fanalytics\u002Famplitude","4.integrations\u002F7.analytics\u002F1.amplitude",{"title":320,"path":321,"stem":322,"icon":309},"Datadog","\u002Fintegrations\u002Fanalytics\u002Fdatadog","4.integrations\u002F7.analytics\u002F2.datadog",{"title":324,"path":325,"stem":326,"icon":309},"Google Analytics 4","\u002Fintegrations\u002Fanalytics\u002Fga4","4.integrations\u002F7.analytics\u002F3.ga4",{"title":328,"path":329,"stem":330,"icon":309},"Grafana","\u002Fintegrations\u002Fanalytics\u002Fgrafana","4.integrations\u002F7.analytics\u002F4.grafana",{"title":332,"path":333,"stem":334,"icon":309},"Mixpanel","\u002Fintegrations\u002Fanalytics\u002Fmixpanel","4.integrations\u002F7.analytics\u002F5.mixpanel",{"title":336,"path":337,"stem":338,"icon":309},"PostHog","\u002Fintegrations\u002Fanalytics\u002Fposthog","4.integrations\u002F7.analytics\u002F6.posthog",{"title":340,"path":341,"stem":342,"icon":309},"Segment","\u002Fintegrations\u002Fanalytics\u002Fsegment","4.integrations\u002F7.analytics\u002F7.segment",{"title":344,"path":345,"stem":346,"icon":347},"Slack","\u002Fintegrations\u002Fslack","4.integrations\u002F8.slack","i-simple-icons-slack",{"title":349,"modifiedAt":350,"defaultOpen":9,"path":351,"stem":352,"children":353,"page":12},"Migration Guides","2026-10-16T17:57:49.000Z","\u002Fmigration-guides","5.migration-guides",[354,359,363],{"title":355,"path":356,"stem":357,"icon":358},"From LaunchDarkly","\u002Fmigration-guides\u002Flaunchdarkly","5.migration-guides\u002F1.launchdarkly","i-lucide-baggage-claim",{"title":360,"path":361,"stem":362,"icon":358},"From Firebase Remote Config","\u002Fmigration-guides\u002Ffirebase-remote-config","5.migration-guides\u002F2.firebase-remote-config",{"title":364,"path":365,"stem":366,"icon":358},"From Firebase A\u002FB Testing","\u002Fmigration-guides\u002Ffirebase-ab-testing","5.migration-guides\u002F3.firebase-ab-testing",{"id":368,"title":336,"body":369,"description":1858,"extension":1859,"links":1860,"meta":1861,"navigation":1862,"path":337,"seo":1863,"stem":338,"__hash__":1866},"docs\u002F4.integrations\u002F7.analytics\u002F6.posthog.md",{"type":370,"value":371,"toc":1843},"minimark",[372,376,380,409,412,415,420,490,494,552,560,564,587,605,608,614,617,621,633,680,683,700,704,724,1216,1223,1237,1249,1253,1260,1744,1756,1760,1763,1781,1785,1794,1808,1820,1823,1836,1839],[373,374,5],"h2",{"id":375},"introduction",[377,378,379],"p",{},"ConfigDirector works with PostHog in two ways, and you can use either or both:",[381,382,383,400],"ul",{},[384,385,386,395,396,399],"li",{},[387,388,389,394],"strong",{},[390,391,393],"a",{"href":392},"#mark-experiment-runs-on-your-charts","Mark experiment runs on your charts","."," ConfigDirector posts a marker to PostHog when an ",[390,397,398],{"href":51},"experiment","'s run starts, its split changes, a variation is shipped or the run is stopped. You set this up in the dashboard, with no code.",[384,401,402,408],{},[387,403,404,394],{},[390,405,407],{"href":406},"#send-exposures-from-your-application","Send exposures from your application"," Your application tells PostHog which variation each user saw, so you can compare the variations next to the events you already track there. You add a handler to your code once.",[373,410,393],{"id":411},"mark-experiment-runs-on-your-charts",[377,413,414],{},"A PostHog integration posts a marker for each run event. The marker is a project-scoped annotation, shown on the project's insights.",[416,417,419],"h3",{"id":418},"settings","Settings",[421,422,423,436],"table",{},[424,425,426],"thead",{},[427,428,429,433],"tr",{},[430,431,432],"th",{},"Setting",[430,434,435],{},"Value",[437,438,439,466,476],"tbody",{},[427,440,441,447],{},[442,443,444],"td",{},[387,445,446],{},"Host",[442,448,449,452,453,456,457,460,461,465],{},[387,450,451],{},"US cloud",", ",[387,454,455],{},"EU cloud",", or ",[387,458,459],{},"Self-hosted"," with the ",[462,463,464],"code",{},"https:\u002F\u002F"," address of your PostHog",[427,467,468,473],{},[442,469,470],{},[387,471,472],{},"Project id",[442,474,475],{},"The number in the project's URL in PostHog",[427,477,478,483],{},[442,479,480],{},[387,481,482],{},"Personal API key",[442,484,485,486,489],{},"A personal API key with the ",[462,487,488],{},"annotation:write"," scope, created under your account settings in PostHog",[416,491,493],{"id":492},"create-the-integration","Create the integration",[495,496,497,507,510,513,527,534,537],"ol",{},[384,498,499,500,502,503,506],{},"Open ",[387,501,273],{}," at the bottom of the dashboard's navigation and pick the tool, or click ",[387,504,505],{},"Add integration"," when you already have one.",[384,508,509],{},"Give the integration a name, or keep the tool's name.",[384,511,512],{},"Fill in the settings above and paste the credential you created in the tool. Credentials are stored encrypted and never shown again.",[384,514,515,516,452,519,522,523,526],{},"Narrow it down with the ",[387,517,518],{},"Projects",[387,520,521],{},"Environments"," and ",[387,524,525],{},"Tags"," filters, or leave them empty to mark every run. A run is marked when its project, its environment and its config's tags pass every filter you set; an empty filter lets everything through. An integration filtered to Production marks Production runs only.",[384,528,529,530,533],{},"Keep ",[387,531,532],{},"Enabled"," on. A disabled integration marks nothing, and runs that start or end while it is disabled are not marked later.",[384,535,536],{},"Save. The integration's page shows the tool's settings and the address it posts to.",[384,538,539,540,543,544,547,548,551],{},"Click ",[387,541,542],{},"Send test marker"," and confirm. A marker titled ",[387,545,546],{},"ConfigDirector test"," is posted to the tool right away, at the current time, and shows under ",[387,549,550],{},"Deliveries"," with the tool's response, so you can see where run markers will land.",[377,553,554,555,559],{},"The ",[390,556,558],{"href":557},"\u002Fintegrations\u002Fanalytics#mark-experiment-runs-on-your-charts","Analytics overview"," explains what each marker says, how deliveries are retried and what happens when the tool stops accepting markers.",[416,561,563],{"id":562},"what-configdirector-posts","What ConfigDirector posts",[377,565,566,567,452,570,573,574,577,578,582,583,586],{},"The integration posts to ",[462,568,569],{},"https:\u002F\u002Fus.posthog.com\u002Fapi\u002Fprojects\u002F{projectId}\u002Fannotations\u002F",[462,571,572],{},"https:\u002F\u002Feu.posthog.com\u002F…"," on PostHog Cloud EU, or ",[462,575,576],{},"{host}\u002Fapi\u002Fprojects\u002F{projectId}\u002Fannotations\u002F"," on a self-hosted PostHog, with the key as a Bearer token. Set an ",[390,579,581],{"href":580},"\u002Fintegrations\u002Fanalytics#endpoint-url-override","endpoint URL"," under ",[387,584,585],{},"Advanced"," only to post somewhere else.",[377,588,589,590,593,594,597,598,394],{},"The body sent is ",[462,591,592],{},"{ \"content\", \"date_marker\", \"scope\": \"project\" }",", with ",[462,595,596],{},"date_marker"," in ISO 8601. PostHog's documentation: ",[390,599,604],{"href":600,"rel":601,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fapi\u002Fannotations",[602],"noopener","_blank","Annotations",[373,606,407],{"id":607},"send-exposures-from-your-application",[377,609,610,611,613],{},"To compare an ",[390,612,398],{"href":51},"'s variations in PostHog, your application tells PostHog which variation each user saw. You add a handler once, and PostHog joins those exposures to the events you already send it.",[377,615,616],{},"These exposures go straight from your application to PostHog, so nothing passes through ConfigDirector.",[416,618,620],{"id":619},"what-posthog-reads","What PostHog reads",[377,622,623,624,632],{},"PostHog's experiments count a user as exposed when it receives a ",[390,625,628,631],{"href":626,"rel":627,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Fexposures#what-is-an-exposure",[602],[462,629,630],{},"$feature_flag_called"," event"," with two properties:",[421,634,635,648],{},[424,636,637],{},[427,638,639,642,645],{},[430,640,641],{},"Property",[430,643,644],{},"What you send",[430,646,647],{},"Example",[437,649,650,665],{},[427,651,652,657,660],{},[442,653,654],{},[462,655,656],{},"$feature_flag",[442,658,659],{},"The config key",[442,661,662],{},[462,663,664],{},"checkout-cta-copy",[427,666,667,672,675],{},[442,668,669],{},[462,670,671],{},"$feature_flag_response",[442,673,674],{},"The variation's name",[442,676,677],{},[462,678,679],{},"treatment-a",[377,681,682],{},"PostHog's SDKs normally send this event themselves when they read one of its own flags. Your handler sends it instead, because ConfigDirector serves the variation.",[377,684,685,686,689,690,695,696,699],{},"If you would rather use an event you already send, such as ",[462,687,688],{},"$pageview",", PostHog also ",[390,691,694],{"href":692,"rel":693,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Frunning-experiments-without-feature-flags",[602],"accepts a custom exposure event",": choose it in the experiment's settings, and send the variation in a ",[462,697,698],{},"$feature\u002Fcheckout-cta-copy"," property.",[416,701,703],{"id":702},"add-the-handler","Add the handler",[377,705,706,707,710,711,715,716,719,720,723],{},"Add a handler for the ",[462,708,709],{},"configEvaluated"," hook where you create the client, in the ",[390,712,714],{"href":713},"\u002Fsdks\u002Fbrowser\u002Fjavascript#hooks","browser"," or in ",[390,717,181],{"href":718},"\u002Fsdks\u002Fserver\u002Fnode-js#hooks",". The examples use PostHog's US host; on its EU cloud, use ",[462,721,722],{},"https:\u002F\u002Feu.i.posthog.com",":",[725,726,727,982],"code-group",{},[728,729,735],"pre",{"className":730,"code":731,"filename":732,"language":733,"meta":734,"style":734},"language-ts shiki shiki-themes github-light-high-contrast github-light github-dark","import { createClient } from \"@configdirector\u002Fclient-sdk\";\nimport posthog from \"posthog-js\";\n\nposthog.init(\"YOUR-POSTHOG-PROJECT-API-KEY\", { api_host: \"https:\u002F\u002Fus.i.posthog.com\" });\n\nexport const client = createClient(\"YOUR-CLIENT-SDK-KEY\", {\n  hooks: {\n    configEvaluated: ({ evaluation }) => {\n      const variationName = evaluation.variation?.name;\n      if (!variationName) return;\n\n      posthog.capture(\"$feature_flag_called\", {\n        $feature_flag: evaluation.key,\n        $feature_flag_response: variationName,\n      });\n    },\n  },\n});\n\nawait client.initialize({ id: \"user-42\" });\n","Browser","ts","",[462,736,737,760,775,781,806,811,838,844,866,880,900,905,921,927,933,939,945,951,957,962],{"__ignoreMap":734},[738,739,742,746,750,753,757],"span",{"class":740,"line":741},"line",1,[738,743,745],{"class":744},"sLDKn","import",[738,747,749],{"class":748},"sbRM4"," { createClient } ",[738,751,752],{"class":744},"from",[738,754,756],{"class":755},"suztq"," \"@configdirector\u002Fclient-sdk\"",[738,758,759],{"class":748},";\n",[738,761,763,765,768,770,773],{"class":740,"line":762},2,[738,764,745],{"class":744},[738,766,767],{"class":748}," posthog ",[738,769,752],{"class":744},[738,771,772],{"class":755}," \"posthog-js\"",[738,774,759],{"class":748},[738,776,778],{"class":740,"line":777},3,[738,779,780],{"emptyLinePlaceholder":9},"\n",[738,782,784,787,791,794,797,800,803],{"class":740,"line":783},4,[738,785,786],{"class":748},"posthog.",[738,788,790],{"class":789},"sEIia","init",[738,792,793],{"class":748},"(",[738,795,796],{"class":755},"\"YOUR-POSTHOG-PROJECT-API-KEY\"",[738,798,799],{"class":748},", { api_host: ",[738,801,802],{"class":755},"\"https:\u002F\u002Fus.i.posthog.com\"",[738,804,805],{"class":748}," });\n",[738,807,809],{"class":740,"line":808},5,[738,810,780],{"emptyLinePlaceholder":9},[738,812,814,817,820,824,827,830,832,835],{"class":740,"line":813},6,[738,815,816],{"class":744},"export",[738,818,819],{"class":744}," const",[738,821,823],{"class":822},"sxMNI"," client",[738,825,826],{"class":744}," =",[738,828,829],{"class":789}," createClient",[738,831,793],{"class":748},[738,833,834],{"class":755},"\"YOUR-CLIENT-SDK-KEY\"",[738,836,837],{"class":748},", {\n",[738,839,841],{"class":740,"line":840},7,[738,842,843],{"class":748},"  hooks: {\n",[738,845,847,850,853,857,860,863],{"class":740,"line":846},8,[738,848,849],{"class":789},"    configEvaluated",[738,851,852],{"class":748},": ({ ",[738,854,856],{"class":855},"syyZu","evaluation",[738,858,859],{"class":748}," }) ",[738,861,862],{"class":744},"=>",[738,864,865],{"class":748}," {\n",[738,867,869,872,875,877],{"class":740,"line":868},9,[738,870,871],{"class":744},"      const",[738,873,874],{"class":822}," variationName",[738,876,826],{"class":744},[738,878,879],{"class":748}," evaluation.variation?.name;\n",[738,881,883,886,889,892,895,898],{"class":740,"line":882},10,[738,884,885],{"class":744},"      if",[738,887,888],{"class":748}," (",[738,890,891],{"class":744},"!",[738,893,894],{"class":748},"variationName) ",[738,896,897],{"class":744},"return",[738,899,759],{"class":748},[738,901,903],{"class":740,"line":902},11,[738,904,780],{"emptyLinePlaceholder":9},[738,906,908,911,914,916,919],{"class":740,"line":907},12,[738,909,910],{"class":748},"      posthog.",[738,912,913],{"class":789},"capture",[738,915,793],{"class":748},[738,917,918],{"class":755},"\"$feature_flag_called\"",[738,920,837],{"class":748},[738,922,924],{"class":740,"line":923},13,[738,925,926],{"class":748},"        $feature_flag: evaluation.key,\n",[738,928,930],{"class":740,"line":929},14,[738,931,932],{"class":748},"        $feature_flag_response: variationName,\n",[738,934,936],{"class":740,"line":935},15,[738,937,938],{"class":748},"      });\n",[738,940,942],{"class":740,"line":941},16,[738,943,944],{"class":748},"    },\n",[738,946,948],{"class":740,"line":947},17,[738,949,950],{"class":748},"  },\n",[738,952,954],{"class":740,"line":953},18,[738,955,956],{"class":748},"});\n",[738,958,960],{"class":740,"line":959},19,[738,961,780],{"emptyLinePlaceholder":9},[738,963,965,968,971,974,977,980],{"class":740,"line":964},20,[738,966,967],{"class":744},"await",[738,969,970],{"class":748}," client.",[738,972,973],{"class":789},"initialize",[738,975,976],{"class":748},"({ id: ",[738,978,979],{"class":755},"\"user-42\"",[738,981,805],{"class":748},[728,983,985],{"className":730,"code":984,"filename":181,"language":733,"meta":734,"style":734},"import { createClient } from \"@configdirector\u002Fserver-sdk\";\nimport { PostHog } from \"posthog-node\";\n\nconst posthog = new PostHog(\"YOUR-POSTHOG-PROJECT-API-KEY\", { host: \"https:\u002F\u002Fus.i.posthog.com\" });\n\nexport const client = createClient(\"YOUR-SERVER-SDK-KEY\", {\n  hooks: {\n    configEvaluated: ({ evaluation }) => {\n      const variationName = evaluation.variation?.name;\n      const userId = evaluation.context?.id;\n      if (!variationName || !userId) return;\n\n      posthog.capture({\n        distinctId: userId,\n        event: \"$feature_flag_called\",\n        properties: {\n          $feature_flag: evaluation.key,\n          $feature_flag_response: variationName,\n        },\n      });\n    },\n  },\n});\n\nawait client.initialize();\n",[462,986,987,1000,1014,1018,1045,1049,1068,1072,1086,1096,1108,1132,1136,1145,1150,1160,1165,1170,1175,1180,1184,1189,1194,1199,1204],{"__ignoreMap":734},[738,988,989,991,993,995,998],{"class":740,"line":741},[738,990,745],{"class":744},[738,992,749],{"class":748},[738,994,752],{"class":744},[738,996,997],{"class":755}," \"@configdirector\u002Fserver-sdk\"",[738,999,759],{"class":748},[738,1001,1002,1004,1007,1009,1012],{"class":740,"line":762},[738,1003,745],{"class":744},[738,1005,1006],{"class":748}," { PostHog } ",[738,1008,752],{"class":744},[738,1010,1011],{"class":755}," \"posthog-node\"",[738,1013,759],{"class":748},[738,1015,1016],{"class":740,"line":777},[738,1017,780],{"emptyLinePlaceholder":9},[738,1019,1020,1023,1026,1028,1031,1034,1036,1038,1041,1043],{"class":740,"line":783},[738,1021,1022],{"class":744},"const",[738,1024,1025],{"class":822}," posthog",[738,1027,826],{"class":744},[738,1029,1030],{"class":744}," new",[738,1032,1033],{"class":789}," PostHog",[738,1035,793],{"class":748},[738,1037,796],{"class":755},[738,1039,1040],{"class":748},", { host: ",[738,1042,802],{"class":755},[738,1044,805],{"class":748},[738,1046,1047],{"class":740,"line":808},[738,1048,780],{"emptyLinePlaceholder":9},[738,1050,1051,1053,1055,1057,1059,1061,1063,1066],{"class":740,"line":813},[738,1052,816],{"class":744},[738,1054,819],{"class":744},[738,1056,823],{"class":822},[738,1058,826],{"class":744},[738,1060,829],{"class":789},[738,1062,793],{"class":748},[738,1064,1065],{"class":755},"\"YOUR-SERVER-SDK-KEY\"",[738,1067,837],{"class":748},[738,1069,1070],{"class":740,"line":840},[738,1071,843],{"class":748},[738,1073,1074,1076,1078,1080,1082,1084],{"class":740,"line":846},[738,1075,849],{"class":789},[738,1077,852],{"class":748},[738,1079,856],{"class":855},[738,1081,859],{"class":748},[738,1083,862],{"class":744},[738,1085,865],{"class":748},[738,1087,1088,1090,1092,1094],{"class":740,"line":868},[738,1089,871],{"class":744},[738,1091,874],{"class":822},[738,1093,826],{"class":744},[738,1095,879],{"class":748},[738,1097,1098,1100,1103,1105],{"class":740,"line":882},[738,1099,871],{"class":744},[738,1101,1102],{"class":822}," userId",[738,1104,826],{"class":744},[738,1106,1107],{"class":748}," evaluation.context?.id;\n",[738,1109,1110,1112,1114,1116,1119,1122,1125,1128,1130],{"class":740,"line":902},[738,1111,885],{"class":744},[738,1113,888],{"class":748},[738,1115,891],{"class":744},[738,1117,1118],{"class":748},"variationName ",[738,1120,1121],{"class":744},"||",[738,1123,1124],{"class":744}," !",[738,1126,1127],{"class":748},"userId) ",[738,1129,897],{"class":744},[738,1131,759],{"class":748},[738,1133,1134],{"class":740,"line":907},[738,1135,780],{"emptyLinePlaceholder":9},[738,1137,1138,1140,1142],{"class":740,"line":923},[738,1139,910],{"class":748},[738,1141,913],{"class":789},[738,1143,1144],{"class":748},"({\n",[738,1146,1147],{"class":740,"line":929},[738,1148,1149],{"class":748},"        distinctId: userId,\n",[738,1151,1152,1155,1157],{"class":740,"line":935},[738,1153,1154],{"class":748},"        event: ",[738,1156,918],{"class":755},[738,1158,1159],{"class":748},",\n",[738,1161,1162],{"class":740,"line":941},[738,1163,1164],{"class":748},"        properties: {\n",[738,1166,1167],{"class":740,"line":947},[738,1168,1169],{"class":748},"          $feature_flag: evaluation.key,\n",[738,1171,1172],{"class":740,"line":953},[738,1173,1174],{"class":748},"          $feature_flag_response: variationName,\n",[738,1176,1177],{"class":740,"line":959},[738,1178,1179],{"class":748},"        },\n",[738,1181,1182],{"class":740,"line":964},[738,1183,938],{"class":748},[738,1185,1187],{"class":740,"line":1186},21,[738,1188,944],{"class":748},[738,1190,1192],{"class":740,"line":1191},22,[738,1193,950],{"class":748},[738,1195,1197],{"class":740,"line":1196},23,[738,1198,956],{"class":748},[738,1200,1202],{"class":740,"line":1201},24,[738,1203,780],{"emptyLinePlaceholder":9},[738,1205,1207,1209,1211,1213],{"class":740,"line":1206},25,[738,1208,967],{"class":744},[738,1210,970],{"class":748},[738,1212,973],{"class":789},[738,1214,1215],{"class":748},"();\n",[377,1217,1218,1219,394],{},"Only an experiment's evaluations carry a variation, so the check skips every other config, along with the in-code default value. It also skips a variation without a name, so ",[390,1220,1222],{"href":1221},"\u002Fgetting-started\u002Fexperiments#create-the-experiment","name each one",[377,1224,1225,1226,1229,1230,1233,1234,1236],{},"In the browser, PostHog attaches the exposure to the user you have identified to it. In Node.js, the handler passes the context's ",[462,1227,1228],{},"id"," as the ",[462,1231,1232],{},"distinctId",", so it has to be the ID your other PostHog events use. A context without an ",[462,1235,1228],{}," is skipped, since it does not take part in the split on a server.",[377,1238,1239,1240,1243,1244,1248],{},"The handler needs version 1.11.0 or later of the JavaScript SDK, or 1.13.0 or later of the Node.js SDK. React, Vue and React Native take the same handler in their ",[462,1241,1242],{},"hooks",". The ",[390,1245,1247],{"href":1246},"\u002Fgetting-started\u002Fexperiments#send-exposures-to-your-analytics-tool","Experiments guide"," lists the hook for every other SDK.",[416,1250,1252],{"id":1251},"with-openfeature","With OpenFeature",[377,1254,1255,1256,1259],{},"In an OpenFeature application, a hook does the same job, with the ",[462,1257,1258],{},"variant"," as the variation's name. Every config has a variant, not only experiments: on any other config it is ConfigDirector's ID for the value. So attach the hook to the reads of your experiments instead of registering it for every read:",[725,1261,1262,1479],{},[728,1263,1265],{"className":730,"code":1264,"filename":223,"language":733,"meta":734,"style":734},"import { OpenFeature, type Hook } from \"@openfeature\u002Fweb-sdk\";\nimport posthog from \"posthog-js\";\n\nposthog.init(\"YOUR-POSTHOG-PROJECT-API-KEY\", { api_host: \"https:\u002F\u002Fus.i.posthog.com\" });\n\nconst reportExposure: Hook = {\n  after: (hookContext, details) => {\n    if (!details.variant) return;\n\n    posthog.capture(\"$feature_flag_called\", {\n      $feature_flag: hookContext.flagKey,\n      $feature_flag_response: details.variant,\n    });\n  },\n};\n\nconst client = OpenFeature.getClient();\n\nconst buttonLabel = client.getStringValue(\"checkout-cta-copy\", \"Start free trial\", {\n  hooks: [reportExposure],\n});\n",[462,1266,1267,1287,1299,1303,1319,1323,1340,1363,1379,1383,1396,1401,1406,1411,1415,1420,1424,1440,1444,1470,1475],{"__ignoreMap":734},[738,1268,1269,1271,1274,1277,1280,1282,1285],{"class":740,"line":741},[738,1270,745],{"class":744},[738,1272,1273],{"class":748}," { OpenFeature, ",[738,1275,1276],{"class":744},"type",[738,1278,1279],{"class":748}," Hook } ",[738,1281,752],{"class":744},[738,1283,1284],{"class":755}," \"@openfeature\u002Fweb-sdk\"",[738,1286,759],{"class":748},[738,1288,1289,1291,1293,1295,1297],{"class":740,"line":762},[738,1290,745],{"class":744},[738,1292,767],{"class":748},[738,1294,752],{"class":744},[738,1296,772],{"class":755},[738,1298,759],{"class":748},[738,1300,1301],{"class":740,"line":777},[738,1302,780],{"emptyLinePlaceholder":9},[738,1304,1305,1307,1309,1311,1313,1315,1317],{"class":740,"line":783},[738,1306,786],{"class":748},[738,1308,790],{"class":789},[738,1310,793],{"class":748},[738,1312,796],{"class":755},[738,1314,799],{"class":748},[738,1316,802],{"class":755},[738,1318,805],{"class":748},[738,1320,1321],{"class":740,"line":808},[738,1322,780],{"emptyLinePlaceholder":9},[738,1324,1325,1327,1330,1332,1336,1338],{"class":740,"line":813},[738,1326,1022],{"class":744},[738,1328,1329],{"class":822}," reportExposure",[738,1331,723],{"class":744},[738,1333,1335],{"class":1334},"sA9AF"," Hook",[738,1337,826],{"class":744},[738,1339,865],{"class":748},[738,1341,1342,1345,1348,1351,1353,1356,1359,1361],{"class":740,"line":840},[738,1343,1344],{"class":789},"  after",[738,1346,1347],{"class":748},": (",[738,1349,1350],{"class":855},"hookContext",[738,1352,452],{"class":748},[738,1354,1355],{"class":855},"details",[738,1357,1358],{"class":748},") ",[738,1360,862],{"class":744},[738,1362,865],{"class":748},[738,1364,1365,1368,1370,1372,1375,1377],{"class":740,"line":846},[738,1366,1367],{"class":744},"    if",[738,1369,888],{"class":748},[738,1371,891],{"class":744},[738,1373,1374],{"class":748},"details.variant) ",[738,1376,897],{"class":744},[738,1378,759],{"class":748},[738,1380,1381],{"class":740,"line":868},[738,1382,780],{"emptyLinePlaceholder":9},[738,1384,1385,1388,1390,1392,1394],{"class":740,"line":882},[738,1386,1387],{"class":748},"    posthog.",[738,1389,913],{"class":789},[738,1391,793],{"class":748},[738,1393,918],{"class":755},[738,1395,837],{"class":748},[738,1397,1398],{"class":740,"line":902},[738,1399,1400],{"class":748},"      $feature_flag: hookContext.flagKey,\n",[738,1402,1403],{"class":740,"line":907},[738,1404,1405],{"class":748},"      $feature_flag_response: details.variant,\n",[738,1407,1408],{"class":740,"line":923},[738,1409,1410],{"class":748},"    });\n",[738,1412,1413],{"class":740,"line":929},[738,1414,950],{"class":748},[738,1416,1417],{"class":740,"line":935},[738,1418,1419],{"class":748},"};\n",[738,1421,1422],{"class":740,"line":941},[738,1423,780],{"emptyLinePlaceholder":9},[738,1425,1426,1428,1430,1432,1435,1438],{"class":740,"line":947},[738,1427,1022],{"class":744},[738,1429,823],{"class":822},[738,1431,826],{"class":744},[738,1433,1434],{"class":748}," OpenFeature.",[738,1436,1437],{"class":789},"getClient",[738,1439,1215],{"class":748},[738,1441,1442],{"class":740,"line":953},[738,1443,780],{"emptyLinePlaceholder":9},[738,1445,1446,1448,1451,1453,1455,1458,1460,1463,1465,1468],{"class":740,"line":959},[738,1447,1022],{"class":744},[738,1449,1450],{"class":822}," buttonLabel",[738,1452,826],{"class":744},[738,1454,970],{"class":748},[738,1456,1457],{"class":789},"getStringValue",[738,1459,793],{"class":748},[738,1461,1462],{"class":755},"\"checkout-cta-copy\"",[738,1464,452],{"class":748},[738,1466,1467],{"class":755},"\"Start free trial\"",[738,1469,837],{"class":748},[738,1471,1472],{"class":740,"line":964},[738,1473,1474],{"class":748},"  hooks: [reportExposure],\n",[738,1476,1477],{"class":740,"line":1186},[738,1478,956],{"class":748},[728,1480,1482],{"className":730,"code":1481,"filename":181,"language":733,"meta":734,"style":734},"import { OpenFeature, type Hook } from \"@openfeature\u002Fserver-sdk\";\nimport { PostHog } from \"posthog-node\";\n\nconst posthog = new PostHog(\"YOUR-POSTHOG-PROJECT-API-KEY\", { host: \"https:\u002F\u002Fus.i.posthog.com\" });\n\nconst reportExposure: Hook = {\n  after: (hookContext, details) => {\n    const userId = hookContext.context.targetingKey;\n    if (!details.variant || !userId) return;\n\n    posthog.capture({\n      distinctId: userId,\n      event: \"$feature_flag_called\",\n      properties: {\n        $feature_flag: hookContext.flagKey,\n        $feature_flag_response: details.variant,\n      },\n    });\n  },\n};\n\nconst client = OpenFeature.getClient();\n\nconst buttonLabel = await client.getStringValue(\n  \"checkout-cta-copy\",\n  \"Start free trial\",\n  { targetingKey: \"user-42\" },\n  { hooks: [reportExposure] },\n);\n",[462,1483,1484,1501,1513,1517,1539,1543,1557,1575,1587,1608,1612,1620,1625,1634,1639,1644,1649,1654,1658,1662,1666,1670,1684,1688,1706,1713,1721,1732,1738],{"__ignoreMap":734},[738,1485,1486,1488,1490,1492,1494,1496,1499],{"class":740,"line":741},[738,1487,745],{"class":744},[738,1489,1273],{"class":748},[738,1491,1276],{"class":744},[738,1493,1279],{"class":748},[738,1495,752],{"class":744},[738,1497,1498],{"class":755}," \"@openfeature\u002Fserver-sdk\"",[738,1500,759],{"class":748},[738,1502,1503,1505,1507,1509,1511],{"class":740,"line":762},[738,1504,745],{"class":744},[738,1506,1006],{"class":748},[738,1508,752],{"class":744},[738,1510,1011],{"class":755},[738,1512,759],{"class":748},[738,1514,1515],{"class":740,"line":777},[738,1516,780],{"emptyLinePlaceholder":9},[738,1518,1519,1521,1523,1525,1527,1529,1531,1533,1535,1537],{"class":740,"line":783},[738,1520,1022],{"class":744},[738,1522,1025],{"class":822},[738,1524,826],{"class":744},[738,1526,1030],{"class":744},[738,1528,1033],{"class":789},[738,1530,793],{"class":748},[738,1532,796],{"class":755},[738,1534,1040],{"class":748},[738,1536,802],{"class":755},[738,1538,805],{"class":748},[738,1540,1541],{"class":740,"line":808},[738,1542,780],{"emptyLinePlaceholder":9},[738,1544,1545,1547,1549,1551,1553,1555],{"class":740,"line":813},[738,1546,1022],{"class":744},[738,1548,1329],{"class":822},[738,1550,723],{"class":744},[738,1552,1335],{"class":1334},[738,1554,826],{"class":744},[738,1556,865],{"class":748},[738,1558,1559,1561,1563,1565,1567,1569,1571,1573],{"class":740,"line":840},[738,1560,1344],{"class":789},[738,1562,1347],{"class":748},[738,1564,1350],{"class":855},[738,1566,452],{"class":748},[738,1568,1355],{"class":855},[738,1570,1358],{"class":748},[738,1572,862],{"class":744},[738,1574,865],{"class":748},[738,1576,1577,1580,1582,1584],{"class":740,"line":846},[738,1578,1579],{"class":744},"    const",[738,1581,1102],{"class":822},[738,1583,826],{"class":744},[738,1585,1586],{"class":748}," hookContext.context.targetingKey;\n",[738,1588,1589,1591,1593,1595,1598,1600,1602,1604,1606],{"class":740,"line":868},[738,1590,1367],{"class":744},[738,1592,888],{"class":748},[738,1594,891],{"class":744},[738,1596,1597],{"class":748},"details.variant ",[738,1599,1121],{"class":744},[738,1601,1124],{"class":744},[738,1603,1127],{"class":748},[738,1605,897],{"class":744},[738,1607,759],{"class":748},[738,1609,1610],{"class":740,"line":882},[738,1611,780],{"emptyLinePlaceholder":9},[738,1613,1614,1616,1618],{"class":740,"line":902},[738,1615,1387],{"class":748},[738,1617,913],{"class":789},[738,1619,1144],{"class":748},[738,1621,1622],{"class":740,"line":907},[738,1623,1624],{"class":748},"      distinctId: userId,\n",[738,1626,1627,1630,1632],{"class":740,"line":923},[738,1628,1629],{"class":748},"      event: ",[738,1631,918],{"class":755},[738,1633,1159],{"class":748},[738,1635,1636],{"class":740,"line":929},[738,1637,1638],{"class":748},"      properties: {\n",[738,1640,1641],{"class":740,"line":935},[738,1642,1643],{"class":748},"        $feature_flag: hookContext.flagKey,\n",[738,1645,1646],{"class":740,"line":941},[738,1647,1648],{"class":748},"        $feature_flag_response: details.variant,\n",[738,1650,1651],{"class":740,"line":947},[738,1652,1653],{"class":748},"      },\n",[738,1655,1656],{"class":740,"line":953},[738,1657,1410],{"class":748},[738,1659,1660],{"class":740,"line":959},[738,1661,950],{"class":748},[738,1663,1664],{"class":740,"line":964},[738,1665,1419],{"class":748},[738,1667,1668],{"class":740,"line":1186},[738,1669,780],{"emptyLinePlaceholder":9},[738,1671,1672,1674,1676,1678,1680,1682],{"class":740,"line":1191},[738,1673,1022],{"class":744},[738,1675,823],{"class":822},[738,1677,826],{"class":744},[738,1679,1434],{"class":748},[738,1681,1437],{"class":789},[738,1683,1215],{"class":748},[738,1685,1686],{"class":740,"line":1196},[738,1687,780],{"emptyLinePlaceholder":9},[738,1689,1690,1692,1694,1696,1699,1701,1703],{"class":740,"line":1201},[738,1691,1022],{"class":744},[738,1693,1450],{"class":822},[738,1695,826],{"class":744},[738,1697,1698],{"class":744}," await",[738,1700,970],{"class":748},[738,1702,1457],{"class":789},[738,1704,1705],{"class":748},"(\n",[738,1707,1708,1711],{"class":740,"line":1206},[738,1709,1710],{"class":755},"  \"checkout-cta-copy\"",[738,1712,1159],{"class":748},[738,1714,1716,1719],{"class":740,"line":1715},26,[738,1717,1718],{"class":755},"  \"Start free trial\"",[738,1720,1159],{"class":748},[738,1722,1724,1727,1729],{"class":740,"line":1723},27,[738,1725,1726],{"class":748},"  { targetingKey: ",[738,1728,979],{"class":755},[738,1730,1731],{"class":748}," },\n",[738,1733,1735],{"class":740,"line":1734},28,[738,1736,1737],{"class":748},"  { hooks: [reportExposure] },\n",[738,1739,1741],{"class":740,"line":1740},29,[738,1742,1743],{"class":748},");\n",[377,1745,1746,1747,1751,1752,394],{},"A variation without a name also has ConfigDirector's ID for the value as its variant, so name each one. The hook needs version 1.11.0 or later of the ",[390,1748,1750],{"href":1749},"\u002Fsdks\u002Fopenfeature\u002Fweb#evaluation-details-and-hooks","Web provider",", or 1.13.0 or later of the ",[390,1753,1755],{"href":1754},"\u002Fsdks\u002Fopenfeature\u002Fnode-js#evaluation-details-and-hooks","Node.js provider",[416,1757,1759],{"id":1758},"when-the-handler-runs","When the handler runs",[377,1761,1762],{},"The handler runs once per evaluation, whenever your application reads the config. So read an experiment where the user reaches the change rather than at startup, or users who never see it count as exposed.",[377,1764,1765,1766,1771,1772,1777,1778,1780],{},"A config read on every render sends an event each time. That does not skew the results, because PostHog ",[390,1767,1770],{"href":1768,"rel":1769,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Fexposures#exposure-deduplication",[602],"counts one exposure per user per variant",". PostHog's ",[390,1773,1776],{"href":1774,"rel":1775,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fbilling\u002Fcommon-questions",[602],"billing page"," lists ",[462,1779,630],{}," as not billed.",[416,1782,1784],{"id":1783},"compare-the-variations","Compare the variations",[377,1786,1787,1788,1793],{},"The outcomes you compare are the events your application already sends to PostHog, so there is nothing more to add to your code. PostHog ",[390,1789,1792],{"href":1790,"rel":1791,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Fexposures#metric-events-dont-need-a-variant-property",[602],"counts an event"," only if it happens after the user's first exposure, and it attributes the event to that user's variant.",[377,1795,1796,1801,1802,1807],{},[390,1797,1800],{"href":1798,"rel":1799,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Fcreating-an-experiment",[602],"Create an experiment in PostHog"," that matches yours, because PostHog ",[390,1803,1806],{"href":1804,"rel":1805,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Frunning-experiments-without-feature-flags#common-issues",[602],"compares these values exactly",", including capitalization:",[381,1809,1810,1813],{},[384,1811,1812],{},"Set its feature flag key to your config key. PostHog's flag keys allow only letters, numbers, hyphens and underscores, so this does not work for a config key with a dot in it.",[384,1814,1815,1816,1819],{},"Name its variants after your variations. PostHog treats a variant named ",[462,1817,1818],{},"control"," as the baseline, or else the first one.",[377,1821,1822],{},"PostHog creates a feature flag for the experiment, which your application never reads, since ConfigDirector still decides who gets which variation.",[377,1824,1825,1826,1831,1832,1835],{},"The handler also runs outside the split: before the run starts, after you ship and when a conditional rule serves a variation. So launch the PostHog experiment after you start the run and end it when the run ends. Otherwise a user served one variation before the run and another during it counts as ",[390,1827,1830],{"href":1828,"rel":1829,"target":603},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Fexperiments\u002Frunning-experiments-without-feature-flags#multiple-variant-handling",[602],"exposed to both",", and PostHog leaves them out of the analysis by default. A conditional rule above the split can still make PostHog's numbers higher than the ",[387,1833,1834],{},"Exposures"," card, which counts only the contexts the split served.",[377,1837,1838],{},"Keep each variation's name for the length of the run, because PostHog compares against the variant names you set.",[1840,1841,1842],"style",{},"html pre.shiki code .sLDKn, html code.shiki .sLDKn{--shiki-light:#A0111F;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sbRM4, html code.shiki .sbRM4{--shiki-light:#0E1116;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .suztq, html code.shiki .suztq{--shiki-light:#032563;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sEIia, html code.shiki .sEIia{--shiki-light:#622CBC;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sxMNI, html code.shiki .sxMNI{--shiki-light:#023B95;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .syyZu, html code.shiki .syyZu{--shiki-light:#702C00;--shiki-default:#E36209;--shiki-dark:#FFAB70}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 .sA9AF, html code.shiki .sA9AF{--shiki-light:#702C00;--shiki-default:#6F42C1;--shiki-dark:#B392F0}",{"title":734,"searchDepth":762,"depth":762,"links":1844},[1845,1846,1851],{"id":375,"depth":762,"text":5},{"id":411,"depth":762,"text":393,"children":1847},[1848,1849,1850],{"id":418,"depth":777,"text":419},{"id":492,"depth":777,"text":493},{"id":562,"depth":777,"text":563},{"id":607,"depth":762,"text":407,"children":1852},[1853,1854,1855,1856,1857],{"id":619,"depth":777,"text":620},{"id":702,"depth":777,"text":703},{"id":1251,"depth":777,"text":1252},{"id":1758,"depth":777,"text":1759},{"id":1783,"depth":777,"text":1784},"Mark every experiment run on your PostHog insights, and report experiment exposures to PostHog from your application so you can compare the variations next to the events you already track there.","md",null,{"modifiedAt":308},{"title":336,"icon":309},{"title":1864,"description":1865},"Analyze Experiments in PostHog","Mark ConfigDirector experiment runs on your PostHog insights with an integration, and send experiment exposures to PostHog as $feature_flag_called events from the browser, Node.js or an OpenFeature hook to compare the variations in a PostHog experiment.","ZD1TzyDIthU4WPxLuCSIZhlfYWwuBm0d1Udm6nGhs60",[1868,1870],{"title":332,"path":333,"stem":334,"description":1869,"icon":309,"children":-1},"Mark every experiment run on your Mixpanel charts, and report experiment exposures to Mixpanel from your application so you can compare the variations next to the events you already track there.",{"title":340,"path":341,"stem":342,"description":1871,"icon":309,"children":-1},"Report experiment exposures to Segment from your application, so the destinations you have connected receive the variation each user saw.",1796089719878]