[{"data":1,"prerenderedAt":1857},["ShallowReactive",2],{"navigation_docs":3,"-sdks-server-python":128,"-sdks-server-python-surround":1486,"sdks\u002Fpython\u002Finstall":1490,"sdks\u002Fpython\u002Fconfigure":1527,"sdks\u002Fpython\u002Fsimple-usage":1609},[4,30,118],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F1.quickstart","i-lucide-fast-forward",{"title":16,"path":17,"stem":18,"icon":19},"Core Concepts","\u002Fgetting-started\u002Fcore-concepts","1.getting-started\u002F2.core-concepts","i-lucide-workflow",{"title":21,"path":22,"stem":23,"icon":24},"Configs Anatomy","\u002Fgetting-started\u002Fconfigs","1.getting-started\u002F3.configs","i-lucide-file-cog",{"title":26,"path":27,"stem":28,"icon":29},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture","i-lucide-layers",{"title":31,"defaultOpen":32,"path":33,"stem":34,"children":35,"page":6},"SDKs",true,"\u002Fsdks","2.sdks",[36,41,67,82,98],{"title":37,"path":38,"stem":39,"icon":40},"Available SDKs","\u002Fsdks\u002Favailable-sdks","2.sdks\u002F1.available-sdks","i-lucide-list",{"title":42,"icon":43,"defaultOpen":32,"path":44,"stem":45,"children":46,"page":6},"Browser SDKs","i-lucide-monitor","\u002Fsdks\u002Fbrowser","2.sdks\u002F2.browser",[47,52,57,62],{"title":48,"path":49,"stem":50,"icon":51},"Javascript","\u002Fsdks\u002Fbrowser\u002Fjavascript","2.sdks\u002F2.browser\u002F1.javascript","cd-logos-javascript",{"title":53,"path":54,"stem":55,"icon":56},"React","\u002Fsdks\u002Fbrowser\u002Freact","2.sdks\u002F2.browser\u002F2.react","cd-logos-react-light",{"title":58,"path":59,"stem":60,"icon":61},"Vue","\u002Fsdks\u002Fbrowser\u002Fvue","2.sdks\u002F2.browser\u002F3.vue","cd-logos-vue",{"title":63,"path":64,"stem":65,"icon":66},"OpenFeature Web","\u002Fsdks\u002Fbrowser\u002Fopenfeature-web","2.sdks\u002F2.browser\u002F4.openfeature-web","cd-logos-openfeature",{"title":68,"icon":69,"defaultOpen":32,"path":70,"stem":71,"children":72,"page":6},"Mobile SDKs","i-lucide-smartphone","\u002Fsdks\u002Fmobile","2.sdks\u002F3.mobile",[73,77],{"title":74,"path":75,"stem":76,"icon":56},"React Native","\u002Fsdks\u002Fmobile\u002Freact-native","2.sdks\u002F3.mobile\u002F1.react-native",{"title":78,"path":79,"stem":80,"icon":81},"Flutter","\u002Fsdks\u002Fmobile\u002Fflutter","2.sdks\u002F3.mobile\u002F2.flutter","cd-logos-flutter",{"title":83,"icon":84,"defaultOpen":32,"path":85,"stem":86,"children":87,"page":6},"Meta-framework SDKs","i-lucide-monitor-smartphone","\u002Fsdks\u002Fmeta","2.sdks\u002F4.meta",[88,93],{"title":89,"path":90,"stem":91,"icon":92},"Next.js","\u002Fsdks\u002Fmeta\u002Fnextjs","2.sdks\u002F4.meta\u002F1.nextjs","cd-logos-nextjs",{"title":94,"path":95,"stem":96,"icon":97},"Nuxt","\u002Fsdks\u002Fmeta\u002Fnuxt","2.sdks\u002F4.meta\u002F2.nuxt","cd-logos-nuxt",{"title":99,"icon":100,"defaultOpen":32,"path":101,"stem":102,"children":103,"page":6},"Server SDKs","i-lucide-server","\u002Fsdks\u002Fserver","2.sdks\u002F5.server",[104,109,113],{"title":105,"path":106,"stem":107,"icon":108},"Node.js","\u002Fsdks\u002Fserver\u002Fnode-js","2.sdks\u002F5.server\u002F1.node-js","cd-logos-nodejs",{"title":110,"path":111,"stem":112,"icon":66},"OpenFeature Node.js","\u002Fsdks\u002Fserver\u002Fopenfeature-node","2.sdks\u002F5.server\u002F2.openfeature-node",{"title":114,"path":115,"stem":116,"icon":117},"Python","\u002Fsdks\u002Fserver\u002Fpython","2.sdks\u002F5.server\u002F3.python","cd-logos-python",{"title":119,"defaultOpen":32,"path":120,"stem":121,"children":122,"page":6},"Integrations","\u002Fintegrations","3.integrations",[123],{"title":124,"path":125,"stem":126,"icon":127},"Terraform","\u002Fintegrations\u002Fterraform","3.integrations\u002F1.terraform","cd-logos-terraform",{"id":129,"title":130,"body":131,"description":225,"extension":1480,"links":1481,"meta":1482,"navigation":1483,"path":115,"seo":1484,"stem":116,"__hash__":1485},"docs\u002F2.sdks\u002F5.server\u002F3.python.md","Python Server SDK",{"type":132,"value":133,"toc":1469},"minimark",[134,138,144,149,153,161,165,173,177,181,195,198,202,207,213,219,363,373,380,432,448,484,494,540,545,552,637,729,734,737,740,743,777,856,860,871,928,1014,1017,1176,1180,1183,1187,1191,1196,1275,1280,1465],[135,136],"div",{"hidden":32,"dataTitleIcon":137},"python",[139,140],"external-badges",{"package-url":141,"registry":142,"repo":143},"https:\u002F\u002Fpypi.org\u002Fproject\u002Fconfigdirector-server-sdk\u002F","pypi","python-server-sdk",[145,146,148],"h2",{"id":147},"introduction","Introduction",[150,151,152],"p",{},"The Python Server SDK is a server-side SDK that evaluates configs and their targeting rules. Upon initialization, it retrieves configs and targeting rules from ConfigDirector services. From that point on, it evaluates configs locally for any user context, and receives updates via server sent events (SSE) when configs are updated on the dashboard or via the admin API.",[150,154,155,156,160],{},"The minimum Python version supported is ",[157,158,159],"code",{},"3.10",".",[145,162,164],{"id":163},"installation","Installation",[150,166,167,168],{},"The SDK can be installed from PyPI: ",[169,170,141],"a",{"href":141,"rel":171},[172],"nofollow",[174,175],"content-partial",{"name":176},"sdks\u002Fpython\u002Finstall",[145,178,180],{"id":179},"configure-and-initialize-the-client","Configure and initialize the client",[182,183,184,192],"ol",{},[185,186,187,188,191],"li",{},"Create an instance of the client providing your server SDK key. You can retrieve a server SDK key under your project settings in the ",[157,189,190],{},"Environments & SDK Keys"," tab.",[185,193,194],{},"Initialize the client to initiate its connection lifecycle.",[174,196],{"name":197},"sdks\u002Fpython\u002Fconfigure",[199,200,201],"warning",{},"Server SDK keys are secret values. Do not commit them to your source code repository. Provide them at runtime via environment variables instead.",[203,204,206],"h3",{"id":205},"additional-configuration-options","Additional configuration options",[208,209,211],"h4",{"id":210},"metadata",[157,212,210],{},[150,214,215,216,218],{},"The ",[157,217,210],{}," option allows you to provide your application's name and version. These values can be used in targeting rules conditionals. For example, if a certain feature should only be enabled starting with a certain version of your application.",[220,221,226],"pre",{"className":222,"code":223,"filename":224,"language":137,"meta":225,"style":225},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from configdirector import Metadata, create_client\n\nclient = create_client(\n    \"YOUR-SERVER-SDK-KEY\",\n    metadata=Metadata(app_name=\"YOUR-APP-NAME\", app_version=\"1.0.2\"),\n)\n\nclient.initialize()\n","config_director_setup.py","",[157,227,228,254,260,277,294,338,344,349],{"__ignoreMap":225},[229,230,233,237,241,244,247,251],"span",{"class":231,"line":232},"line",1,[229,234,236],{"class":235},"sVHd0","from",[229,238,240],{"class":239},"su5hD"," configdirector ",[229,242,243],{"class":235},"import",[229,245,246],{"class":239}," Metadata",[229,248,250],{"class":249},"sP7_E",",",[229,252,253],{"class":239}," create_client\n",[229,255,257],{"class":231,"line":256},2,[229,258,259],{"emptyLinePlaceholder":32},"\n",[229,261,263,266,270,274],{"class":231,"line":262},3,[229,264,265],{"class":239},"client ",[229,267,269],{"class":268},"smGrS","=",[229,271,273],{"class":272},"slqww"," create_client",[229,275,276],{"class":249},"(\n",[229,278,280,284,288,291],{"class":231,"line":279},4,[229,281,283],{"class":282},"sjJ54","    \"",[229,285,287],{"class":286},"s_sjI","YOUR-SERVER-SDK-KEY",[229,289,290],{"class":282},"\"",[229,292,293],{"class":249},",\n",[229,295,297,301,303,306,309,312,314,316,319,321,323,326,328,330,333,335],{"class":231,"line":296},5,[229,298,300],{"class":299},"s99_P","    metadata",[229,302,269],{"class":268},[229,304,305],{"class":272},"Metadata",[229,307,308],{"class":249},"(",[229,310,311],{"class":299},"app_name",[229,313,269],{"class":268},[229,315,290],{"class":282},[229,317,318],{"class":286},"YOUR-APP-NAME",[229,320,290],{"class":282},[229,322,250],{"class":249},[229,324,325],{"class":299}," app_version",[229,327,269],{"class":268},[229,329,290],{"class":282},[229,331,332],{"class":286},"1.0.2",[229,334,290],{"class":282},[229,336,337],{"class":249},"),\n",[229,339,341],{"class":231,"line":340},6,[229,342,343],{"class":249},")\n",[229,345,347],{"class":231,"line":346},7,[229,348,259],{"emptyLinePlaceholder":32},[229,350,352,355,357,360],{"class":231,"line":351},8,[229,353,354],{"class":239},"client",[229,356,160],{"class":249},[229,358,359],{"class":272},"initialize",[229,361,362],{"class":249},"()\n",[208,364,366,369,370],{"id":365},"log_level-and-logger",[157,367,368],{},"log_level"," and ",[157,371,372],{},"logger",[150,374,375,376,379],{},"The SDK logs through the standard library to a logger named ",[157,377,378],{},"configdirector",". Logging levels, formatting, and destinations can be controlled by accessing the logger:",[220,381,383],{"className":222,"code":382,"language":137,"meta":225,"style":225},"import logging\n\nlogging.getLogger(\"configdirector\").setLevel(logging.DEBUG)\n",[157,384,385,392,396],{"__ignoreMap":225},[229,386,387,389],{"class":231,"line":232},[229,388,243],{"class":235},[229,390,391],{"class":239}," logging\n",[229,393,394],{"class":231,"line":256},[229,395,259],{"emptyLinePlaceholder":32},[229,397,398,401,403,406,408,410,412,414,417,420,422,424,426,430],{"class":231,"line":262},[229,399,400],{"class":239},"logging",[229,402,160],{"class":249},[229,404,405],{"class":272},"getLogger",[229,407,308],{"class":249},[229,409,290],{"class":282},[229,411,378],{"class":286},[229,413,290],{"class":282},[229,415,416],{"class":249},").",[229,418,419],{"class":272},"setLevel",[229,421,308],{"class":249},[229,423,400],{"class":272},[229,425,160],{"class":249},[229,427,429],{"class":428},"swQdS","DEBUG",[229,431,343],{"class":249},[150,433,434,435,437,438,441,442,444,445,447],{},"The SDK sets no level of its own, so this logger follows the usual ",[157,436,400],{}," rules. With nothing\nconfigured at all, Python still surfaces warnings and errors on ",[157,439,440],{},"stderr",". If you would rather not configure ",[157,443,400],{},", the ",[157,446,368],{}," parameter can be used to set a level on the logger:",[220,449,451],{"className":222,"code":450,"language":137,"meta":225,"style":225},"client = create_client(\"YOUR-SERVER-SDK-KEY\", log_level=\"DEBUG\")\n",[157,452,453],{"__ignoreMap":225},[229,454,455,457,459,461,463,465,467,469,471,474,476,478,480,482],{"class":231,"line":232},[229,456,265],{"class":239},[229,458,269],{"class":268},[229,460,273],{"class":272},[229,462,308],{"class":249},[229,464,290],{"class":282},[229,466,287],{"class":286},[229,468,290],{"class":282},[229,470,250],{"class":249},[229,472,473],{"class":299}," log_level",[229,475,269],{"class":268},[229,477,290],{"class":282},[229,479,429],{"class":286},[229,481,290],{"class":282},[229,483,343],{"class":249},[150,485,486,487,490,491,493],{},"The logger can be overridden by passing any object implementing ",[157,488,489],{},"ConfigDirectorLogger"," (a\ndifferent stdlib logger, or your own adapter) in the ",[157,492,372],{}," parameter:",[220,495,497],{"className":222,"code":496,"language":137,"meta":225,"style":225},"client = create_client(\"YOUR-SERVER-SDK-KEY\", logger=logging.getLogger(\"my_app.configdirector\"))\n",[157,498,499],{"__ignoreMap":225},[229,500,501,503,505,507,509,511,513,515,517,520,522,524,526,528,530,532,535,537],{"class":231,"line":232},[229,502,265],{"class":239},[229,504,269],{"class":268},[229,506,273],{"class":272},[229,508,308],{"class":249},[229,510,290],{"class":282},[229,512,287],{"class":286},[229,514,290],{"class":282},[229,516,250],{"class":249},[229,518,519],{"class":299}," logger",[229,521,269],{"class":268},[229,523,400],{"class":272},[229,525,160],{"class":249},[229,527,405],{"class":272},[229,529,308],{"class":249},[229,531,290],{"class":282},[229,533,534],{"class":286},"my_app.configdirector",[229,536,290],{"class":282},[229,538,539],{"class":249},"))\n",[208,541,543],{"id":542},"connection",[157,544,542],{},[150,546,547,548,551],{},"The connection parameter accepts a ",[157,549,550],{},"ConnectionOptions"," object with the following optional values:",[553,554,555,584,603,624],"ul",{},[185,556,557,560],{},[157,558,559],{},"mode",[553,561,562,579],{},[185,563,564,565,568,569,572,573,575,576,578],{},"The connection mode, which can be either ",[157,566,567],{},"streaming"," or ",[157,570,571],{},"polling",". It is recommended to use the default of ",[157,574,567],{}," unless you have a specific need to use ",[157,577,571],{}," instead.",[185,580,581,582],{},"Defaults to ",[157,583,567],{},[185,585,586,589],{},[157,587,588],{},"polling_interval",[553,590,591,597],{},[185,592,593,594,596],{},"Only used in ",[157,595,571],{}," mode. The interval, in seconds, to poll ConfigDirector services for updates.",[185,598,581,599,602],{},[157,600,601],{},"60"," seconds",[185,604,605,608],{},[157,606,607],{},"timeout",[553,609,610,619],{},[185,611,612,613,615,616,618],{},"The timeout, in seconds, to be used in initialization. This is how long the ",[157,614,359],{}," method will wait for data from ConfigDirector services. If the timeout is reached, ",[157,617,359],{}," will return but the client will still be in an unready status and returning default values. The client will continue to attempt to connect and retrieve config values in the background.",[185,620,581,621,602],{},[157,622,623],{},"3",[185,625,626,629],{},[157,627,628],{},"url",[553,630,631,634],{},[185,632,633],{},"The base URL used to connect to ConfigDirector services",[185,635,636],{},"This should only be provided if your environment requires you to configure a proxy server in order to connect to ConfigDirector services",[220,638,640],{"className":222,"code":639,"language":137,"meta":225,"style":225},"from configdirector import ConnectionOptions, create_client\n\nclient = create_client(\n    \"YOUR-SERVER-SDK-KEY\",\n    connection=ConnectionOptions(mode=\"polling\", polling_interval=30, timeout=5),\n)\n",[157,641,642,657,661,671,681,725],{"__ignoreMap":225},[229,643,644,646,648,650,653,655],{"class":231,"line":232},[229,645,236],{"class":235},[229,647,240],{"class":239},[229,649,243],{"class":235},[229,651,652],{"class":239}," ConnectionOptions",[229,654,250],{"class":249},[229,656,253],{"class":239},[229,658,659],{"class":231,"line":256},[229,660,259],{"emptyLinePlaceholder":32},[229,662,663,665,667,669],{"class":231,"line":262},[229,664,265],{"class":239},[229,666,269],{"class":268},[229,668,273],{"class":272},[229,670,276],{"class":249},[229,672,673,675,677,679],{"class":231,"line":279},[229,674,283],{"class":282},[229,676,287],{"class":286},[229,678,290],{"class":282},[229,680,293],{"class":249},[229,682,683,686,688,690,692,694,696,698,700,702,704,707,709,713,715,718,720,723],{"class":231,"line":296},[229,684,685],{"class":299},"    connection",[229,687,269],{"class":268},[229,689,550],{"class":272},[229,691,308],{"class":249},[229,693,559],{"class":299},[229,695,269],{"class":268},[229,697,290],{"class":282},[229,699,571],{"class":286},[229,701,290],{"class":282},[229,703,250],{"class":249},[229,705,706],{"class":299}," polling_interval",[229,708,269],{"class":268},[229,710,712],{"class":711},"srdBf","30",[229,714,250],{"class":249},[229,716,717],{"class":299}," timeout",[229,719,269],{"class":268},[229,721,722],{"class":711},"5",[229,724,337],{"class":249},[229,726,727],{"class":231,"line":340},[229,728,343],{"class":249},[208,730,732],{"id":731},"telemetry",[157,733,731],{},[150,735,736],{},"Telemetry tuning. It is unlikely these settings need to be adjusted. However, in cases where your application has a large number of evaluations per second, you can adjust these settings to tune the memory footprint and frequency of telemetry requests.",[150,738,739],{},"Keep in mind that ConfigDirector relies on these telemetry events to provide insights and features related to the configs being used.",[150,741,742],{},"The telemetry object accepts the following optional values:",[553,744,745,761],{},[185,746,747,750],{},[157,748,749],{},"event_queue_limit",[553,751,752,755,758],{},[185,753,754],{},"The size limit of telemetry event queues. If the size limit is reached before the events are flushed to the network, older events will be dropped.",[185,756,757],{},"ConfigDirector keeps a count of dropped events. If the number of dropped events is higher than 50% of the total events, ConfigDirector will issue a notification alert in the dashboard.",[185,759,760],{},"A number between 100 and 100,000. Defaults to 5,000.",[185,762,763,766],{},[157,764,765],{},"flush_interval",[553,767,768,771,774],{},[185,769,770],{},"How often events are flushed and sent over the network in seconds.",[185,772,773],{},"Decrease this number if your application consistently captures a large number of events in short periods of time in order to reduce memory footprint from a large event queue.",[185,775,776],{},"Defaults to 30 seconds.",[220,778,780],{"className":222,"code":779,"language":137,"meta":225,"style":225},"from configdirector import TelemetryOptions, create_client\n\nclient = create_client(\n    \"YOUR-SERVER-SDK-KEY\",\n    telemetry=TelemetryOptions(event_queue_limit=10_000, flush_interval=15),\n)\n",[157,781,782,797,801,811,821,852],{"__ignoreMap":225},[229,783,784,786,788,790,793,795],{"class":231,"line":232},[229,785,236],{"class":235},[229,787,240],{"class":239},[229,789,243],{"class":235},[229,791,792],{"class":239}," TelemetryOptions",[229,794,250],{"class":249},[229,796,253],{"class":239},[229,798,799],{"class":231,"line":256},[229,800,259],{"emptyLinePlaceholder":32},[229,802,803,805,807,809],{"class":231,"line":262},[229,804,265],{"class":239},[229,806,269],{"class":268},[229,808,273],{"class":272},[229,810,276],{"class":249},[229,812,813,815,817,819],{"class":231,"line":279},[229,814,283],{"class":282},[229,816,287],{"class":286},[229,818,290],{"class":282},[229,820,293],{"class":249},[229,822,823,826,828,831,833,835,837,840,842,845,847,850],{"class":231,"line":296},[229,824,825],{"class":299},"    telemetry",[229,827,269],{"class":268},[229,829,830],{"class":272},"TelemetryOptions",[229,832,308],{"class":249},[229,834,749],{"class":299},[229,836,269],{"class":268},[229,838,839],{"class":711},"10_000",[229,841,250],{"class":249},[229,843,844],{"class":299}," flush_interval",[229,846,269],{"class":268},[229,848,849],{"class":711},"15",[229,851,337],{"class":249},[229,853,854],{"class":231,"line":340},[229,855,343],{"class":249},[203,857,859],{"id":858},"hooks","Hooks",[150,861,862,863,866,867,870],{},"Hooks are events you can subscribe to in order to be notified of some key actions from the client. In order to subscribe to hooks you can provide a handler in the options, or use the ",[157,864,865],{},"on"," method which returns a ",[157,868,869],{},"Subscription",":",[220,872,874],{"className":222,"code":873,"language":137,"meta":225,"style":225},"subscription = client.on(\"configs_updated\", lambda event: print(event.keys))\n",[157,875,876],{"__ignoreMap":225},[229,877,878,881,883,886,888,890,892,894,897,899,901,905,909,911,915,917,920,922,926],{"class":231,"line":232},[229,879,880],{"class":239},"subscription ",[229,882,269],{"class":268},[229,884,885],{"class":239}," client",[229,887,160],{"class":249},[229,889,865],{"class":272},[229,891,308],{"class":249},[229,893,290],{"class":282},[229,895,896],{"class":286},"configs_updated",[229,898,290],{"class":282},[229,900,250],{"class":249},[229,902,904],{"class":903},"sbsja"," lambda",[229,906,908],{"class":907},"sFwrP"," event",[229,910,870],{"class":249},[229,912,914],{"class":913},"sptTA"," print",[229,916,308],{"class":249},[229,918,919],{"class":272},"event",[229,921,160],{"class":249},[229,923,925],{"class":924},"skxfh","keys",[229,927,539],{"class":249},[220,929,931],{"className":222,"code":930,"language":137,"meta":225,"style":225},"from configdirector import ClientHooks, create_client\n\nclient = create_client(\n    \"YOUR-SERVER-SDK-KEY\",\n    hooks=ClientHooks(config_evaluated=lambda event: print(event.evaluation)),\n)\n",[157,932,933,948,952,962,972,1010],{"__ignoreMap":225},[229,934,935,937,939,941,944,946],{"class":231,"line":232},[229,936,236],{"class":235},[229,938,240],{"class":239},[229,940,243],{"class":235},[229,942,943],{"class":239}," ClientHooks",[229,945,250],{"class":249},[229,947,253],{"class":239},[229,949,950],{"class":231,"line":256},[229,951,259],{"emptyLinePlaceholder":32},[229,953,954,956,958,960],{"class":231,"line":262},[229,955,265],{"class":239},[229,957,269],{"class":268},[229,959,273],{"class":272},[229,961,276],{"class":249},[229,963,964,966,968,970],{"class":231,"line":279},[229,965,283],{"class":282},[229,967,287],{"class":286},[229,969,290],{"class":282},[229,971,293],{"class":249},[229,973,974,977,979,982,984,987,989,992,994,996,998,1000,1002,1004,1007],{"class":231,"line":296},[229,975,976],{"class":299},"    hooks",[229,978,269],{"class":268},[229,980,981],{"class":272},"ClientHooks",[229,983,308],{"class":249},[229,985,986],{"class":299},"config_evaluated",[229,988,269],{"class":268},[229,990,991],{"class":903},"lambda",[229,993,908],{"class":907},[229,995,870],{"class":249},[229,997,914],{"class":913},[229,999,308],{"class":249},[229,1001,919],{"class":272},[229,1003,160],{"class":249},[229,1005,1006],{"class":924},"evaluation",[229,1008,1009],{"class":249},")),\n",[229,1011,1012],{"class":231,"line":340},[229,1013,343],{"class":249},[150,1015,1016],{},"The following hooks are available:",[553,1018,1019,1031,1048],{},[185,1020,1021,1026],{},[157,1022,1025],{"className":1023},[1024],"font-semibold","client_ready: ClientReadyEvent",[553,1027,1028],{},[185,1029,1030],{},"Emitted when the client is initialized. When this event is emitted it means the client has received a payload from the ConfigDirector servers and is ready to evaluate configs.",[185,1032,1033,1037],{},[157,1034,1036],{"className":1035},[1024],"configs_updated: ConfigsUpdatedEvent",[553,1038,1039,1042],{},[185,1040,1041],{},"Emitted when a payload is received from the ConfigDirector servers with config data. It is emitted during initialization when an entire config payload is received. After initialization, it is emitted when updates are pushed from the server (or discovered via polling if that connection mode is used).",[185,1043,1044,1047],{},[157,1045,1046],{},"keys: list[str]"," - The config keys that were included in the payload from the server.",[185,1049,1050,1054],{},[157,1051,1053],{"className":1052},[1024],"config_evaluated: ConfigEvaluatedEvent",[553,1055,1056,1066],{},[185,1057,1058,1059,1062,1063,160],{},"Emitted whenever a config is evaluated. This includes calls to ",[157,1060,1061],{},"get_value"," and evaluations delivered to watchers via ",[157,1064,1065],{},"watch",[185,1067,1068,1071,1072,1075,1076],{},[157,1069,1070],{},"evaluation: ConfigEvaluation"," - A ",[157,1073,1074],{},"ConfigEvaluation"," object containing the details of the evaluation:\n",[553,1077,1078,1084,1095,1109,1115,1167],{},[185,1079,1080,1083],{},[157,1081,1082],{},"key: str"," - The config key that was evaluated",[185,1085,1086,1089,1090,568,1092,1094],{},[157,1087,1088],{},"value: str | int | float | bool | dict | list"," - The value the config evaluated to. It can be the default value provided to ",[157,1091,1061],{},[157,1093,1065],{},". For example, if the config was evaluated before the client was initialized.",[185,1096,1097,1100,1101,1104,1105,1108],{},[157,1098,1099],{},"value_id: str | None"," - The value ID, which is a stable hash of the value that can be used for analytics or other third parties rather than sending the ",[157,1102,1103],{},"value",". This can be useful for large values, like a JSON config, or to avoid disclosing the values themselves to third parties. It may be ",[157,1106,1107],{},"None"," if the evaluation had to fall back to the default value.",[185,1110,1111,1114],{},[157,1112,1113],{},"is_default: bool"," - Whether or not the evaluation fell back to the default value provided in code.",[185,1116,1117,1120,1121,1124,1125,1128,1129],{},[157,1118,1119],{},"reason: EvaluationReason"," - The reason for the evaluation resolution. In the case the config successfully evaluated based on server-provided targeting rules, it will be ",[157,1122,1123],{},"found-match",". If the evaluation had to fall back to the default value, the ",[157,1126,1127],{},"reason"," will encode why the fallback was required:\n",[553,1130,1131,1137,1143,1149,1155,1161],{},[185,1132,1133,1136],{},[157,1134,1135],{},"client-not-ready"," - The evaluation happened before the client finished initialization",[185,1138,1139,1142],{},[157,1140,1141],{},"config-state-missing"," - The requested config key was not present in the payload received from the server. This could be due to an incorrect config key, or a config that was not enabled to be available to client SDKs.",[185,1144,1145,1148],{},[157,1146,1147],{},"invalid-number"," - The config was requested as a number but the value received from the server could not be converted to a number.",[185,1150,1151,1154],{},[157,1152,1153],{},"invalid-boolean"," - The config was requested as a boolean but the value received from the server could not be converted to a boolean.",[185,1156,1157,1160],{},[157,1158,1159],{},"invalid-json"," - The config was requested as a JSON object but the value received from the server could not be converted to a JSON object.",[185,1162,1163,1166],{},[157,1164,1165],{},"value-missing"," - The config key was present in the payload received from the server, but it carried no value.",[185,1168,1169,1172,1173,1175],{},[157,1170,1171],{},"context: Context | None"," - The user context that was provided to the evaluation function, or ",[157,1174,1107],{}," if no context was provided.",[145,1177,1179],{"id":1178},"retrieve-config-values","Retrieve config values",[174,1181],{"name":1182},"sdks\u002Fpython\u002Fsimple-usage",[203,1184,1186],{"id":1185},"evaluate-config-values-with-a-user-context","Evaluate config values with a user context",[1188,1189,1190],"note",{},"Unlike client SDKs, the server SDKs are able to evaluate targeting rules for the given user context locally without additional network calls.",[150,1192,1193,1195],{},[157,1194,1061],{}," accepts three arguments, the first argument is the config key, the second one is the default value to be returned if the client is not yet initialized, and the third and optional argument is a user context to be used for targeting rules evaluation:",[220,1197,1200],{"className":222,"code":1198,"filename":1199,"language":137,"meta":225,"style":225},"from configdirector import Context\n\nclient.get_value(\"my-boolean-config-key\", False, Context(id=\"user-id\", name=\"Example User\"))\n","main.py",[157,1201,1202,1213,1217],{"__ignoreMap":225},[229,1203,1204,1206,1208,1210],{"class":231,"line":232},[229,1205,236],{"class":235},[229,1207,240],{"class":239},[229,1209,243],{"class":235},[229,1211,1212],{"class":239}," Context\n",[229,1214,1215],{"class":231,"line":256},[229,1216,259],{"emptyLinePlaceholder":32},[229,1218,1219,1221,1223,1225,1227,1229,1232,1234,1236,1240,1242,1245,1247,1250,1252,1254,1257,1259,1261,1264,1266,1268,1271,1273],{"class":231,"line":262},[229,1220,354],{"class":239},[229,1222,160],{"class":249},[229,1224,1061],{"class":272},[229,1226,308],{"class":249},[229,1228,290],{"class":282},[229,1230,1231],{"class":286},"my-boolean-config-key",[229,1233,290],{"class":282},[229,1235,250],{"class":249},[229,1237,1239],{"class":1238},"s39Yj"," False",[229,1241,250],{"class":249},[229,1243,1244],{"class":272}," Context",[229,1246,308],{"class":249},[229,1248,1249],{"class":299},"id",[229,1251,269],{"class":268},[229,1253,290],{"class":282},[229,1255,1256],{"class":286},"user-id",[229,1258,290],{"class":282},[229,1260,250],{"class":249},[229,1262,1263],{"class":299}," name",[229,1265,269],{"class":268},[229,1267,290],{"class":282},[229,1269,1270],{"class":286},"Example User",[229,1272,290],{"class":282},[229,1274,539],{"class":249},[150,1276,1277,1279],{},[157,1278,1065],{}," accepts four arguments, the first is the config key, the second argument is the default value, the third argument is a function that will be executed when the config value is updated, and the fourth and optional argument is a user context:",[220,1281,1283],{"className":222,"code":1282,"filename":1199,"language":137,"meta":225,"style":225},"def on_change(value: bool) -> None:\n    print(f\"new-checkout is now {value}\")\n\nsubscription = client.watch(\n  \"new-checkout\",\n  False,\n  on_change,\n  Context(\n    id=\"user-id\",\n    name=\"Example User\",\n    traits={\"region\": \"North America\"}\n  )\n)\n",[157,1284,1285,1316,1341,1345,1359,1371,1378,1385,1392,1408,1424,1454,1460],{"__ignoreMap":225},[229,1286,1287,1290,1294,1296,1298,1300,1304,1307,1310,1313],{"class":231,"line":232},[229,1288,1289],{"class":903},"def",[229,1291,1293],{"class":1292},"sGLFI"," on_change",[229,1295,308],{"class":249},[229,1297,1103],{"class":907},[229,1299,870],{"class":249},[229,1301,1303],{"class":1302},"sZMiF"," bool",[229,1305,1306],{"class":249},")",[229,1308,1309],{"class":249}," ->",[229,1311,1312],{"class":1238}," None",[229,1314,1315],{"class":249},":\n",[229,1317,1318,1321,1323,1326,1329,1332,1334,1337,1339],{"class":231,"line":256},[229,1319,1320],{"class":913},"    print",[229,1322,308],{"class":249},[229,1324,1325],{"class":903},"f",[229,1327,1328],{"class":286},"\"new-checkout is now ",[229,1330,1331],{"class":711},"{",[229,1333,1103],{"class":272},[229,1335,1336],{"class":711},"}",[229,1338,290],{"class":286},[229,1340,343],{"class":249},[229,1342,1343],{"class":231,"line":262},[229,1344,259],{"emptyLinePlaceholder":32},[229,1346,1347,1349,1351,1353,1355,1357],{"class":231,"line":279},[229,1348,880],{"class":239},[229,1350,269],{"class":268},[229,1352,885],{"class":239},[229,1354,160],{"class":249},[229,1356,1065],{"class":272},[229,1358,276],{"class":249},[229,1360,1361,1364,1367,1369],{"class":231,"line":296},[229,1362,1363],{"class":282},"  \"",[229,1365,1366],{"class":286},"new-checkout",[229,1368,290],{"class":282},[229,1370,293],{"class":249},[229,1372,1373,1376],{"class":231,"line":340},[229,1374,1375],{"class":1238},"  False",[229,1377,293],{"class":249},[229,1379,1380,1383],{"class":231,"line":346},[229,1381,1382],{"class":272},"  on_change",[229,1384,293],{"class":249},[229,1386,1387,1390],{"class":231,"line":351},[229,1388,1389],{"class":272},"  Context",[229,1391,276],{"class":249},[229,1393,1395,1398,1400,1402,1404,1406],{"class":231,"line":1394},9,[229,1396,1397],{"class":299},"    id",[229,1399,269],{"class":268},[229,1401,290],{"class":282},[229,1403,1256],{"class":286},[229,1405,290],{"class":282},[229,1407,293],{"class":249},[229,1409,1411,1414,1416,1418,1420,1422],{"class":231,"line":1410},10,[229,1412,1413],{"class":299},"    name",[229,1415,269],{"class":268},[229,1417,290],{"class":282},[229,1419,1270],{"class":286},[229,1421,290],{"class":282},[229,1423,293],{"class":249},[229,1425,1427,1430,1432,1434,1436,1439,1441,1443,1446,1449,1451],{"class":231,"line":1426},11,[229,1428,1429],{"class":299},"    traits",[229,1431,269],{"class":268},[229,1433,1331],{"class":249},[229,1435,290],{"class":282},[229,1437,1438],{"class":286},"region",[229,1440,290],{"class":282},[229,1442,870],{"class":249},[229,1444,1445],{"class":282}," \"",[229,1447,1448],{"class":286},"North America",[229,1450,290],{"class":282},[229,1452,1453],{"class":249},"}\n",[229,1455,1457],{"class":231,"line":1456},12,[229,1458,1459],{"class":249},"  )\n",[229,1461,1463],{"class":231,"line":1462},13,[229,1464,343],{"class":249},[1466,1467,1468],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}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 .swQdS, html code.shiki .swQdS{--shiki-light:#E53935;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sFwrP, html code.shiki .sFwrP{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#24292E;--shiki-default-font-style:inherit;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":225,"searchDepth":256,"depth":256,"links":1470},[1471,1472,1473,1477],{"id":147,"depth":256,"text":148},{"id":163,"depth":256,"text":164},{"id":179,"depth":256,"text":180,"children":1474},[1475,1476],{"id":205,"depth":262,"text":206},{"id":858,"depth":262,"text":859},{"id":1178,"depth":256,"text":1179,"children":1478},[1479],{"id":1185,"depth":262,"text":1186},"md",null,{},{"title":114,"icon":117},{"title":130,"description":225},"daHlHY2Sd8Q27ZYDAqV_2t8R70AgSU7UOAyBE1PDApA",[1487,1489],{"title":110,"path":111,"stem":112,"description":1488,"icon":66,"children":-1},"ConfigDirector Provider for the OpenFeature Node.js SDK",{"title":124,"path":125,"stem":126,"description":225,"icon":127,"children":-1},{"id":1491,"title":1492,"body":1493,"description":225,"extension":1480,"links":1481,"meta":1522,"navigation":6,"path":1523,"seo":1524,"stem":1525,"__hash__":1526},"docs\u002F_partials\u002Fsdks\u002Fpython\u002Finstall.md","Install",{"type":132,"value":1494,"toc":1520},[1495,1517],[1496,1497,1498],"code-group",{},[220,1499,1504],{"className":1500,"code":1501,"filename":1502,"language":1503,"meta":225,"style":225},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","pip install configdirector-server-sdk\n","pip","bash",[157,1505,1506],{"__ignoreMap":225},[229,1507,1508,1511,1514],{"class":231,"line":232},[229,1509,1502],{"class":1510},"sbgvK",[229,1512,1513],{"class":286}," install",[229,1515,1516],{"class":286}," configdirector-server-sdk\n",[1466,1518,1519],{},"html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}",{"title":225,"searchDepth":256,"depth":256,"links":1521},[],{},"\u002F_partials\u002Fsdks\u002Fpython\u002Finstall",{"description":225},"_partials\u002Fsdks\u002Fpython\u002Finstall","S6ZzKl3WylW2rCzs2HvAEnH3dZqbBV3XxEMKumMS8pI",{"id":1528,"title":1529,"body":1530,"description":225,"extension":1480,"links":1481,"meta":1604,"navigation":6,"path":1605,"seo":1606,"stem":1607,"__hash__":1608},"docs\u002F_partials\u002Fsdks\u002Fpython\u002Fconfigure.md","Configure",{"type":132,"value":1531,"toc":1602},[1532,1599],[220,1533,1535],{"className":222,"code":1534,"filename":224,"language":137,"meta":225,"style":225},"from configdirector import create_client\n\nclient = create_client(\"YOUR-SERVER-SDK-KEY\")\n\n# Blocks until the client is initialized or it times out.\n# If initialization times out, the client will continue attempting to\n# initialize in the background.\nclient.initialize()\n",[157,1536,1537,1547,1551,1569,1573,1579,1584,1589],{"__ignoreMap":225},[229,1538,1539,1541,1543,1545],{"class":231,"line":232},[229,1540,236],{"class":235},[229,1542,240],{"class":239},[229,1544,243],{"class":235},[229,1546,253],{"class":239},[229,1548,1549],{"class":231,"line":256},[229,1550,259],{"emptyLinePlaceholder":32},[229,1552,1553,1555,1557,1559,1561,1563,1565,1567],{"class":231,"line":262},[229,1554,265],{"class":239},[229,1556,269],{"class":268},[229,1558,273],{"class":272},[229,1560,308],{"class":249},[229,1562,290],{"class":282},[229,1564,287],{"class":286},[229,1566,290],{"class":282},[229,1568,343],{"class":249},[229,1570,1571],{"class":231,"line":279},[229,1572,259],{"emptyLinePlaceholder":32},[229,1574,1575],{"class":231,"line":296},[229,1576,1578],{"class":1577},"sutJx","# Blocks until the client is initialized or it times out.\n",[229,1580,1581],{"class":231,"line":340},[229,1582,1583],{"class":1577},"# If initialization times out, the client will continue attempting to\n",[229,1585,1586],{"class":231,"line":346},[229,1587,1588],{"class":1577},"# initialize in the background.\n",[229,1590,1591,1593,1595,1597],{"class":231,"line":351},[229,1592,354],{"class":239},[229,1594,160],{"class":249},[229,1596,359],{"class":272},[229,1598,362],{"class":249},[1466,1600,1601],{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}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);}",{"title":225,"searchDepth":256,"depth":256,"links":1603},[],{},"\u002F_partials\u002Fsdks\u002Fpython\u002Fconfigure",{"description":225},"_partials\u002Fsdks\u002Fpython\u002Fconfigure","kJMTm0NDSV9PsPQXI0YRh5t1Vpg2sHWUbdUt2rAl5Rg",{"id":1610,"title":1611,"body":1612,"description":1851,"extension":1480,"links":1481,"meta":1852,"navigation":6,"path":1853,"seo":1854,"stem":1855,"__hash__":1856},"docs\u002F_partials\u002Fsdks\u002Fpython\u002Fsimple-usage.md","Simple Usage",{"type":132,"value":1613,"toc":1849},[1614,1623,1846],[150,1615,1616,1617,1619,1620,1622],{},"Retrieving config values via ",[157,1618,1061],{},", and subscribe to updates via ",[157,1621,1065],{},". The first argument is the config key, the second is the default value. The type of the default value provided determines the type the config is parsed as. The default value is returned if the config is not available or cannot be parsed as the given type:",[220,1624,1626],{"className":222,"code":1625,"filename":1199,"language":137,"meta":225,"style":225},"# Retrieve config values\nretries = client.get_value(\"max-retries\", 3)\ntheme = client.get_value(\"theme\", \"light\")\nlimits = client.get_value(\"rate-limits\", {\"per_minute\": 60}) # JSON config\n\n# Watch for config updates\ndef on_change(value: bool) -> None:\n    print(f\"new-checkout is now {value}\")\n\nsubscription = client.watch(\"new-checkout\", False, on_change)\n\n# Call close when the subscription is not longer needed\nsubscription.close()\n",[157,1627,1628,1633,1662,1695,1740,1744,1749,1771,1791,1795,1825,1829,1834],{"__ignoreMap":225},[229,1629,1630],{"class":231,"line":232},[229,1631,1632],{"class":1577},"# Retrieve config values\n",[229,1634,1635,1638,1640,1642,1644,1646,1648,1650,1653,1655,1657,1660],{"class":231,"line":256},[229,1636,1637],{"class":239},"retries ",[229,1639,269],{"class":268},[229,1641,885],{"class":239},[229,1643,160],{"class":249},[229,1645,1061],{"class":272},[229,1647,308],{"class":249},[229,1649,290],{"class":282},[229,1651,1652],{"class":286},"max-retries",[229,1654,290],{"class":282},[229,1656,250],{"class":249},[229,1658,1659],{"class":711}," 3",[229,1661,343],{"class":249},[229,1663,1664,1667,1669,1671,1673,1675,1677,1679,1682,1684,1686,1688,1691,1693],{"class":231,"line":262},[229,1665,1666],{"class":239},"theme ",[229,1668,269],{"class":268},[229,1670,885],{"class":239},[229,1672,160],{"class":249},[229,1674,1061],{"class":272},[229,1676,308],{"class":249},[229,1678,290],{"class":282},[229,1680,1681],{"class":286},"theme",[229,1683,290],{"class":282},[229,1685,250],{"class":249},[229,1687,1445],{"class":282},[229,1689,1690],{"class":286},"light",[229,1692,290],{"class":282},[229,1694,343],{"class":249},[229,1696,1697,1700,1702,1704,1706,1708,1710,1712,1715,1717,1719,1722,1724,1727,1729,1731,1734,1737],{"class":231,"line":279},[229,1698,1699],{"class":239},"limits ",[229,1701,269],{"class":268},[229,1703,885],{"class":239},[229,1705,160],{"class":249},[229,1707,1061],{"class":272},[229,1709,308],{"class":249},[229,1711,290],{"class":282},[229,1713,1714],{"class":286},"rate-limits",[229,1716,290],{"class":282},[229,1718,250],{"class":249},[229,1720,1721],{"class":249}," {",[229,1723,290],{"class":282},[229,1725,1726],{"class":286},"per_minute",[229,1728,290],{"class":282},[229,1730,870],{"class":249},[229,1732,1733],{"class":711}," 60",[229,1735,1736],{"class":249},"})",[229,1738,1739],{"class":1577}," # JSON config\n",[229,1741,1742],{"class":231,"line":296},[229,1743,259],{"emptyLinePlaceholder":32},[229,1745,1746],{"class":231,"line":340},[229,1747,1748],{"class":1577},"# Watch for config updates\n",[229,1750,1751,1753,1755,1757,1759,1761,1763,1765,1767,1769],{"class":231,"line":346},[229,1752,1289],{"class":903},[229,1754,1293],{"class":1292},[229,1756,308],{"class":249},[229,1758,1103],{"class":907},[229,1760,870],{"class":249},[229,1762,1303],{"class":1302},[229,1764,1306],{"class":249},[229,1766,1309],{"class":249},[229,1768,1312],{"class":1238},[229,1770,1315],{"class":249},[229,1772,1773,1775,1777,1779,1781,1783,1785,1787,1789],{"class":231,"line":351},[229,1774,1320],{"class":913},[229,1776,308],{"class":249},[229,1778,1325],{"class":903},[229,1780,1328],{"class":286},[229,1782,1331],{"class":711},[229,1784,1103],{"class":272},[229,1786,1336],{"class":711},[229,1788,290],{"class":286},[229,1790,343],{"class":249},[229,1792,1793],{"class":231,"line":1394},[229,1794,259],{"emptyLinePlaceholder":32},[229,1796,1797,1799,1801,1803,1805,1807,1809,1811,1813,1815,1817,1819,1821,1823],{"class":231,"line":1410},[229,1798,880],{"class":239},[229,1800,269],{"class":268},[229,1802,885],{"class":239},[229,1804,160],{"class":249},[229,1806,1065],{"class":272},[229,1808,308],{"class":249},[229,1810,290],{"class":282},[229,1812,1366],{"class":286},[229,1814,290],{"class":282},[229,1816,250],{"class":249},[229,1818,1239],{"class":1238},[229,1820,250],{"class":249},[229,1822,1293],{"class":272},[229,1824,343],{"class":249},[229,1826,1827],{"class":231,"line":1426},[229,1828,259],{"emptyLinePlaceholder":32},[229,1830,1831],{"class":231,"line":1456},[229,1832,1833],{"class":1577},"# Call close when the subscription is not longer needed\n",[229,1835,1836,1839,1841,1844],{"class":231,"line":1462},[229,1837,1838],{"class":239},"subscription",[229,1840,160],{"class":249},[229,1842,1843],{"class":272},"close",[229,1845,362],{"class":249},[1466,1847,1848],{},"html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sFwrP, html code.shiki .sFwrP{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#24292E;--shiki-default-font-style:inherit;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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);}",{"title":225,"searchDepth":256,"depth":256,"links":1850},[],"Retrieving config values via get_value, and subscribe to updates via watch. The first argument is the config key, the second is the default value. The type of the default value provided determines the type the config is parsed as. The default value is returned if the config is not available or cannot be parsed as the given type:",{},"\u002F_partials\u002Fsdks\u002Fpython\u002Fsimple-usage",{"description":1851},"_partials\u002Fsdks\u002Fpython\u002Fsimple-usage","pkyob5PYaDSH72Nl0EbFN70IJr3KfJaBfCWCoBgphmM",1786383379907]