[{"data":1,"prerenderedAt":2239},["ShallowReactive",2],{"navigation_docs":3,"-integrations-analytics-mixpanel":367,"-integrations-analytics-mixpanel-surround":2234},[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":332,"body":369,"description":2224,"extension":2225,"links":2226,"meta":2227,"navigation":2229,"path":333,"seo":2230,"stem":334,"__hash__":2233},"docs\u002F4.integrations\u002F7.analytics\u002F5.mixpanel.md",{"type":370,"value":371,"toc":2209},"minimark",[372,376,380,409,412,415,420,493,497,554,562,566,594,615,618,624,627,631,643,690,694,715,1405,1412,1425,1437,1441,1448,2112,2124,2128,2131,2152,2168,2172,2175,2187,2202,2205],[373,374,5],"h2",{"id":375},"introduction",[377,378,379],"p",{},"ConfigDirector works with Mixpanel 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 Mixpanel 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 Mixpanel 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 Mixpanel integration posts a marker for each run event. The marker shows on the project's charts, and its description holds the config key and the environment name, what happened and who did it.",[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,461,471],"tbody",{},[427,440,441,447],{},[442,443,444],"td",{},[387,445,446],{},"Data residency",[442,448,449,452,453,456,457,460],{},[387,450,451],{},"US",", ",[387,454,455],{},"EU"," or ",[387,458,459],{},"India",", where the Mixpanel project lives",[427,462,463,468],{},[442,464,465],{},[387,466,467],{},"Project id",[442,469,470],{},"The number in the project's URL in Mixpanel",[427,472,473,482],{},[442,474,475,478,479],{},[387,476,477],{},"Service account username"," and ",[387,480,481],{},"Service account secret",[442,483,484,485,488,489,492],{},"A service account with access to the project, created under ",[387,486,487],{},"Organization settings"," > ",[387,490,491],{},"Service accounts"," in Mixpanel",[416,494,496],{"id":495},"create-the-integration","Create the integration",[498,499,500,510,513,516,529,536,539],"ol",{},[384,501,502,503,505,506,509],{},"Open ",[387,504,273],{}," at the bottom of the dashboard's navigation and pick the tool, or click ",[387,507,508],{},"Add integration"," when you already have one.",[384,511,512],{},"Give the integration a name, or keep the tool's name.",[384,514,515],{},"Fill in the settings above and paste the credential you created in the tool. Credentials are stored encrypted and never shown again.",[384,517,518,519,452,522,478,525,528],{},"Narrow it down with the ",[387,520,521],{},"Projects",[387,523,524],{},"Environments",[387,526,527],{},"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,530,531,532,535],{},"Keep ",[387,533,534],{},"Enabled"," on. A disabled integration marks nothing, and runs that start or end while it is disabled are not marked later.",[384,537,538],{},"Save. The integration's page shows the tool's settings and the address it posts to.",[384,540,541,542,545,546,549,550,553],{},"Click ",[387,543,544],{},"Send test marker"," and confirm. A marker titled ",[387,547,548],{},"ConfigDirector test"," is posted to the tool right away, at the current time, and shows under ",[387,551,552],{},"Deliveries"," with the tool's response, so you can see where run markers will land.",[377,555,556,557,561],{},"The ",[390,558,560],{"href":559},"\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,563,565],{"id":564},"what-configdirector-posts","What ConfigDirector posts",[377,567,568,569,573,574,456,577,580,581,584,585,589,590,593],{},"The integration posts to ",[570,571,572],"code",{},"https:\u002F\u002Fmixpanel.com\u002Fapi\u002Fapp\u002Fprojects\u002F{projectId}\u002Fannotations",", with ",[570,575,576],{},"eu.mixpanel.com",[570,578,579],{},"in.mixpanel.com"," in place of ",[570,582,583],{},"mixpanel.com"," on the EU or India data residency, authenticated with the service account as HTTP Basic credentials. Set an ",[390,586,588],{"href":587},"\u002Fintegrations\u002Fanalytics#endpoint-url-override","endpoint URL"," under ",[387,591,592],{},"Advanced"," only to post somewhere else.",[377,595,596,597,573,600,603,604,607,608,394],{},"The body sent is ",[570,598,599],{},"{ \"date\", \"description\" }",[570,601,602],{},"date"," as ",[570,605,606],{},"YYYY-MM-DD HH:mm:ss"," in UTC. Mixpanel's documentation: ",[390,609,614],{"href":610,"rel":611,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Freference\u002Fcreate-annotation",[612],"noopener","_blank","Create annotation",[373,616,407],{"id":617},"send-exposures-from-your-application",[377,619,620,621,623],{},"To compare an ",[390,622,398],{"href":51},"'s variations in Mixpanel, your application tells Mixpanel which variation each user saw. You add a handler once, and Mixpanel joins those exposures to the events you already send it.",[377,625,626],{},"These exposures go straight from your application to Mixpanel, so nothing passes through ConfigDirector.",[416,628,630],{"id":629},"what-mixpanel-reads","What Mixpanel reads",[377,632,633,634,642],{},"Mixpanel's Experiment report reads an ",[390,635,638,641],{"href":636,"rel":637,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Fdocs\u002Fexperiments#implementation-for-experimentation",[612],[570,639,640],{},"$experiment_started"," event"," with two properties:",[421,644,645,658],{},[424,646,647],{},[427,648,649,652,655],{},[430,650,651],{},"Property",[430,653,654],{},"What you send",[430,656,657],{},"Example",[437,659,660,675],{},[427,661,662,667,670],{},[442,663,664],{},[570,665,666],{},"Experiment name",[442,668,669],{},"The config key",[442,671,672],{},[570,673,674],{},"checkout-cta-copy",[427,676,677,682,685],{},[442,678,679],{},[570,680,681],{},"Variant name",[442,683,684],{},"The variation's name",[442,686,687],{},[570,688,689],{},"treatment-a",[416,691,693],{"id":692},"add-the-handler","Add the handler",[377,695,696,697,700,701,705,706,709,710,714],{},"Add a handler for the ",[570,698,699],{},"configEvaluated"," hook where you create the client, in the ",[390,702,704],{"href":703},"\u002Fsdks\u002Fbrowser\u002Fjavascript#hooks","browser"," or in ",[390,707,181],{"href":708},"\u002Fsdks\u002Fserver\u002Fnode-js#hooks",". This handler sends each exposure once, because sending more ",[390,711,713],{"href":712},"#when-the-handler-runs","can raise your Mixpanel bill",":",[716,717,718,1086],"code-group",{},[719,720,726],"pre",{"className":721,"code":722,"filename":723,"language":724,"meta":725,"style":725},"language-ts shiki shiki-themes github-light-high-contrast github-light github-dark","import { createClient } from \"@configdirector\u002Fclient-sdk\";\nimport mixpanel from \"mixpanel-browser\";\n\nmixpanel.init(\"YOUR-MIXPANEL-PROJECT-TOKEN\");\n\nconst sentExposureKeys = new Set\u003Cstring>();\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      const exposureKey = `${evaluation.context?.id}\u002F${evaluation.key}\u002F${variationName}`;\n      if (sentExposureKeys.has(exposureKey)) return;\n      sentExposureKeys.add(exposureKey);\n\n      mixpanel.track(\"$experiment_started\", {\n        \"Experiment name\": evaluation.key,\n        \"Variant name\": variationName,\n      });\n    },\n  },\n});\n\nawait client.initialize({ id: \"user-42\" });\n","Browser","ts","",[570,727,728,751,766,772,791,796,824,829,854,860,882,896,916,921,967,985,997,1002,1018,1027,1036,1042,1048,1054,1060,1065],{"__ignoreMap":725},[729,730,733,737,741,744,748],"span",{"class":731,"line":732},"line",1,[729,734,736],{"class":735},"sLDKn","import",[729,738,740],{"class":739},"sbRM4"," { createClient } ",[729,742,743],{"class":735},"from",[729,745,747],{"class":746},"suztq"," \"@configdirector\u002Fclient-sdk\"",[729,749,750],{"class":739},";\n",[729,752,754,756,759,761,764],{"class":731,"line":753},2,[729,755,736],{"class":735},[729,757,758],{"class":739}," mixpanel ",[729,760,743],{"class":735},[729,762,763],{"class":746}," \"mixpanel-browser\"",[729,765,750],{"class":739},[729,767,769],{"class":731,"line":768},3,[729,770,771],{"emptyLinePlaceholder":9},"\n",[729,773,775,778,782,785,788],{"class":731,"line":774},4,[729,776,777],{"class":739},"mixpanel.",[729,779,781],{"class":780},"sEIia","init",[729,783,784],{"class":739},"(",[729,786,787],{"class":746},"\"YOUR-MIXPANEL-PROJECT-TOKEN\"",[729,789,790],{"class":739},");\n",[729,792,794],{"class":731,"line":793},5,[729,795,771],{"emptyLinePlaceholder":9},[729,797,799,802,806,809,812,815,818,821],{"class":731,"line":798},6,[729,800,801],{"class":735},"const",[729,803,805],{"class":804},"sxMNI"," sentExposureKeys",[729,807,808],{"class":735}," =",[729,810,811],{"class":735}," new",[729,813,814],{"class":780}," Set",[729,816,817],{"class":739},"\u003C",[729,819,820],{"class":804},"string",[729,822,823],{"class":739},">();\n",[729,825,827],{"class":731,"line":826},7,[729,828,771],{"emptyLinePlaceholder":9},[729,830,832,835,838,841,843,846,848,851],{"class":731,"line":831},8,[729,833,834],{"class":735},"export",[729,836,837],{"class":735}," const",[729,839,840],{"class":804}," client",[729,842,808],{"class":735},[729,844,845],{"class":780}," createClient",[729,847,784],{"class":739},[729,849,850],{"class":746},"\"YOUR-CLIENT-SDK-KEY\"",[729,852,853],{"class":739},", {\n",[729,855,857],{"class":731,"line":856},9,[729,858,859],{"class":739},"  hooks: {\n",[729,861,863,866,869,873,876,879],{"class":731,"line":862},10,[729,864,865],{"class":780},"    configEvaluated",[729,867,868],{"class":739},": ({ ",[729,870,872],{"class":871},"syyZu","evaluation",[729,874,875],{"class":739}," }) ",[729,877,878],{"class":735},"=>",[729,880,881],{"class":739}," {\n",[729,883,885,888,891,893],{"class":731,"line":884},11,[729,886,887],{"class":735},"      const",[729,889,890],{"class":804}," variationName",[729,892,808],{"class":735},[729,894,895],{"class":739}," evaluation.variation?.name;\n",[729,897,899,902,905,908,911,914],{"class":731,"line":898},12,[729,900,901],{"class":735},"      if",[729,903,904],{"class":739}," (",[729,906,907],{"class":735},"!",[729,909,910],{"class":739},"variationName) ",[729,912,913],{"class":735},"return",[729,915,750],{"class":739},[729,917,919],{"class":731,"line":918},13,[729,920,771],{"emptyLinePlaceholder":9},[729,922,924,926,929,931,934,936,938,941,944,947,950,952,954,957,959,962,965],{"class":731,"line":923},14,[729,925,887],{"class":735},[729,927,928],{"class":804}," exposureKey",[729,930,808],{"class":735},[729,932,933],{"class":746}," `${",[729,935,872],{"class":739},[729,937,394],{"class":746},[729,939,940],{"class":739},"context",[729,942,943],{"class":746},"?.",[729,945,946],{"class":739},"id",[729,948,949],{"class":746},"}\u002F${",[729,951,872],{"class":739},[729,953,394],{"class":746},[729,955,956],{"class":739},"key",[729,958,949],{"class":746},[729,960,961],{"class":739},"variationName",[729,963,964],{"class":746},"}`",[729,966,750],{"class":739},[729,968,970,972,975,978,981,983],{"class":731,"line":969},15,[729,971,901],{"class":735},[729,973,974],{"class":739}," (sentExposureKeys.",[729,976,977],{"class":780},"has",[729,979,980],{"class":739},"(exposureKey)) ",[729,982,913],{"class":735},[729,984,750],{"class":739},[729,986,988,991,994],{"class":731,"line":987},16,[729,989,990],{"class":739},"      sentExposureKeys.",[729,992,993],{"class":780},"add",[729,995,996],{"class":739},"(exposureKey);\n",[729,998,1000],{"class":731,"line":999},17,[729,1001,771],{"emptyLinePlaceholder":9},[729,1003,1005,1008,1011,1013,1016],{"class":731,"line":1004},18,[729,1006,1007],{"class":739},"      mixpanel.",[729,1009,1010],{"class":780},"track",[729,1012,784],{"class":739},[729,1014,1015],{"class":746},"\"$experiment_started\"",[729,1017,853],{"class":739},[729,1019,1021,1024],{"class":731,"line":1020},19,[729,1022,1023],{"class":746},"        \"Experiment name\"",[729,1025,1026],{"class":739},": evaluation.key,\n",[729,1028,1030,1033],{"class":731,"line":1029},20,[729,1031,1032],{"class":746},"        \"Variant name\"",[729,1034,1035],{"class":739},": variationName,\n",[729,1037,1039],{"class":731,"line":1038},21,[729,1040,1041],{"class":739},"      });\n",[729,1043,1045],{"class":731,"line":1044},22,[729,1046,1047],{"class":739},"    },\n",[729,1049,1051],{"class":731,"line":1050},23,[729,1052,1053],{"class":739},"  },\n",[729,1055,1057],{"class":731,"line":1056},24,[729,1058,1059],{"class":739},"});\n",[729,1061,1063],{"class":731,"line":1062},25,[729,1064,771],{"emptyLinePlaceholder":9},[729,1066,1068,1071,1074,1077,1080,1083],{"class":731,"line":1067},26,[729,1069,1070],{"class":735},"await",[729,1072,1073],{"class":739}," client.",[729,1075,1076],{"class":780},"initialize",[729,1078,1079],{"class":739},"({ id: ",[729,1081,1082],{"class":746},"\"user-42\"",[729,1084,1085],{"class":739}," });\n",[719,1087,1089],{"className":721,"code":1088,"filename":181,"language":724,"meta":725,"style":725},"import { createClient } from \"@configdirector\u002Fserver-sdk\";\nimport { LRUCache } from \"lru-cache\";\nimport Mixpanel from \"mixpanel\";\n\nconst mixpanel = Mixpanel.init(\"YOUR-MIXPANEL-PROJECT-TOKEN\");\n\nconst sentExposureKeys = new LRUCache\u003Cstring, true>({ max: 100_000 });\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      const exposureKey = `${userId}\u002F${evaluation.key}\u002F${variationName}`;\n      if (sentExposureKeys.has(exposureKey)) return;\n      sentExposureKeys.set(exposureKey, true);\n\n      mixpanel.track(\"$experiment_started\", {\n        distinct_id: userId,\n        \"Experiment name\": evaluation.key,\n        \"Variant name\": variationName,\n      });\n    },\n  },\n});\n\nawait client.initialize();\n",[570,1090,1091,1104,1118,1132,1136,1156,1160,1190,1194,1213,1217,1231,1241,1253,1277,1281,1310,1324,1338,1342,1354,1359,1365,1371,1375,1379,1383,1388,1393],{"__ignoreMap":725},[729,1092,1093,1095,1097,1099,1102],{"class":731,"line":732},[729,1094,736],{"class":735},[729,1096,740],{"class":739},[729,1098,743],{"class":735},[729,1100,1101],{"class":746}," \"@configdirector\u002Fserver-sdk\"",[729,1103,750],{"class":739},[729,1105,1106,1108,1111,1113,1116],{"class":731,"line":753},[729,1107,736],{"class":735},[729,1109,1110],{"class":739}," { LRUCache } ",[729,1112,743],{"class":735},[729,1114,1115],{"class":746}," \"lru-cache\"",[729,1117,750],{"class":739},[729,1119,1120,1122,1125,1127,1130],{"class":731,"line":768},[729,1121,736],{"class":735},[729,1123,1124],{"class":739}," Mixpanel ",[729,1126,743],{"class":735},[729,1128,1129],{"class":746}," \"mixpanel\"",[729,1131,750],{"class":739},[729,1133,1134],{"class":731,"line":774},[729,1135,771],{"emptyLinePlaceholder":9},[729,1137,1138,1140,1143,1145,1148,1150,1152,1154],{"class":731,"line":793},[729,1139,801],{"class":735},[729,1141,1142],{"class":804}," mixpanel",[729,1144,808],{"class":735},[729,1146,1147],{"class":739}," Mixpanel.",[729,1149,781],{"class":780},[729,1151,784],{"class":739},[729,1153,787],{"class":746},[729,1155,790],{"class":739},[729,1157,1158],{"class":731,"line":798},[729,1159,771],{"emptyLinePlaceholder":9},[729,1161,1162,1164,1166,1168,1170,1173,1175,1177,1179,1182,1185,1188],{"class":731,"line":826},[729,1163,801],{"class":735},[729,1165,805],{"class":804},[729,1167,808],{"class":735},[729,1169,811],{"class":735},[729,1171,1172],{"class":780}," LRUCache",[729,1174,817],{"class":739},[729,1176,820],{"class":804},[729,1178,452],{"class":739},[729,1180,1181],{"class":804},"true",[729,1183,1184],{"class":739},">({ max: ",[729,1186,1187],{"class":804},"100_000",[729,1189,1085],{"class":739},[729,1191,1192],{"class":731,"line":831},[729,1193,771],{"emptyLinePlaceholder":9},[729,1195,1196,1198,1200,1202,1204,1206,1208,1211],{"class":731,"line":856},[729,1197,834],{"class":735},[729,1199,837],{"class":735},[729,1201,840],{"class":804},[729,1203,808],{"class":735},[729,1205,845],{"class":780},[729,1207,784],{"class":739},[729,1209,1210],{"class":746},"\"YOUR-SERVER-SDK-KEY\"",[729,1212,853],{"class":739},[729,1214,1215],{"class":731,"line":862},[729,1216,859],{"class":739},[729,1218,1219,1221,1223,1225,1227,1229],{"class":731,"line":884},[729,1220,865],{"class":780},[729,1222,868],{"class":739},[729,1224,872],{"class":871},[729,1226,875],{"class":739},[729,1228,878],{"class":735},[729,1230,881],{"class":739},[729,1232,1233,1235,1237,1239],{"class":731,"line":898},[729,1234,887],{"class":735},[729,1236,890],{"class":804},[729,1238,808],{"class":735},[729,1240,895],{"class":739},[729,1242,1243,1245,1248,1250],{"class":731,"line":918},[729,1244,887],{"class":735},[729,1246,1247],{"class":804}," userId",[729,1249,808],{"class":735},[729,1251,1252],{"class":739}," evaluation.context?.id;\n",[729,1254,1255,1257,1259,1261,1264,1267,1270,1273,1275],{"class":731,"line":923},[729,1256,901],{"class":735},[729,1258,904],{"class":739},[729,1260,907],{"class":735},[729,1262,1263],{"class":739},"variationName ",[729,1265,1266],{"class":735},"||",[729,1268,1269],{"class":735}," !",[729,1271,1272],{"class":739},"userId) ",[729,1274,913],{"class":735},[729,1276,750],{"class":739},[729,1278,1279],{"class":731,"line":969},[729,1280,771],{"emptyLinePlaceholder":9},[729,1282,1283,1285,1287,1289,1291,1294,1296,1298,1300,1302,1304,1306,1308],{"class":731,"line":987},[729,1284,887],{"class":735},[729,1286,928],{"class":804},[729,1288,808],{"class":735},[729,1290,933],{"class":746},[729,1292,1293],{"class":739},"userId",[729,1295,949],{"class":746},[729,1297,872],{"class":739},[729,1299,394],{"class":746},[729,1301,956],{"class":739},[729,1303,949],{"class":746},[729,1305,961],{"class":739},[729,1307,964],{"class":746},[729,1309,750],{"class":739},[729,1311,1312,1314,1316,1318,1320,1322],{"class":731,"line":999},[729,1313,901],{"class":735},[729,1315,974],{"class":739},[729,1317,977],{"class":780},[729,1319,980],{"class":739},[729,1321,913],{"class":735},[729,1323,750],{"class":739},[729,1325,1326,1328,1331,1334,1336],{"class":731,"line":1004},[729,1327,990],{"class":739},[729,1329,1330],{"class":780},"set",[729,1332,1333],{"class":739},"(exposureKey, ",[729,1335,1181],{"class":804},[729,1337,790],{"class":739},[729,1339,1340],{"class":731,"line":1020},[729,1341,771],{"emptyLinePlaceholder":9},[729,1343,1344,1346,1348,1350,1352],{"class":731,"line":1029},[729,1345,1007],{"class":739},[729,1347,1010],{"class":780},[729,1349,784],{"class":739},[729,1351,1015],{"class":746},[729,1353,853],{"class":739},[729,1355,1356],{"class":731,"line":1038},[729,1357,1358],{"class":739},"        distinct_id: userId,\n",[729,1360,1361,1363],{"class":731,"line":1044},[729,1362,1023],{"class":746},[729,1364,1026],{"class":739},[729,1366,1367,1369],{"class":731,"line":1050},[729,1368,1032],{"class":746},[729,1370,1035],{"class":739},[729,1372,1373],{"class":731,"line":1056},[729,1374,1041],{"class":739},[729,1376,1377],{"class":731,"line":1062},[729,1378,1047],{"class":739},[729,1380,1381],{"class":731,"line":1067},[729,1382,1053],{"class":739},[729,1384,1386],{"class":731,"line":1385},27,[729,1387,1059],{"class":739},[729,1389,1391],{"class":731,"line":1390},28,[729,1392,771],{"emptyLinePlaceholder":9},[729,1394,1396,1398,1400,1402],{"class":731,"line":1395},29,[729,1397,1070],{"class":735},[729,1399,1073],{"class":739},[729,1401,1076],{"class":780},[729,1403,1404],{"class":739},"();\n",[377,1406,1407,1408,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,1409,1411],{"href":1410},"\u002Fgetting-started\u002Fexperiments#create-the-experiment","name each one",[377,1413,1414,1415,1417,1418,1421,1422,1424],{},"In the browser, Mixpanel attaches the exposure to the user you have identified to it. In Node.js, the handler passes the context's ",[570,1416,946],{}," as the ",[570,1419,1420],{},"distinct_id",", so it has to be the ID your other Mixpanel events use. A context without an ",[570,1423,946],{}," is skipped, since it does not take part in the split on a server.",[377,1426,1427,1428,1431,1432,1436],{},"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 ",[570,1429,1430],{},"hooks",". The ",[390,1433,1435],{"href":1434},"\u002Fgetting-started\u002Fexperiments#send-exposures-to-your-analytics-tool","Experiments guide"," lists the hook for every other SDK.",[416,1438,1440],{"id":1439},"with-openfeature","With OpenFeature",[377,1442,1443,1444,1447],{},"In an OpenFeature application, a hook does the same job, with the ",[570,1445,1446],{},"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:",[716,1449,1450,1761],{},[719,1451,1453],{"className":721,"code":1452,"filename":223,"language":724,"meta":725,"style":725},"import { OpenFeature, type Hook } from \"@openfeature\u002Fweb-sdk\";\nimport mixpanel from \"mixpanel-browser\";\n\nmixpanel.init(\"YOUR-MIXPANEL-PROJECT-TOKEN\");\n\nconst sentExposureKeys = new Set\u003Cstring>();\n\nconst reportExposure: Hook = {\n  after: (hookContext, details) => {\n    if (!details.variant) return;\n\n    const exposureKey = `${hookContext.context.targetingKey}\u002F${hookContext.flagKey}\u002F${details.variant}`;\n    if (sentExposureKeys.has(exposureKey)) return;\n    sentExposureKeys.add(exposureKey);\n\n    mixpanel.track(\"$experiment_started\", {\n      \"Experiment name\": hookContext.flagKey,\n      \"Variant name\": 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",[570,1454,1455,1475,1487,1491,1503,1507,1525,1529,1546,1569,1585,1589,1632,1646,1655,1659,1672,1680,1688,1693,1697,1702,1706,1722,1726,1752,1757],{"__ignoreMap":725},[729,1456,1457,1459,1462,1465,1468,1470,1473],{"class":731,"line":732},[729,1458,736],{"class":735},[729,1460,1461],{"class":739}," { OpenFeature, ",[729,1463,1464],{"class":735},"type",[729,1466,1467],{"class":739}," Hook } ",[729,1469,743],{"class":735},[729,1471,1472],{"class":746}," \"@openfeature\u002Fweb-sdk\"",[729,1474,750],{"class":739},[729,1476,1477,1479,1481,1483,1485],{"class":731,"line":753},[729,1478,736],{"class":735},[729,1480,758],{"class":739},[729,1482,743],{"class":735},[729,1484,763],{"class":746},[729,1486,750],{"class":739},[729,1488,1489],{"class":731,"line":768},[729,1490,771],{"emptyLinePlaceholder":9},[729,1492,1493,1495,1497,1499,1501],{"class":731,"line":774},[729,1494,777],{"class":739},[729,1496,781],{"class":780},[729,1498,784],{"class":739},[729,1500,787],{"class":746},[729,1502,790],{"class":739},[729,1504,1505],{"class":731,"line":793},[729,1506,771],{"emptyLinePlaceholder":9},[729,1508,1509,1511,1513,1515,1517,1519,1521,1523],{"class":731,"line":798},[729,1510,801],{"class":735},[729,1512,805],{"class":804},[729,1514,808],{"class":735},[729,1516,811],{"class":735},[729,1518,814],{"class":780},[729,1520,817],{"class":739},[729,1522,820],{"class":804},[729,1524,823],{"class":739},[729,1526,1527],{"class":731,"line":826},[729,1528,771],{"emptyLinePlaceholder":9},[729,1530,1531,1533,1536,1538,1542,1544],{"class":731,"line":831},[729,1532,801],{"class":735},[729,1534,1535],{"class":804}," reportExposure",[729,1537,714],{"class":735},[729,1539,1541],{"class":1540},"sA9AF"," Hook",[729,1543,808],{"class":735},[729,1545,881],{"class":739},[729,1547,1548,1551,1554,1557,1559,1562,1565,1567],{"class":731,"line":856},[729,1549,1550],{"class":780},"  after",[729,1552,1553],{"class":739},": (",[729,1555,1556],{"class":871},"hookContext",[729,1558,452],{"class":739},[729,1560,1561],{"class":871},"details",[729,1563,1564],{"class":739},") ",[729,1566,878],{"class":735},[729,1568,881],{"class":739},[729,1570,1571,1574,1576,1578,1581,1583],{"class":731,"line":862},[729,1572,1573],{"class":735},"    if",[729,1575,904],{"class":739},[729,1577,907],{"class":735},[729,1579,1580],{"class":739},"details.variant) ",[729,1582,913],{"class":735},[729,1584,750],{"class":739},[729,1586,1587],{"class":731,"line":884},[729,1588,771],{"emptyLinePlaceholder":9},[729,1590,1591,1594,1596,1598,1600,1602,1604,1606,1608,1611,1613,1615,1617,1620,1622,1624,1626,1628,1630],{"class":731,"line":898},[729,1592,1593],{"class":735},"    const",[729,1595,928],{"class":804},[729,1597,808],{"class":735},[729,1599,933],{"class":746},[729,1601,1556],{"class":739},[729,1603,394],{"class":746},[729,1605,940],{"class":739},[729,1607,394],{"class":746},[729,1609,1610],{"class":739},"targetingKey",[729,1612,949],{"class":746},[729,1614,1556],{"class":739},[729,1616,394],{"class":746},[729,1618,1619],{"class":739},"flagKey",[729,1621,949],{"class":746},[729,1623,1561],{"class":739},[729,1625,394],{"class":746},[729,1627,1446],{"class":739},[729,1629,964],{"class":746},[729,1631,750],{"class":739},[729,1633,1634,1636,1638,1640,1642,1644],{"class":731,"line":918},[729,1635,1573],{"class":735},[729,1637,974],{"class":739},[729,1639,977],{"class":780},[729,1641,980],{"class":739},[729,1643,913],{"class":735},[729,1645,750],{"class":739},[729,1647,1648,1651,1653],{"class":731,"line":923},[729,1649,1650],{"class":739},"    sentExposureKeys.",[729,1652,993],{"class":780},[729,1654,996],{"class":739},[729,1656,1657],{"class":731,"line":969},[729,1658,771],{"emptyLinePlaceholder":9},[729,1660,1661,1664,1666,1668,1670],{"class":731,"line":987},[729,1662,1663],{"class":739},"    mixpanel.",[729,1665,1010],{"class":780},[729,1667,784],{"class":739},[729,1669,1015],{"class":746},[729,1671,853],{"class":739},[729,1673,1674,1677],{"class":731,"line":999},[729,1675,1676],{"class":746},"      \"Experiment name\"",[729,1678,1679],{"class":739},": hookContext.flagKey,\n",[729,1681,1682,1685],{"class":731,"line":1004},[729,1683,1684],{"class":746},"      \"Variant name\"",[729,1686,1687],{"class":739},": details.variant,\n",[729,1689,1690],{"class":731,"line":1020},[729,1691,1692],{"class":739},"    });\n",[729,1694,1695],{"class":731,"line":1029},[729,1696,1053],{"class":739},[729,1698,1699],{"class":731,"line":1038},[729,1700,1701],{"class":739},"};\n",[729,1703,1704],{"class":731,"line":1044},[729,1705,771],{"emptyLinePlaceholder":9},[729,1707,1708,1710,1712,1714,1717,1720],{"class":731,"line":1050},[729,1709,801],{"class":735},[729,1711,840],{"class":804},[729,1713,808],{"class":735},[729,1715,1716],{"class":739}," OpenFeature.",[729,1718,1719],{"class":780},"getClient",[729,1721,1404],{"class":739},[729,1723,1724],{"class":731,"line":1056},[729,1725,771],{"emptyLinePlaceholder":9},[729,1727,1728,1730,1733,1735,1737,1740,1742,1745,1747,1750],{"class":731,"line":1062},[729,1729,801],{"class":735},[729,1731,1732],{"class":804}," buttonLabel",[729,1734,808],{"class":735},[729,1736,1073],{"class":739},[729,1738,1739],{"class":780},"getStringValue",[729,1741,784],{"class":739},[729,1743,1744],{"class":746},"\"checkout-cta-copy\"",[729,1746,452],{"class":739},[729,1748,1749],{"class":746},"\"Start free trial\"",[729,1751,853],{"class":739},[729,1753,1754],{"class":731,"line":1067},[729,1755,1756],{"class":739},"  hooks: [reportExposure],\n",[729,1758,1759],{"class":731,"line":1385},[729,1760,1059],{"class":739},[719,1762,1764],{"className":721,"code":1763,"filename":181,"language":724,"meta":725,"style":725},"import { OpenFeature, type Hook } from \"@openfeature\u002Fserver-sdk\";\nimport { LRUCache } from \"lru-cache\";\nimport Mixpanel from \"mixpanel\";\n\nconst mixpanel = Mixpanel.init(\"YOUR-MIXPANEL-PROJECT-TOKEN\");\n\nconst sentExposureKeys = new LRUCache\u003Cstring, true>({ max: 100_000 });\n\nconst reportExposure: Hook = {\n  after: (hookContext, details) => {\n    const userId = hookContext.context.targetingKey;\n    if (!details.variant || !userId) return;\n\n    const exposureKey = `${userId}\u002F${hookContext.flagKey}\u002F${details.variant}`;\n    if (sentExposureKeys.has(exposureKey)) return;\n    sentExposureKeys.set(exposureKey, true);\n\n    mixpanel.track(\"$experiment_started\", {\n      distinct_id: userId,\n      \"Experiment name\": hookContext.flagKey,\n      \"Variant name\": details.variant,\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",[570,1765,1766,1783,1795,1807,1811,1829,1833,1859,1863,1877,1895,1906,1927,1931,1963,1977,1989,1993,2005,2010,2016,2022,2026,2030,2034,2038,2052,2056,2074,2082,2090,2101,2107],{"__ignoreMap":725},[729,1767,1768,1770,1772,1774,1776,1778,1781],{"class":731,"line":732},[729,1769,736],{"class":735},[729,1771,1461],{"class":739},[729,1773,1464],{"class":735},[729,1775,1467],{"class":739},[729,1777,743],{"class":735},[729,1779,1780],{"class":746}," \"@openfeature\u002Fserver-sdk\"",[729,1782,750],{"class":739},[729,1784,1785,1787,1789,1791,1793],{"class":731,"line":753},[729,1786,736],{"class":735},[729,1788,1110],{"class":739},[729,1790,743],{"class":735},[729,1792,1115],{"class":746},[729,1794,750],{"class":739},[729,1796,1797,1799,1801,1803,1805],{"class":731,"line":768},[729,1798,736],{"class":735},[729,1800,1124],{"class":739},[729,1802,743],{"class":735},[729,1804,1129],{"class":746},[729,1806,750],{"class":739},[729,1808,1809],{"class":731,"line":774},[729,1810,771],{"emptyLinePlaceholder":9},[729,1812,1813,1815,1817,1819,1821,1823,1825,1827],{"class":731,"line":793},[729,1814,801],{"class":735},[729,1816,1142],{"class":804},[729,1818,808],{"class":735},[729,1820,1147],{"class":739},[729,1822,781],{"class":780},[729,1824,784],{"class":739},[729,1826,787],{"class":746},[729,1828,790],{"class":739},[729,1830,1831],{"class":731,"line":798},[729,1832,771],{"emptyLinePlaceholder":9},[729,1834,1835,1837,1839,1841,1843,1845,1847,1849,1851,1853,1855,1857],{"class":731,"line":826},[729,1836,801],{"class":735},[729,1838,805],{"class":804},[729,1840,808],{"class":735},[729,1842,811],{"class":735},[729,1844,1172],{"class":780},[729,1846,817],{"class":739},[729,1848,820],{"class":804},[729,1850,452],{"class":739},[729,1852,1181],{"class":804},[729,1854,1184],{"class":739},[729,1856,1187],{"class":804},[729,1858,1085],{"class":739},[729,1860,1861],{"class":731,"line":831},[729,1862,771],{"emptyLinePlaceholder":9},[729,1864,1865,1867,1869,1871,1873,1875],{"class":731,"line":856},[729,1866,801],{"class":735},[729,1868,1535],{"class":804},[729,1870,714],{"class":735},[729,1872,1541],{"class":1540},[729,1874,808],{"class":735},[729,1876,881],{"class":739},[729,1878,1879,1881,1883,1885,1887,1889,1891,1893],{"class":731,"line":862},[729,1880,1550],{"class":780},[729,1882,1553],{"class":739},[729,1884,1556],{"class":871},[729,1886,452],{"class":739},[729,1888,1561],{"class":871},[729,1890,1564],{"class":739},[729,1892,878],{"class":735},[729,1894,881],{"class":739},[729,1896,1897,1899,1901,1903],{"class":731,"line":884},[729,1898,1593],{"class":735},[729,1900,1247],{"class":804},[729,1902,808],{"class":735},[729,1904,1905],{"class":739}," hookContext.context.targetingKey;\n",[729,1907,1908,1910,1912,1914,1917,1919,1921,1923,1925],{"class":731,"line":898},[729,1909,1573],{"class":735},[729,1911,904],{"class":739},[729,1913,907],{"class":735},[729,1915,1916],{"class":739},"details.variant ",[729,1918,1266],{"class":735},[729,1920,1269],{"class":735},[729,1922,1272],{"class":739},[729,1924,913],{"class":735},[729,1926,750],{"class":739},[729,1928,1929],{"class":731,"line":918},[729,1930,771],{"emptyLinePlaceholder":9},[729,1932,1933,1935,1937,1939,1941,1943,1945,1947,1949,1951,1953,1955,1957,1959,1961],{"class":731,"line":923},[729,1934,1593],{"class":735},[729,1936,928],{"class":804},[729,1938,808],{"class":735},[729,1940,933],{"class":746},[729,1942,1293],{"class":739},[729,1944,949],{"class":746},[729,1946,1556],{"class":739},[729,1948,394],{"class":746},[729,1950,1619],{"class":739},[729,1952,949],{"class":746},[729,1954,1561],{"class":739},[729,1956,394],{"class":746},[729,1958,1446],{"class":739},[729,1960,964],{"class":746},[729,1962,750],{"class":739},[729,1964,1965,1967,1969,1971,1973,1975],{"class":731,"line":969},[729,1966,1573],{"class":735},[729,1968,974],{"class":739},[729,1970,977],{"class":780},[729,1972,980],{"class":739},[729,1974,913],{"class":735},[729,1976,750],{"class":739},[729,1978,1979,1981,1983,1985,1987],{"class":731,"line":987},[729,1980,1650],{"class":739},[729,1982,1330],{"class":780},[729,1984,1333],{"class":739},[729,1986,1181],{"class":804},[729,1988,790],{"class":739},[729,1990,1991],{"class":731,"line":999},[729,1992,771],{"emptyLinePlaceholder":9},[729,1994,1995,1997,1999,2001,2003],{"class":731,"line":1004},[729,1996,1663],{"class":739},[729,1998,1010],{"class":780},[729,2000,784],{"class":739},[729,2002,1015],{"class":746},[729,2004,853],{"class":739},[729,2006,2007],{"class":731,"line":1020},[729,2008,2009],{"class":739},"      distinct_id: userId,\n",[729,2011,2012,2014],{"class":731,"line":1029},[729,2013,1676],{"class":746},[729,2015,1679],{"class":739},[729,2017,2018,2020],{"class":731,"line":1038},[729,2019,1684],{"class":746},[729,2021,1687],{"class":739},[729,2023,2024],{"class":731,"line":1044},[729,2025,1692],{"class":739},[729,2027,2028],{"class":731,"line":1050},[729,2029,1053],{"class":739},[729,2031,2032],{"class":731,"line":1056},[729,2033,1701],{"class":739},[729,2035,2036],{"class":731,"line":1062},[729,2037,771],{"emptyLinePlaceholder":9},[729,2039,2040,2042,2044,2046,2048,2050],{"class":731,"line":1067},[729,2041,801],{"class":735},[729,2043,840],{"class":804},[729,2045,808],{"class":735},[729,2047,1716],{"class":739},[729,2049,1719],{"class":780},[729,2051,1404],{"class":739},[729,2053,2054],{"class":731,"line":1385},[729,2055,771],{"emptyLinePlaceholder":9},[729,2057,2058,2060,2062,2064,2067,2069,2071],{"class":731,"line":1390},[729,2059,801],{"class":735},[729,2061,1732],{"class":804},[729,2063,808],{"class":735},[729,2065,2066],{"class":735}," await",[729,2068,1073],{"class":739},[729,2070,1739],{"class":780},[729,2072,2073],{"class":739},"(\n",[729,2075,2076,2079],{"class":731,"line":1395},[729,2077,2078],{"class":746},"  \"checkout-cta-copy\"",[729,2080,2081],{"class":739},",\n",[729,2083,2085,2088],{"class":731,"line":2084},30,[729,2086,2087],{"class":746},"  \"Start free trial\"",[729,2089,2081],{"class":739},[729,2091,2093,2096,2098],{"class":731,"line":2092},31,[729,2094,2095],{"class":739},"  { targetingKey: ",[729,2097,1082],{"class":746},[729,2099,2100],{"class":739}," },\n",[729,2102,2104],{"class":731,"line":2103},32,[729,2105,2106],{"class":739},"  { hooks: [reportExposure] },\n",[729,2108,2110],{"class":731,"line":2109},33,[729,2111,790],{"class":739},[377,2113,2114,2115,2119,2120,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,2116,2118],{"href":2117},"\u002Fsdks\u002Fopenfeature\u002Fweb#evaluation-details-and-hooks","Web provider",", or 1.13.0 or later of the ",[390,2121,2123],{"href":2122},"\u002Fsdks\u002Fopenfeature\u002Fnode-js#evaluation-details-and-hooks","Node.js provider",[416,2125,2127],{"id":2126},"when-the-handler-runs","When the handler runs",[377,2129,2130],{},"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,2132,2133,2134,2139,2140,2145,2146,2151],{},"Mixpanel ",[390,2135,2138],{"href":2136,"rel":2137,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Fdocs\u002Fexperiments#when-to-track-an-exposure-event",[612],"only needs an exposure the first time a user sees a variation",", and sending more can cost you. It ",[390,2141,2144],{"href":2142,"rel":2143,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Fdocs\u002Fexperiments\u002Fexposure-event-metering",[612],"meters experiments"," by the distinct users exposed each month, but once your users average more than 30 exposure events a month, it ",[390,2147,2150],{"href":2148,"rel":2149,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Fdocs\u002Fexperiments#does-it-matter-how-many-experiments-a-user-is-exposed-to-within-the-month",[612],"divides your total exposure events by 30 instead",". A config read on every render would get there quickly, which is why the handler checks what it has already sent:",[381,2153,2154,2165],{},[384,2155,2156,2157,2160,2161,2164],{},"In the browser, ",[570,2158,2159],{},"sentExposureKeys"," holds one entry per variation the page reads for each user, and it empties when the page loads again. So a site that reloads on every navigation sends once per page, and a single-page app sends once until the next reload. To send less, keep the entries in ",[570,2162,2163],{},"localStorage"," and remove them when the run ends.",[384,2166,2167],{},"In Node.js, each server process remembers the latest 100,000 it has sent. A user who drops out of that cache, or who evaluates after a restart, is sent once more, which does not change your results.",[416,2169,2171],{"id":2170},"compare-the-variations","Compare the variations",[377,2173,2174],{},"The outcomes you compare are the events your application already sends to Mixpanel, so there is nothing more to add to your code.",[377,2176,556,2177,2182,2183,2186],{},[390,2178,2181],{"href":2179,"rel":2180,"target":613},"https:\u002F\u002Fdocs.mixpanel.com\u002Fdocs\u002Fexperiments",[612],"Experiment report"," compares them per variation, and it is available on Mixpanel's Free, Growth and Enterprise plans. Click ",[387,2184,2185],{},"New Experiment"," in the report menu and pick your config key from the dropdown, which lists the experiments that received an exposure in the last 30 days. Mixpanel then counts a user's later events toward the variation they were exposed to.",[377,2188,2189,2190,2197,2198,2201],{},"The handler also runs outside the split: before the run starts, after you ship and when a conditional rule serves a variation. So set the report to the dates of the run, which the ",[390,2191,2193,2196],{"href":2192},"\u002Fgetting-started\u002Fexperiments#read-the-exposures",[387,2194,2195],{},"Experiment"," tab"," lists. A conditional rule above the split can still make Mixpanel's numbers higher than the ",[387,2199,2200],{},"Exposures"," card, which counts only the contexts the split served.",[377,2203,2204],{},"Keep each variation's name for the length of the run, because Mixpanel treats a new name as a new variant.",[2206,2207,2208],"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":725,"searchDepth":753,"depth":753,"links":2210},[2211,2212,2217],{"id":375,"depth":753,"text":5},{"id":411,"depth":753,"text":393,"children":2213},[2214,2215,2216],{"id":418,"depth":768,"text":419},{"id":495,"depth":768,"text":496},{"id":564,"depth":768,"text":565},{"id":617,"depth":753,"text":407,"children":2218},[2219,2220,2221,2222,2223],{"id":629,"depth":768,"text":630},{"id":692,"depth":768,"text":693},{"id":1439,"depth":768,"text":1440},{"id":2126,"depth":768,"text":2127},{"id":2170,"depth":768,"text":2171},"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.","md",null,{"modifiedAt":2228},"2026-11-08T19:37:45.000Z",{"title":332,"icon":309},{"title":2231,"description":2232},"Analyze Experiments in Mixpanel","Mark ConfigDirector experiment runs on your Mixpanel charts with an integration, and send experiment exposures to Mixpanel as $experiment_started events from the browser, Node.js or an OpenFeature hook to compare the variations in the Experiment report.","twjL36XlaoLxnIyM-o1pMl2F2bfXZ4_Mk2BvMQXIefU",[2235,2237],{"title":328,"path":329,"stem":330,"description":2236,"icon":309,"children":-1},"Mark every experiment run on your Grafana dashboards with a ConfigDirector integration. The settings it needs, how to create it, and where the markers appear.",{"title":336,"path":337,"stem":338,"description":2238,"icon":309,"children":-1},"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.",1796089719805]