[{"data":1,"prerenderedAt":3740},["ShallowReactive",2],{"navigation_docs":3,"-sdks-mobile-swift":148,"-sdks-mobile-swift-surround":3029,"sdks\u002Fswift\u002Finstall":3032,"sdks\u002Fswift\u002Fconfigure":3218,"sdks\u002Fswift\u002Fsimple-usage":3311,"sdks\u002Fswift\u002Fuser-context":3455},[4,30,138],{"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,92,108],{"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,82,87],{"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,"path":84,"stem":85,"icon":86},"Swift","\u002Fsdks\u002Fmobile\u002Fswift","2.sdks\u002F3.mobile\u002F3.swift","cd-logos-swift",{"title":88,"path":89,"stem":90,"icon":91},"Android","\u002Fsdks\u002Fmobile\u002Fandroid","2.sdks\u002F3.mobile\u002F4.android","cd-logos-android",{"title":93,"icon":94,"defaultOpen":32,"path":95,"stem":96,"children":97,"page":6},"Meta-framework SDKs","i-lucide-monitor-smartphone","\u002Fsdks\u002Fmeta","2.sdks\u002F4.meta",[98,103],{"title":99,"path":100,"stem":101,"icon":102},"Next.js","\u002Fsdks\u002Fmeta\u002Fnextjs","2.sdks\u002F4.meta\u002F1.nextjs","cd-logos-nextjs",{"title":104,"path":105,"stem":106,"icon":107},"Nuxt","\u002Fsdks\u002Fmeta\u002Fnuxt","2.sdks\u002F4.meta\u002F2.nuxt","cd-logos-nuxt",{"title":109,"icon":110,"defaultOpen":32,"path":111,"stem":112,"children":113,"page":6},"Server SDKs","i-lucide-server","\u002Fsdks\u002Fserver","2.sdks\u002F5.server",[114,119,123,128,133],{"title":115,"path":116,"stem":117,"icon":118},"Node.js","\u002Fsdks\u002Fserver\u002Fnode-js","2.sdks\u002F5.server\u002F1.node-js","cd-logos-nodejs",{"title":120,"path":121,"stem":122,"icon":66},"OpenFeature Node.js","\u002Fsdks\u002Fserver\u002Fopenfeature-node","2.sdks\u002F5.server\u002F2.openfeature-node",{"title":124,"path":125,"stem":126,"icon":127},"Python","\u002Fsdks\u002Fserver\u002Fpython","2.sdks\u002F5.server\u002F3.python","cd-logos-python",{"title":129,"path":130,"stem":131,"icon":132},"Java","\u002Fsdks\u002Fserver\u002Fjava","2.sdks\u002F5.server\u002F4.java","cd-logos-java",{"title":134,"path":135,"stem":136,"icon":137},".NET","\u002Fsdks\u002Fserver\u002Fdotnet","2.sdks\u002F5.server\u002F5.dotnet","cd-logos-dotnet",{"title":139,"defaultOpen":32,"path":140,"stem":141,"children":142,"page":6},"Integrations","\u002Fintegrations","3.integrations",[143],{"title":144,"path":145,"stem":146,"icon":147},"Terraform","\u002Fintegrations\u002Fterraform","3.integrations\u002F1.terraform","cd-logos-terraform",{"id":149,"title":150,"body":151,"description":315,"extension":3023,"links":3024,"meta":3025,"navigation":3026,"path":84,"seo":3027,"stem":85,"__hash__":3028},"docs\u002F2.sdks\u002F3.mobile\u002F3.swift.md","Swift SDK",{"type":152,"value":153,"toc":3001},"minimark",[154,158,162,167,171,222,230,237,241,250,254,258,272,275,279,302,309,599,609,614,620,626,632,647,754,759,773,776,842,863,866,1043,1047,1053,1180,1269,1273,1291,1477,1483,1550,1571,1683,1691,1765,1890,1897,1901,1907,1916,1919,1933,2044,2048,2059,2191,2200,2272,2276,2300,2458,2462,2470,2484,2666,2675,2679,2682,2693,2699,2862,2875,2879,2882,2886,2901,2906,2933,2939,2955,2962,2974,2982,2988,2991,2997],[155,156],"div",{"hidden":32,"dataTitleIcon":157},"swift",[159,160],"external-badges",{"repo":161},"swift-sdk",[163,164,166],"h2",{"id":165},"introduction","Introduction",[168,169,170],"p",{},"The Swift SDK is intended to be used by Apple platform applications. It evaluates your configs against a user context, keeps them current as they change in the dashboard, and hands SwiftUI values it can re-render from.",[172,173,174,187],"table",{},[175,176,177],"thead",{},[178,179,180,184],"tr",{},[181,182,183],"th",{},"Platform",[181,185,186],{},"Minimum",[188,189,190,199,207,214],"tbody",{},[178,191,192,196],{},[193,194,195],"td",{},"iOS \u002F iPadOS",[193,197,198],{},"15.0",[178,200,201,204],{},[193,202,203],{},"macOS",[193,205,206],{},"12.0",[178,208,209,212],{},[193,210,211],{},"tvOS",[193,213,198],{},[178,215,216,219],{},[193,217,218],{},"watchOS",[193,220,221],{},"8.0",[168,223,224,225,229],{},"Building it requires Swift 6.0 or newer. The package is built in Swift 6 language mode under strict concurrency and every public type is ",[226,227,228],"code",{},"Sendable",", so the client can be shared across tasks and actors without wrapping it.",[168,231,232,233,236],{},"Config evaluation is synchronous and reads config state the client already holds in memory, which is what makes it safe to call from a SwiftUI ",[226,234,235],{},"body",". Telemetry about those evaluations is aggregated and reported on its own task, so evaluating a config never waits on the network.",[163,238,240],{"id":239},"installation","Installation",[168,242,243,244],{},"The SDK is distributed through Swift Package Manager from its repository: ",[245,246,247],"a",{"href":247,"rel":248},"https:\u002F\u002Fgithub.com\u002FConfigDirector\u002Fswift-sdk",[249],"nofollow",[251,252],"content-partial",{"name":253},"sdks\u002Fswift\u002Finstall",[163,255,257],{"id":256},"configure-and-initialize-the-client","Configure and initialize the client",[259,260,261,269],"ol",{},[262,263,264,265,268],"li",{},"Create an instance of the client providing your client SDK key. You can retrieve a client SDK key under your project settings in the ",[226,266,267],{},"Environments & SDK Keys"," tab.",[262,270,271],{},"Initialize the client to initiate its connection lifecycle.",[251,273],{"name":274},"sdks\u002Fswift\u002Fconfigure",[276,277,278],"note",{},"Before the client is initialized, config values will evaluate to the default value provided in code.",[168,280,281,282,285,286,289,290,293,294,297,298,301],{},"The initializer throws a ",[226,283,284],{},"ConfigDirectorError"," in only two cases, both of which are programming errors rather than runtime conditions: ",[226,287,288],{},"missingClientSDKKey"," when the key is blank, and ",[226,291,292],{},"invalidBaseURL"," when a custom base URL is not absolute. Connection failures are not thrown — ",[226,295,296],{},"initialize"," returns normally whether or not config state arrived, and ",[226,299,300],{},"isReady"," tells you which happened.",[168,303,304,305,308],{},"Most applications create a single client instance, initialize it during startup, and let it live for the lifetime of the app. In a SwiftUI app that usually means owning it in the ",[226,306,307],{},"App",":",[310,311,316],"pre",{"className":312,"code":313,"filename":314,"language":157,"meta":315,"style":315},"language-swift shiki shiki-themes material-theme-lighter github-light github-dark","import ConfigDirector\nimport SwiftUI\n\n@main\nstruct MyApp: App {\n    @State private var client = try? ConfigDirectorClient(clientSDKKey: \"YOUR-CLIENT-SDK-KEY\")\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .environment(\\.configDirectorClient, client)\n                .task {\n                    await client?.initialize(context: ConfigDirectorContext(id: \"user-123\"))\n                }\n        }\n    }\n}\n\nextension EnvironmentValues {\n    @Entry var configDirectorClient: ConfigDirectorClient?\n}\n","MyApp.swift","",[226,317,318,331,339,345,356,374,429,434,451,460,469,485,495,538,544,550,556,562,567,578,594],{"__ignoreMap":315},[319,320,323,327],"span",{"class":321,"line":322},"line",1,[319,324,326],{"class":325},"sVHd0","import",[319,328,330],{"class":329},"sbgvK"," ConfigDirector\n",[319,332,334,336],{"class":321,"line":333},2,[319,335,326],{"class":325},[319,337,338],{"class":329}," SwiftUI\n",[319,340,342],{"class":321,"line":341},3,[319,343,344],{"emptyLinePlaceholder":32},"\n",[319,346,348,352],{"class":321,"line":347},4,[319,349,351],{"class":350},"smGrS","@",[319,353,355],{"class":354},"sbsja","main\n",[319,357,359,362,365,368,371],{"class":321,"line":358},5,[319,360,361],{"class":354},"struct",[319,363,364],{"class":329}," MyApp",[319,366,308],{"class":367},"sP7_E",[319,369,370],{"class":329}," App ",[319,372,373],{"class":367},"{\n",[319,375,377,380,383,387,390,394,397,400,403,407,410,413,415,419,423,426],{"class":321,"line":376},6,[319,378,379],{"class":350},"    @",[319,381,382],{"class":354},"State",[319,384,386],{"class":385},"sw1J6"," private",[319,388,389],{"class":385}," var",[319,391,393],{"class":392},"su5hD"," client ",[319,395,396],{"class":350},"=",[319,398,399],{"class":325}," try",[319,401,402],{"class":350},"?",[319,404,406],{"class":405},"sptTA"," ConfigDirectorClient",[319,408,409],{"class":367},"(",[319,411,412],{"class":405},"clientSDKKey",[319,414,308],{"class":367},[319,416,418],{"class":417},"sjJ54"," \"",[319,420,422],{"class":421},"s_sjI","YOUR-CLIENT-SDK-KEY",[319,424,425],{"class":417},"\"",[319,427,428],{"class":367},")\n",[319,430,432],{"class":321,"line":431},7,[319,433,344],{"emptyLinePlaceholder":32},[319,435,437,440,443,446,449],{"class":321,"line":436},8,[319,438,439],{"class":385},"    var",[319,441,442],{"class":392}," body: ",[319,444,445],{"class":385},"some",[319,447,448],{"class":392}," Scene ",[319,450,373],{"class":367},[319,452,454,457],{"class":321,"line":453},9,[319,455,456],{"class":405},"        WindowGroup",[319,458,459],{"class":367}," {\n",[319,461,463,466],{"class":321,"line":462},10,[319,464,465],{"class":405},"            ContentView",[319,467,468],{"class":367},"()\n",[319,470,472,475,478,480,483],{"class":321,"line":471},11,[319,473,474],{"class":392},"                .",[319,476,477],{"class":405},"environment",[319,479,409],{"class":367},[319,481,482],{"class":392},"\\.configDirectorClient, client",[319,484,428],{"class":367},[319,486,488,490,493],{"class":321,"line":487},12,[319,489,474],{"class":392},[319,491,492],{"class":405},"task",[319,494,459],{"class":367},[319,496,498,501,504,506,509,511,513,516,518,521,523,526,528,530,533,535],{"class":321,"line":497},13,[319,499,500],{"class":325},"                    await",[319,502,503],{"class":392}," client",[319,505,402],{"class":350},[319,507,508],{"class":392},".",[319,510,296],{"class":405},[319,512,409],{"class":367},[319,514,515],{"class":405},"context",[319,517,308],{"class":367},[319,519,520],{"class":405}," ConfigDirectorContext",[319,522,409],{"class":367},[319,524,525],{"class":405},"id",[319,527,308],{"class":367},[319,529,418],{"class":417},[319,531,532],{"class":421},"user-123",[319,534,425],{"class":417},[319,536,537],{"class":367},"))\n",[319,539,541],{"class":321,"line":540},14,[319,542,543],{"class":367},"                }\n",[319,545,547],{"class":321,"line":546},15,[319,548,549],{"class":367},"        }\n",[319,551,553],{"class":321,"line":552},16,[319,554,555],{"class":367},"    }\n",[319,557,559],{"class":321,"line":558},17,[319,560,561],{"class":367},"}\n",[319,563,565],{"class":321,"line":564},18,[319,566,344],{"emptyLinePlaceholder":32},[319,568,570,573,576],{"class":321,"line":569},19,[319,571,572],{"class":354},"extension",[319,574,575],{"class":329}," EnvironmentValues",[319,577,459],{"class":367},[319,579,581,583,586,588,591],{"class":321,"line":580},20,[319,582,379],{"class":350},[319,584,585],{"class":354},"Entry",[319,587,389],{"class":385},[319,589,590],{"class":392}," configDirectorClient: ConfigDirectorClient",[319,592,593],{"class":350},"?\n",[319,595,597],{"class":321,"line":596},21,[319,598,561],{"class":367},[276,600,601,602,608],{},"The SDK follows the app lifecycle so it can release its network connection while the app is backgrounded. See ",[245,603,605],{"href":604},"#connection",[226,606,607],{},"connection"," below to manage that yourself instead.",[610,611,613],"h3",{"id":612},"additional-configuration-options","Additional configuration options",[168,615,616,617,508],{},"These options can be passed in to ",[226,618,619],{},"ConfigDirectorClientOptions",[621,622,624],"h4",{"id":623},"metadata",[226,625,623],{},[168,627,628,629,631],{},"The ",[226,630,623],{}," 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.",[168,633,634,635,638,639,642,643,646],{},"Whichever of the two you leave unset is read from the running application's bundle — ",[226,636,637],{},"CFBundleDisplayName"," (falling back to ",[226,640,641],{},"CFBundleName",") for the name, and ",[226,644,645],{},"CFBundleShortVersionString"," for the version — so most applications do not need to set either one.",[310,648,651],{"className":312,"code":649,"filename":650,"language":157,"meta":315,"style":315},"let client = try ConfigDirectorClient(\n    clientSDKKey: \"YOUR-CLIENT-SDK-KEY\",\n    options: ConfigDirectorClientOptions(\n        metadata: ConfigDirectorMetaContext(\n            appName: \"YOUR-APP-NAME\",\n            appVersion: \"1.0.2\"\n        )\n    )\n)\n","ConfigDirectorSetup.swift",[226,652,653,669,685,697,709,725,740,745,750],{"__ignoreMap":315},[319,654,655,658,660,662,664,666],{"class":321,"line":322},[319,656,657],{"class":385},"let",[319,659,393],{"class":392},[319,661,396],{"class":350},[319,663,399],{"class":325},[319,665,406],{"class":405},[319,667,668],{"class":367},"(\n",[319,670,671,674,676,678,680,682],{"class":321,"line":333},[319,672,673],{"class":405},"    clientSDKKey",[319,675,308],{"class":367},[319,677,418],{"class":417},[319,679,422],{"class":421},[319,681,425],{"class":417},[319,683,684],{"class":392},",\n",[319,686,687,690,692,695],{"class":321,"line":341},[319,688,689],{"class":405},"    options",[319,691,308],{"class":367},[319,693,694],{"class":405}," ConfigDirectorClientOptions",[319,696,668],{"class":367},[319,698,699,702,704,707],{"class":321,"line":347},[319,700,701],{"class":405},"        metadata",[319,703,308],{"class":367},[319,705,706],{"class":405}," ConfigDirectorMetaContext",[319,708,668],{"class":367},[319,710,711,714,716,718,721,723],{"class":321,"line":358},[319,712,713],{"class":405},"            appName",[319,715,308],{"class":367},[319,717,418],{"class":417},[319,719,720],{"class":421},"YOUR-APP-NAME",[319,722,425],{"class":417},[319,724,684],{"class":392},[319,726,727,730,732,734,737],{"class":321,"line":376},[319,728,729],{"class":405},"            appVersion",[319,731,308],{"class":367},[319,733,418],{"class":417},[319,735,736],{"class":421},"1.0.2",[319,738,739],{"class":417},"\"\n",[319,741,742],{"class":321,"line":431},[319,743,744],{"class":367},"        )\n",[319,746,747],{"class":321,"line":436},[319,748,749],{"class":367},"    )\n",[319,751,752],{"class":321,"line":453},[319,753,428],{"class":367},[621,755,757],{"id":756},"logger",[226,758,756],{},[168,760,761,762,765,766,768,769,772],{},"By default, the SDK logs to the unified logging system under the ",[226,763,764],{},"com.configdirector.sdk"," subsystem, and it is set to log warnings and errors only. You can configure a ",[226,767,756],{}," by either creating a ConfigDirector console logger with a different log level, or by conforming to the ",[226,770,771],{},"ConfigDirectorLogger"," protocol to provide your own logger. The protocol can be used to create an adapter to another logging library.",[168,774,775],{},"Configure the ConfigDirector console logger to a different level:",[310,777,779],{"className":312,"code":778,"filename":650,"language":157,"meta":315,"style":315},"let client = try ConfigDirectorClient(\n    clientSDKKey: \"YOUR-CLIENT-SDK-KEY\",\n    options: ConfigDirectorClientOptions(logger: ConsoleLogger(level: .debug))\n)\n",[226,780,781,795,809,838],{"__ignoreMap":315},[319,782,783,785,787,789,791,793],{"class":321,"line":322},[319,784,657],{"class":385},[319,786,393],{"class":392},[319,788,396],{"class":350},[319,790,399],{"class":325},[319,792,406],{"class":405},[319,794,668],{"class":367},[319,796,797,799,801,803,805,807],{"class":321,"line":333},[319,798,673],{"class":405},[319,800,308],{"class":367},[319,802,418],{"class":417},[319,804,422],{"class":421},[319,806,425],{"class":417},[319,808,684],{"class":392},[319,810,811,813,815,817,819,821,823,826,828,831,833,836],{"class":321,"line":341},[319,812,689],{"class":405},[319,814,308],{"class":367},[319,816,694],{"class":405},[319,818,409],{"class":367},[319,820,756],{"class":405},[319,822,308],{"class":367},[319,824,825],{"class":405}," ConsoleLogger",[319,827,409],{"class":367},[319,829,830],{"class":405},"level",[319,832,308],{"class":367},[319,834,835],{"class":392}," .debug",[319,837,537],{"class":367},[319,839,840],{"class":321,"line":347},[319,841,428],{"class":367},[168,843,844,845,848,849,848,852,855,856,859,860,508],{},"The available levels are ",[226,846,847],{},".off",", ",[226,850,851],{},".error",[226,853,854],{},".warn"," (the default), ",[226,857,858],{},".info"," and ",[226,861,862],{},".debug",[168,864,865],{},"Implement your own logger adapter:",[310,867,870],{"className":312,"code":868,"filename":869,"language":157,"meta":315,"style":315},"import ConfigDirector\n\nstruct MyLogger: ConfigDirectorLogger {\n    \u002F\u002F Messages more verbose than this level are never passed to `log`.\n    let level: ConfigDirectorLogLevel = .info\n\n    func log(_ level: ConfigDirectorLogLevel, message: String, error: (any Error)?) {\n        \u002F\u002F your specific logging library implementation here\n    }\n}\n\nlet client = try ConfigDirectorClient(\n    clientSDKKey: \"YOUR-CLIENT-SDK-KEY\",\n    options: ConfigDirectorClientOptions(logger: MyLogger())\n)\n","MyLogger.swift",[226,871,872,878,882,896,902,915,919,975,980,984,988,992,1006,1020,1039],{"__ignoreMap":315},[319,873,874,876],{"class":321,"line":322},[319,875,326],{"class":325},[319,877,330],{"class":329},[319,879,880],{"class":321,"line":333},[319,881,344],{"emptyLinePlaceholder":32},[319,883,884,886,889,891,894],{"class":321,"line":341},[319,885,361],{"class":354},[319,887,888],{"class":329}," MyLogger",[319,890,308],{"class":367},[319,892,893],{"class":329}," ConfigDirectorLogger ",[319,895,373],{"class":367},[319,897,898],{"class":321,"line":347},[319,899,901],{"class":900},"sutJx","    \u002F\u002F Messages more verbose than this level are never passed to `log`.\n",[319,903,904,907,910,912],{"class":321,"line":358},[319,905,906],{"class":385},"    let",[319,908,909],{"class":392}," level: ConfigDirectorLogLevel ",[319,911,396],{"class":350},[319,913,914],{"class":392}," .info\n",[319,916,917],{"class":321,"line":376},[319,918,344],{"emptyLinePlaceholder":32},[319,920,921,924,928,930,933,937,940,944,947,951,953,956,958,960,963,966,969,971,973],{"class":321,"line":431},[319,922,923],{"class":354},"    func",[319,925,927],{"class":926},"sGLFI"," log",[319,929,409],{"class":367},[319,931,932],{"class":926},"_",[319,934,936],{"class":935},"sFwrP"," level",[319,938,939],{"class":392},": ConfigDirectorLogLevel, ",[319,941,943],{"class":942},"s95qv","message",[319,945,946],{"class":392},": ",[319,948,950],{"class":949},"sZMiF","String",[319,952,848],{"class":392},[319,954,955],{"class":942},"error",[319,957,946],{"class":392},[319,959,409],{"class":367},[319,961,962],{"class":385},"any",[319,964,965],{"class":949}," Error",[319,967,968],{"class":367},")",[319,970,402],{"class":350},[319,972,968],{"class":367},[319,974,459],{"class":367},[319,976,977],{"class":321,"line":436},[319,978,979],{"class":900},"        \u002F\u002F your specific logging library implementation here\n",[319,981,982],{"class":321,"line":453},[319,983,555],{"class":367},[319,985,986],{"class":321,"line":462},[319,987,561],{"class":367},[319,989,990],{"class":321,"line":471},[319,991,344],{"emptyLinePlaceholder":32},[319,993,994,996,998,1000,1002,1004],{"class":321,"line":487},[319,995,657],{"class":385},[319,997,393],{"class":392},[319,999,396],{"class":350},[319,1001,399],{"class":325},[319,1003,406],{"class":405},[319,1005,668],{"class":367},[319,1007,1008,1010,1012,1014,1016,1018],{"class":321,"line":497},[319,1009,673],{"class":405},[319,1011,308],{"class":367},[319,1013,418],{"class":417},[319,1015,422],{"class":421},[319,1017,425],{"class":417},[319,1019,684],{"class":392},[319,1021,1022,1024,1026,1028,1030,1032,1034,1036],{"class":321,"line":540},[319,1023,689],{"class":405},[319,1025,308],{"class":367},[319,1027,694],{"class":405},[319,1029,409],{"class":367},[319,1031,756],{"class":405},[319,1033,308],{"class":367},[319,1035,888],{"class":405},[319,1037,1038],{"class":367},"())\n",[319,1040,1041],{"class":321,"line":546},[319,1042,428],{"class":367},[621,1044,1045],{"id":607},[226,1046,607],{},[168,1048,1049,1052],{},[226,1050,1051],{},"ConnectionOptions"," accepts five optional values:",[1054,1055,1056,1090,1112,1139,1167],"ul",{},[262,1057,1058,1061],{},[226,1059,1060],{},"mode",[1054,1062,1063,1080,1085],{},[262,1064,1065,1066,1069,1070,1073,1074,1076,1077,1079],{},"The connection mode, which can be ",[226,1067,1068],{},".streaming"," or ",[226,1071,1072],{},".polling",". It is recommended to use the default of ",[226,1075,1068],{}," unless you have a specific need to use ",[226,1078,1072],{}," instead.",[262,1081,1082,1084],{},[226,1083,1068],{}," holds a connection open and receives changes as they happen, reconnecting on its own with a backoff.",[262,1086,1087,1088],{},"Defaults to ",[226,1089,1068],{},[262,1091,1092,1095],{},[226,1093,1094],{},"pollingInterval",[1054,1096,1097,1106],{},[262,1098,1099,1100,1102,1103,1105],{},"How often to re-fetch config state when ",[226,1101,1060],{}," is ",[226,1104,1072],{},". It has no effect in any other mode.",[262,1107,1087,1108,1111],{},[226,1109,1110],{},"60"," seconds",[262,1113,1114,1117],{},[226,1115,1116],{},"timeout",[1054,1118,1119,1128,1134],{},[262,1120,1121,1122,1124,1125,1127],{},"The timeout to be used in initialization and when updating the context. This is how long ",[226,1123,296],{}," will wait for data from ConfigDirector services before returning. If the timeout is reached, ",[226,1126,296],{}," 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.",[262,1129,1130,1131,1133],{},"If your application is used in environments where the users frequently have poor or no connection, you may want to use a lower timeout, or simply don't await the ",[226,1132,296],{}," call.",[262,1135,1087,1136,1111],{},[226,1137,1138],{},"3",[262,1140,1141,1144],{},[226,1142,1143],{},"pausesWhileBackgrounded",[1054,1145,1146,1159,1162],{},[262,1147,1148,1149,1152,1153,859,1156,508],{},"Whether to pause the connection while the app is in the background and resume it when the app returns to the foreground. Mobile operating systems terminate background connections on their own, so this is enabled by default. Set it to ",[226,1150,1151],{},"false"," to manage the connection yourself with ",[226,1154,1155],{},"pauseNetwork()",[226,1157,1158],{},"resumeNetwork()",[262,1160,1161],{},"It has no effect on macOS, where an app keeps running, and keeps its connections, once it leaves the foreground.",[262,1163,1087,1164],{},[226,1165,1166],{},"true",[262,1168,1169,1172],{},[226,1170,1171],{},"baseURL",[1054,1173,1174,1177],{},[262,1175,1176],{},"The base URL used to connect to ConfigDirector services.",[262,1178,1179],{},"This should only be provided if your environment requires you to configure a proxy server in order to connect to ConfigDirector services.",[310,1181,1183],{"className":312,"code":1182,"filename":650,"language":157,"meta":315,"style":315},"let client = try ConfigDirectorClient(\n    clientSDKKey: \"YOUR-CLIENT-SDK-KEY\",\n    options: ConfigDirectorClientOptions(\n        connection: ConnectionOptions(mode: .polling, pollingInterval: 600, timeout: 2)\n    )\n)\n",[226,1184,1185,1199,1213,1223,1261,1265],{"__ignoreMap":315},[319,1186,1187,1189,1191,1193,1195,1197],{"class":321,"line":322},[319,1188,657],{"class":385},[319,1190,393],{"class":392},[319,1192,396],{"class":350},[319,1194,399],{"class":325},[319,1196,406],{"class":405},[319,1198,668],{"class":367},[319,1200,1201,1203,1205,1207,1209,1211],{"class":321,"line":333},[319,1202,673],{"class":405},[319,1204,308],{"class":367},[319,1206,418],{"class":417},[319,1208,422],{"class":421},[319,1210,425],{"class":417},[319,1212,684],{"class":392},[319,1214,1215,1217,1219,1221],{"class":321,"line":341},[319,1216,689],{"class":405},[319,1218,308],{"class":367},[319,1220,694],{"class":405},[319,1222,668],{"class":367},[319,1224,1225,1228,1230,1233,1235,1237,1239,1242,1244,1246,1250,1252,1254,1256,1259],{"class":321,"line":347},[319,1226,1227],{"class":405},"        connection",[319,1229,308],{"class":367},[319,1231,1232],{"class":405}," ConnectionOptions",[319,1234,409],{"class":367},[319,1236,1060],{"class":405},[319,1238,308],{"class":367},[319,1240,1241],{"class":392}," .polling, ",[319,1243,1094],{"class":405},[319,1245,308],{"class":367},[319,1247,1249],{"class":1248},"srdBf"," 600",[319,1251,848],{"class":392},[319,1253,1116],{"class":405},[319,1255,308],{"class":367},[319,1257,1258],{"class":1248}," 2",[319,1260,428],{"class":367},[319,1262,1263],{"class":321,"line":358},[319,1264,749],{"class":367},[319,1266,1267],{"class":321,"line":376},[319,1268,428],{"class":367},[610,1270,1272],{"id":1271},"events","Events",[168,1274,1275,1276,1278,1279,1282,1283,1286,1287,1290],{},"Events notify you of some key actions from the client. ",[226,1277,1271],{}," publishes the client's lifecycle changes, and ",[226,1280,1281],{},"evaluations"," publishes every individual config evaluation. Each is an ",[226,1284,1285],{},"AsyncStream"," you consume with a ",[226,1288,1289],{},"for await"," loop, and each access to the property returns an independent stream, so several parts of your app can observe them at once. Cancelling the consuming task ends the loop, and every stream is finished when the client is closed.",[310,1292,1294],{"className":312,"code":1293,"filename":650,"language":157,"meta":315,"style":315},"for await event in client.events {\n    switch event {\n    case let .ready(reason):\n        print(\"Client is ready after \\(reason)\")\n    case let .configsUpdated(keys):\n        print(\"Configs updated: \\(keys)\")\n    case let .contextUpdated(context):\n        print(\"Context updated: \\(context?.id ?? \"none\")\")\n    }\n}\n",[226,1295,1296,1315,1324,1348,1372,1392,1413,1432,1469,1473],{"__ignoreMap":315},[319,1297,1298,1301,1304,1307,1310,1313],{"class":321,"line":322},[319,1299,1300],{"class":325},"for",[319,1302,1303],{"class":325}," await",[319,1305,1306],{"class":392}," event ",[319,1308,1309],{"class":325},"in",[319,1311,1312],{"class":392}," client.events ",[319,1314,373],{"class":367},[319,1316,1317,1320,1322],{"class":321,"line":333},[319,1318,1319],{"class":325},"    switch",[319,1321,1306],{"class":392},[319,1323,373],{"class":367},[319,1325,1326,1329,1332,1335,1338,1340,1343,1345],{"class":321,"line":341},[319,1327,1328],{"class":325},"    case",[319,1330,1331],{"class":385}," let",[319,1333,1334],{"class":392}," .",[319,1336,1337],{"class":405},"ready",[319,1339,409],{"class":367},[319,1341,1342],{"class":392},"reason",[319,1344,968],{"class":367},[319,1346,1347],{"class":350},":\n",[319,1349,1350,1353,1355,1357,1360,1363,1366,1368,1370],{"class":321,"line":347},[319,1351,1352],{"class":405},"        print",[319,1354,409],{"class":367},[319,1356,425],{"class":417},[319,1358,1359],{"class":421},"Client is ready after ",[319,1361,1362],{"class":417},"\\(",[319,1364,1342],{"class":1365},"sfo-9",[319,1367,968],{"class":417},[319,1369,425],{"class":417},[319,1371,428],{"class":367},[319,1373,1374,1376,1378,1380,1383,1385,1388,1390],{"class":321,"line":358},[319,1375,1328],{"class":325},[319,1377,1331],{"class":385},[319,1379,1334],{"class":392},[319,1381,1382],{"class":405},"configsUpdated",[319,1384,409],{"class":367},[319,1386,1387],{"class":392},"keys",[319,1389,968],{"class":367},[319,1391,1347],{"class":350},[319,1393,1394,1396,1398,1400,1403,1405,1407,1409,1411],{"class":321,"line":376},[319,1395,1352],{"class":405},[319,1397,409],{"class":367},[319,1399,425],{"class":417},[319,1401,1402],{"class":421},"Configs updated: ",[319,1404,1362],{"class":417},[319,1406,1387],{"class":1365},[319,1408,968],{"class":417},[319,1410,425],{"class":417},[319,1412,428],{"class":367},[319,1414,1415,1417,1419,1421,1424,1426,1428,1430],{"class":321,"line":431},[319,1416,1328],{"class":325},[319,1418,1331],{"class":385},[319,1420,1334],{"class":392},[319,1422,1423],{"class":405},"contextUpdated",[319,1425,409],{"class":367},[319,1427,515],{"class":392},[319,1429,968],{"class":367},[319,1431,1347],{"class":350},[319,1433,1434,1436,1438,1440,1443,1445,1447,1449,1451,1453,1456,1458,1461,1463,1465,1467],{"class":321,"line":436},[319,1435,1352],{"class":405},[319,1437,409],{"class":367},[319,1439,425],{"class":417},[319,1441,1442],{"class":421},"Context updated: ",[319,1444,1362],{"class":417},[319,1446,515],{"class":1365},[319,1448,402],{"class":350},[319,1450,508],{"class":1365},[319,1452,525],{"class":392},[319,1454,1455],{"class":350}," ??",[319,1457,418],{"class":417},[319,1459,1460],{"class":421},"none",[319,1462,425],{"class":417},[319,1464,968],{"class":417},[319,1466,425],{"class":417},[319,1468,428],{"class":367},[319,1470,1471],{"class":321,"line":453},[319,1472,555],{"class":367},[319,1474,1475],{"class":321,"line":462},[319,1476,561],{"class":367},[168,1478,1479,1480,308],{},"The following events are published on ",[226,1481,1482],{},"client.events",[1054,1484,1485,1514,1530],{},[262,1486,1487,1492],{},[226,1488,1491],{"className":1489},[1490],"font-semibold","ready(ConnectReason)",[1054,1493,1494,1497],{},[262,1495,1496],{},"Emitted when the client is initialized, or after reconnection due to a context update or a resumed network connection. When this event is emitted it means the client has received a payload from the ConfigDirector servers and is ready to evaluate configs.",[262,1498,1499,1500,1503,1504,848,1507,1510,1511,508],{},"The associated ",[226,1501,1502],{},"ConnectReason"," is the action that triggered the client to connect\u002Freconnect, which can be ",[226,1505,1506],{},".initialization",[226,1508,1509],{},".contextUpdate",", or ",[226,1512,1513],{},".networkResume",[262,1515,1516,1522],{},[226,1517,1519,1520,968],{"className":1518},[1490],"configsUpdated(",[319,1521,950],{},[1054,1523,1524,1527],{},[262,1525,1526],{},"Emitted when a payload is received from the ConfigDirector servers with config data. It is emitted during initialization or context update when an entire config payload is received. After initialization or context update, it is emitted when updates are pushed from the server (or discovered via polling if that connection mode is used).",[262,1528,1529],{},"The associated value lists the config keys that were included in the payload from the server. On a delta update, these are only the configs that changed.",[262,1531,1532,1536],{},[226,1533,1535],{"className":1534},[1490],"contextUpdated(ConfigDirectorContext?)",[1054,1537,1538,1544],{},[262,1539,1540,1541,1543],{},"Emitted whenever the user context takes effect, including during initialization. It is emitted before ",[226,1542,1337],{},", therefore should not be relied upon as a lifecycle event but rather as an informational event to track updates to the user context.",[262,1545,1546,1547,508],{},"The associated value is the context the client is now evaluating against. It can be ",[226,1548,1549],{},"nil",[168,1551,1552,1555,1556,1559,1560,1563,1564,1567,1568,1570],{},[226,1553,1554],{},"client.evaluations"," publishes a ",[226,1557,1558],{},"ConfigEvaluation"," every time a config is evaluated, which can be useful for debugging what a screen actually read, and for capturing additional context for analytics events. This includes calls to ",[226,1561,1562],{},"value(for:default:)"," and evaluations delivered by a ",[226,1565,1566],{},"values(for:default:)"," stream. A ",[226,1569,1558],{}," carries:",[1054,1572,1573,1579,1601,1614,1620,1626],{},[262,1574,1575,1578],{},[226,1576,1577],{},"key: String"," - The config key that was evaluated.",[262,1580,1581,1584,1585,1069,1587,1589,1590,1593,1594,1596,1597,1600],{},[226,1582,1583],{},"value: ConfigEvaluationValue"," - The value the config evaluated to. It can be the default value provided to ",[226,1586,1562],{},[226,1588,1566],{},", for example if the config was evaluated before the client was initialized. Read it back as the type the config was evaluated as with ",[226,1591,1592],{},"evaluation.value.as(Bool.self)",", which returns ",[226,1595,1549],{}," when the config was evaluated as some other type. Its ",[226,1598,1599],{},"description"," is a textual form of the value, suitable for logging.",[262,1602,1603,1606,1607,1610,1611,1613],{},[226,1604,1605],{},"valueID: String?"," - 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 ",[226,1608,1609],{},"value",". This can be useful for large values, like a JSON config, or to avoid disclosing the values themselves to third parties. It is ",[226,1612,1549],{}," if the evaluation had to fall back to the default value.",[262,1615,1616,1619],{},[226,1617,1618],{},"isDefaultValue: Bool"," - Whether or not the evaluation fell back to the default value provided in code.",[262,1621,1622,1625],{},[226,1623,1624],{},"context: ConfigDirectorContext?"," - The context the config was evaluated against, if one was set.",[262,1627,1628,1631,1632,1635,1636,1638,1639],{},[226,1629,1630],{},"reason: EvaluationReason"," - The reason for the evaluation resolution. In the case the config successfully evaluated based on server-provided targeting rules, it will be ",[226,1633,1634],{},".foundMatch",". If the evaluation had to fall back to the default value, the ",[226,1637,1342],{}," will encode why the fallback was required:\n",[1054,1640,1641,1647,1653,1659,1665,1671,1677],{},[262,1642,1643,1646],{},[226,1644,1645],{},".clientNotReady"," - The evaluation happened before the client finished initialization.",[262,1648,1649,1652],{},[226,1650,1651],{},".configStateMissing"," - 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.",[262,1654,1655,1658],{},[226,1656,1657],{},".valueMissing"," - The config had no value for the current context.",[262,1660,1661,1664],{},[226,1662,1663],{},".invalidNumber"," - The config was requested as a number but the value received from the server could not be converted to a number.",[262,1666,1667,1670],{},[226,1668,1669],{},".invalidBoolean"," - The config was requested as a boolean but the value received from the server could not be converted to a boolean.",[262,1672,1673,1676],{},[226,1674,1675],{},".invalidJSON"," - The config was requested as JSON but the value received from the server could not be decoded into the requested type.",[262,1678,1679,1682],{},[226,1680,1681],{},".typeMismatch"," - The config was requested with a data type that did not match the type of the config and no reasonable type conversion was possible.",[168,1684,1685,1102,1687,1690],{},[226,1686,1558],{},[226,1688,1689],{},"Equatable",", so evaluations can be compared or de-duplicated before they are forwarded on.",[310,1692,1694],{"className":312,"code":1693,"filename":650,"language":157,"meta":315,"style":315},"for await evaluation in client.evaluations where evaluation.isDefaultValue {\n    print(\"'\\(evaluation.key)' fell back to its default: \\(evaluation.reason.rawValue)\")\n}\n",[226,1695,1696,1718,1761],{"__ignoreMap":315},[319,1697,1698,1700,1702,1705,1707,1710,1713,1716],{"class":321,"line":322},[319,1699,1300],{"class":325},[319,1701,1303],{"class":325},[319,1703,1704],{"class":392}," evaluation ",[319,1706,1309],{"class":325},[319,1708,1709],{"class":392}," client.evaluations ",[319,1711,1712],{"class":325},"where",[319,1714,1715],{"class":392}," evaluation.isDefaultValue ",[319,1717,373],{"class":367},[319,1719,1720,1723,1725,1727,1730,1732,1735,1738,1740,1743,1745,1747,1749,1751,1755,1757,1759],{"class":321,"line":333},[319,1721,1722],{"class":405},"    print",[319,1724,409],{"class":367},[319,1726,425],{"class":417},[319,1728,1729],{"class":421},"'",[319,1731,1362],{"class":417},[319,1733,1734],{"class":1365},"evaluation.",[319,1736,1737],{"class":392},"key",[319,1739,968],{"class":417},[319,1741,1742],{"class":421},"' fell back to its default: ",[319,1744,1362],{"class":417},[319,1746,1734],{"class":1365},[319,1748,1342],{"class":392},[319,1750,508],{"class":1365},[319,1752,1754],{"class":1753},"s_hVV","rawValue",[319,1756,968],{"class":417},[319,1758,425],{"class":417},[319,1760,428],{"class":367},[319,1762,1763],{"class":321,"line":341},[319,1764,561],{"class":367},[310,1766,1768],{"className":312,"code":1767,"filename":650,"language":157,"meta":315,"style":315},"for await evaluation in client.evaluations {\n    guard let isOn = evaluation.value.as(Bool.self) else { continue }\n\n    print(\"'\\(evaluation.key)' evaluated to \\(isOn), value ID \\(evaluation.valueID ?? \"none\")\")\n}\n",[226,1769,1770,1784,1830,1834,1886],{"__ignoreMap":315},[319,1771,1772,1774,1776,1778,1780,1782],{"class":321,"line":322},[319,1773,1300],{"class":325},[319,1775,1303],{"class":325},[319,1777,1704],{"class":392},[319,1779,1309],{"class":325},[319,1781,1709],{"class":392},[319,1783,373],{"class":367},[319,1785,1786,1789,1791,1794,1796,1799,1801,1803,1806,1808,1811,1813,1816,1818,1821,1824,1827],{"class":321,"line":333},[319,1787,1788],{"class":325},"    guard",[319,1790,1331],{"class":385},[319,1792,1793],{"class":392}," isOn ",[319,1795,396],{"class":350},[319,1797,1798],{"class":392}," evaluation.",[319,1800,1609],{"class":1753},[319,1802,508],{"class":392},[319,1804,1805],{"class":350},"as",[319,1807,409],{"class":367},[319,1809,1810],{"class":949},"Bool",[319,1812,508],{"class":392},[319,1814,1815],{"class":385},"self",[319,1817,968],{"class":367},[319,1819,1820],{"class":325}," else",[319,1822,1823],{"class":367}," {",[319,1825,1826],{"class":325}," continue",[319,1828,1829],{"class":367}," }\n",[319,1831,1832],{"class":321,"line":341},[319,1833,344],{"emptyLinePlaceholder":32},[319,1835,1836,1838,1840,1842,1844,1846,1848,1850,1852,1855,1857,1860,1862,1865,1867,1869,1872,1874,1876,1878,1880,1882,1884],{"class":321,"line":347},[319,1837,1722],{"class":405},[319,1839,409],{"class":367},[319,1841,425],{"class":417},[319,1843,1729],{"class":421},[319,1845,1362],{"class":417},[319,1847,1734],{"class":1365},[319,1849,1737],{"class":392},[319,1851,968],{"class":417},[319,1853,1854],{"class":421},"' evaluated to ",[319,1856,1362],{"class":417},[319,1858,1859],{"class":1365},"isOn",[319,1861,968],{"class":417},[319,1863,1864],{"class":421},", value ID ",[319,1866,1362],{"class":417},[319,1868,1734],{"class":1365},[319,1870,1871],{"class":392},"valueID",[319,1873,1455],{"class":350},[319,1875,418],{"class":417},[319,1877,1460],{"class":421},[319,1879,425],{"class":417},[319,1881,968],{"class":417},[319,1883,425],{"class":417},[319,1885,428],{"class":367},[319,1887,1888],{"class":321,"line":358},[319,1889,561],{"class":367},[1891,1892,1893,1894,1896],"warning",{},"Do not update view state straight from the ",[226,1895,1281],{}," stream. The state change re-renders the view, which reads the config again, which publishes another evaluation.",[163,1898,1900],{"id":1899},"retrieve-config-values","Retrieve config values",[168,1902,1903,1904,1906],{},"To synchronously retrieve config values, use the client's ",[226,1905,1562],{}," method. It requires two arguments. The first argument is the config key, and the second is the default value to be returned if the client has not yet received config values from ConfigDirector services.",[168,1908,1909,1910,1912,1913,1915],{},"You can also subscribe to config value changes via the ",[226,1911,1566],{}," method. It takes the same two arguments and returns an ",[226,1914,1285],{}," that emits the config's current value on subscription and then every time the evaluated value changes, whether because it was edited in the ConfigDirector dashboard or because the context was updated. Consecutive identical values are not re-emitted. Cancelling the task consuming the stream stops watching.",[251,1917],{"name":1918},"sdks\u002Fswift\u002Fsimple-usage",[168,1920,1921,1922,848,1924,848,1926,859,1929,1932],{},"Both methods infer their type from the default value. ",[226,1923,1810],{},[226,1925,950],{},[226,1927,1928],{},"Int",[226,1930,1931],{},"Double"," are supported out of the box. If there is a type mismatch at runtime, the SDK will attempt to convert the served value to the requested type. If the conversion fails, it will return the default value rather than trapping. Mismatched types at runtime are captured by the telemetry collector and will surface as warnings in the ConfigDirector dashboard.",[310,1934,1937],{"className":312,"code":1935,"filename":1936,"language":157,"meta":315,"style":315},"client.value(for: \"my-string-config-key\", default: \"Default\")\n\nclient.value(for: \"my-integer-config-key\", default: 100)\n\nclient.value(for: \"my-boolean-config-key\", default: false)\n","ContentView.swift",[226,1938,1939,1975,1979,2009,2013],{"__ignoreMap":315},[319,1940,1941,1944,1946,1948,1950,1952,1954,1957,1959,1961,1964,1966,1968,1971,1973],{"class":321,"line":322},[319,1942,1943],{"class":392},"client.",[319,1945,1609],{"class":1753},[319,1947,409],{"class":367},[319,1949,1300],{"class":405},[319,1951,308],{"class":367},[319,1953,418],{"class":417},[319,1955,1956],{"class":421},"my-string-config-key",[319,1958,425],{"class":417},[319,1960,848],{"class":392},[319,1962,1963],{"class":405},"default",[319,1965,308],{"class":367},[319,1967,418],{"class":417},[319,1969,1970],{"class":421},"Default",[319,1972,425],{"class":417},[319,1974,428],{"class":367},[319,1976,1977],{"class":321,"line":333},[319,1978,344],{"emptyLinePlaceholder":32},[319,1980,1981,1983,1985,1987,1989,1991,1993,1996,1998,2000,2002,2004,2007],{"class":321,"line":341},[319,1982,1943],{"class":392},[319,1984,1609],{"class":1753},[319,1986,409],{"class":367},[319,1988,1300],{"class":405},[319,1990,308],{"class":367},[319,1992,418],{"class":417},[319,1994,1995],{"class":421},"my-integer-config-key",[319,1997,425],{"class":417},[319,1999,848],{"class":392},[319,2001,1963],{"class":405},[319,2003,308],{"class":367},[319,2005,2006],{"class":1248}," 100",[319,2008,428],{"class":367},[319,2010,2011],{"class":321,"line":347},[319,2012,344],{"emptyLinePlaceholder":32},[319,2014,2015,2017,2019,2021,2023,2025,2027,2030,2032,2034,2036,2038,2042],{"class":321,"line":358},[319,2016,1943],{"class":392},[319,2018,1609],{"class":1753},[319,2020,409],{"class":367},[319,2022,1300],{"class":405},[319,2024,308],{"class":367},[319,2026,418],{"class":417},[319,2028,2029],{"class":421},"my-boolean-config-key",[319,2031,425],{"class":417},[319,2033,848],{"class":392},[319,2035,1963],{"class":405},[319,2037,308],{"class":367},[319,2039,2041],{"class":2040},"syTEX"," false",[319,2043,428],{"class":367},[610,2045,2047],{"id":2046},"json-configs","JSON configs",[168,2049,2050,2051,2054,2055,2058],{},"A config holding a JSON document is read with ",[226,2052,2053],{},"value(for:as:default:)",", which decodes it into any ",[226,2056,2057],{},"Decodable"," type. It returns the default value when the config is not a JSON config, or when its document cannot be decoded into the type you asked for:",[310,2060,2062],{"className":312,"code":2061,"filename":1936,"language":157,"meta":315,"style":315},"struct Theme: Decodable {\n    let primary: String\n    let cornerRadius: Double\n}\n\nlet theme = client.value(\n    for: \"theme\",\n    as: Theme.self,\n    default: Theme(primary: \"#101010\", cornerRadius: 8)\n)\n",[226,2063,2064,2078,2088,2098,2102,2106,2122,2138,2152,2187],{"__ignoreMap":315},[319,2065,2066,2068,2071,2073,2076],{"class":321,"line":322},[319,2067,361],{"class":354},[319,2069,2070],{"class":329}," Theme",[319,2072,308],{"class":367},[319,2074,2075],{"class":329}," Decodable ",[319,2077,373],{"class":367},[319,2079,2080,2082,2085],{"class":321,"line":333},[319,2081,906],{"class":385},[319,2083,2084],{"class":392}," primary: ",[319,2086,2087],{"class":949},"String\n",[319,2089,2090,2092,2095],{"class":321,"line":341},[319,2091,906],{"class":385},[319,2093,2094],{"class":392}," cornerRadius: ",[319,2096,2097],{"class":949},"Double\n",[319,2099,2100],{"class":321,"line":347},[319,2101,561],{"class":367},[319,2103,2104],{"class":321,"line":358},[319,2105,344],{"emptyLinePlaceholder":32},[319,2107,2108,2110,2113,2115,2118,2120],{"class":321,"line":376},[319,2109,657],{"class":385},[319,2111,2112],{"class":392}," theme ",[319,2114,396],{"class":350},[319,2116,2117],{"class":392}," client.",[319,2119,1609],{"class":1753},[319,2121,668],{"class":367},[319,2123,2124,2127,2129,2131,2134,2136],{"class":321,"line":431},[319,2125,2126],{"class":405},"    for",[319,2128,308],{"class":367},[319,2130,418],{"class":417},[319,2132,2133],{"class":421},"theme",[319,2135,425],{"class":417},[319,2137,684],{"class":392},[319,2139,2140,2143,2145,2148,2150],{"class":321,"line":436},[319,2141,2142],{"class":405},"    as",[319,2144,308],{"class":367},[319,2146,2147],{"class":392}," Theme.",[319,2149,1815],{"class":385},[319,2151,684],{"class":392},[319,2153,2154,2157,2159,2161,2163,2166,2168,2170,2173,2175,2177,2180,2182,2185],{"class":321,"line":453},[319,2155,2156],{"class":405},"    default",[319,2158,308],{"class":367},[319,2160,2070],{"class":405},[319,2162,409],{"class":367},[319,2164,2165],{"class":405},"primary",[319,2167,308],{"class":367},[319,2169,418],{"class":417},[319,2171,2172],{"class":421},"#101010",[319,2174,425],{"class":417},[319,2176,848],{"class":392},[319,2178,2179],{"class":405},"cornerRadius",[319,2181,308],{"class":367},[319,2183,2184],{"class":1248}," 8",[319,2186,428],{"class":367},[319,2188,2189],{"class":321,"line":462},[319,2190,428],{"class":367},[168,2192,2193,2196,2197,2199],{},[226,2194,2195],{},"values(for:as:default:)"," is the streaming counterpart. Its type has to be ",[226,2198,1689],{}," as well, since that is how the stream knows a decoded value did not change:",[310,2201,2203],{"className":312,"code":2202,"filename":1936,"language":157,"meta":315,"style":315},"for await theme in client.values(for: \"theme\", as: Theme.self, default: .fallback) {\n    self.theme = theme\n}\n",[226,2204,2205,2255,2268],{"__ignoreMap":315},[319,2206,2207,2209,2211,2213,2215,2217,2220,2222,2224,2226,2228,2230,2232,2234,2236,2238,2240,2242,2244,2246,2248,2251,2253],{"class":321,"line":322},[319,2208,1300],{"class":325},[319,2210,1303],{"class":325},[319,2212,2112],{"class":392},[319,2214,1309],{"class":325},[319,2216,2117],{"class":392},[319,2218,2219],{"class":1753},"values",[319,2221,409],{"class":367},[319,2223,1300],{"class":405},[319,2225,308],{"class":367},[319,2227,418],{"class":417},[319,2229,2133],{"class":421},[319,2231,425],{"class":417},[319,2233,848],{"class":392},[319,2235,1805],{"class":405},[319,2237,308],{"class":367},[319,2239,2147],{"class":392},[319,2241,1815],{"class":385},[319,2243,848],{"class":392},[319,2245,1963],{"class":405},[319,2247,308],{"class":367},[319,2249,2250],{"class":392}," .fallback",[319,2252,968],{"class":367},[319,2254,459],{"class":367},[319,2256,2257,2260,2263,2265],{"class":321,"line":333},[319,2258,2259],{"class":1753},"    self",[319,2261,2262],{"class":392},".theme ",[319,2264,396],{"class":350},[319,2266,2267],{"class":392}," theme\n",[319,2269,2270],{"class":321,"line":341},[319,2271,561],{"class":367},[610,2273,2275],{"id":2274},"custom-value-types","Custom value types",[168,2277,2278,2279,2282,2283,2286,2287,848,2290,1510,2293,2296,2297,2299],{},"To read a config as one of your own types, conform it to ",[226,2280,2281],{},"ConfigValue",". A config value arrives as the string the server served, and ",[226,2284,2285],{},"configValueKind"," decides which configs the type can be read from — ",[226,2288,2289],{},".boolean",[226,2291,2292],{},".string",[226,2294,2295],{},".number",". Returning ",[226,2298,1549],{}," from the initializer evaluates the config to the caller's default value:",[310,2301,2304],{"className":312,"code":2302,"filename":2303,"language":157,"meta":315,"style":315},"import ConfigDirector\n\nextension Locale: ConfigValue {\n    public static var configValueKind: ConfigValueKind { .string }\n\n    public init?(configValue: String) {\n        self.init(identifier: configValue)\n    }\n}\n\nlet locale = client.value(for: \"default-locale\", default: Locale(identifier: \"en_US\"))\n","Locale+ConfigValue.swift",[226,2305,2306,2312,2316,2330,2351,2355,2375,2397,2401,2405,2409],{"__ignoreMap":315},[319,2307,2308,2310],{"class":321,"line":322},[319,2309,326],{"class":325},[319,2311,330],{"class":329},[319,2313,2314],{"class":321,"line":333},[319,2315,344],{"emptyLinePlaceholder":32},[319,2317,2318,2320,2323,2325,2328],{"class":321,"line":341},[319,2319,572],{"class":354},[319,2321,2322],{"class":329}," Locale",[319,2324,308],{"class":367},[319,2326,2327],{"class":329}," ConfigValue ",[319,2329,373],{"class":367},[319,2331,2332,2335,2338,2340,2343,2346,2349],{"class":321,"line":347},[319,2333,2334],{"class":385},"    public",[319,2336,2337],{"class":354}," static",[319,2339,389],{"class":385},[319,2341,2342],{"class":392}," configValueKind: ConfigValueKind ",[319,2344,2345],{"class":367},"{",[319,2347,2348],{"class":392}," .string ",[319,2350,561],{"class":367},[319,2352,2353],{"class":321,"line":358},[319,2354,344],{"emptyLinePlaceholder":32},[319,2356,2357,2359,2362,2364,2367,2369,2371,2373],{"class":321,"line":376},[319,2358,2334],{"class":385},[319,2360,2361],{"class":354}," init?",[319,2363,409],{"class":367},[319,2365,2366],{"class":942},"configValue",[319,2368,946],{"class":392},[319,2370,950],{"class":949},[319,2372,968],{"class":367},[319,2374,459],{"class":367},[319,2376,2377,2380,2382,2385,2387,2390,2392,2395],{"class":321,"line":431},[319,2378,2379],{"class":1753},"        self",[319,2381,508],{"class":392},[319,2383,2384],{"class":354},"init",[319,2386,409],{"class":367},[319,2388,2389],{"class":405},"identifier",[319,2391,308],{"class":367},[319,2393,2394],{"class":392}," configValue",[319,2396,428],{"class":367},[319,2398,2399],{"class":321,"line":436},[319,2400,555],{"class":367},[319,2402,2403],{"class":321,"line":453},[319,2404,561],{"class":367},[319,2406,2407],{"class":321,"line":462},[319,2408,344],{"emptyLinePlaceholder":32},[319,2410,2411,2413,2416,2418,2420,2422,2424,2426,2428,2430,2433,2435,2437,2439,2441,2443,2445,2447,2449,2451,2454,2456],{"class":321,"line":471},[319,2412,657],{"class":385},[319,2414,2415],{"class":392}," locale ",[319,2417,396],{"class":350},[319,2419,2117],{"class":392},[319,2421,1609],{"class":1753},[319,2423,409],{"class":367},[319,2425,1300],{"class":405},[319,2427,308],{"class":367},[319,2429,418],{"class":417},[319,2431,2432],{"class":421},"default-locale",[319,2434,425],{"class":417},[319,2436,848],{"class":392},[319,2438,1963],{"class":405},[319,2440,308],{"class":367},[319,2442,2322],{"class":405},[319,2444,409],{"class":367},[319,2446,2389],{"class":405},[319,2448,308],{"class":367},[319,2450,418],{"class":417},[319,2452,2453],{"class":421},"en_US",[319,2455,425],{"class":417},[319,2457,537],{"class":367},[610,2459,2461],{"id":2460},"reading-configs-in-swiftui","Reading configs in SwiftUI",[168,2463,2464,2466,2467,2469],{},[226,2465,1562],{}," is synchronous and makes no network calls, so it is safe to call directly from a ",[226,2468,235],{},". That gives you the current value, but the view will not re-render on its own when the value changes.",[168,2471,2472,2473,2476,2477,2479,2480,2483],{},"To have the view follow a config, drive a ",[226,2474,2475],{},"@State"," from ",[226,2478,1566],{}," inside a ",[226,2481,2482],{},".task",". The stream yields the current value immediately, so there is no frame where the view shows something other than the default before the first value arrives:",[310,2485,2488],{"className":312,"code":2486,"filename":2487,"language":157,"meta":315,"style":315},"import ConfigDirector\nimport SwiftUI\n\nstruct DarkModeToggle: View {\n    let client: ConfigDirectorClient\n\n    @State private var isOn = false\n\n    var body: some View {\n        Toggle(\"Dark mode\", isOn: $isOn)\n            .task {\n                for await value in client.values(for: \"dark-mode\", default: false) {\n                    isOn = value\n                }\n            }\n    }\n}\n","DarkModeToggle.swift",[226,2489,2490,2496,2502,2506,2520,2527,2531,2548,2552,2564,2589,2598,2639,2649,2653,2658,2662],{"__ignoreMap":315},[319,2491,2492,2494],{"class":321,"line":322},[319,2493,326],{"class":325},[319,2495,330],{"class":329},[319,2497,2498,2500],{"class":321,"line":333},[319,2499,326],{"class":325},[319,2501,338],{"class":329},[319,2503,2504],{"class":321,"line":341},[319,2505,344],{"emptyLinePlaceholder":32},[319,2507,2508,2510,2513,2515,2518],{"class":321,"line":347},[319,2509,361],{"class":354},[319,2511,2512],{"class":329}," DarkModeToggle",[319,2514,308],{"class":367},[319,2516,2517],{"class":329}," View ",[319,2519,373],{"class":367},[319,2521,2522,2524],{"class":321,"line":358},[319,2523,906],{"class":385},[319,2525,2526],{"class":392}," client: ConfigDirectorClient\n",[319,2528,2529],{"class":321,"line":376},[319,2530,344],{"emptyLinePlaceholder":32},[319,2532,2533,2535,2537,2539,2541,2543,2545],{"class":321,"line":431},[319,2534,379],{"class":350},[319,2536,382],{"class":354},[319,2538,386],{"class":385},[319,2540,389],{"class":385},[319,2542,1793],{"class":392},[319,2544,396],{"class":350},[319,2546,2547],{"class":2040}," false\n",[319,2549,2550],{"class":321,"line":436},[319,2551,344],{"emptyLinePlaceholder":32},[319,2553,2554,2556,2558,2560,2562],{"class":321,"line":453},[319,2555,439],{"class":385},[319,2557,442],{"class":392},[319,2559,445],{"class":385},[319,2561,2517],{"class":392},[319,2563,373],{"class":367},[319,2565,2566,2569,2571,2573,2576,2578,2580,2582,2584,2587],{"class":321,"line":462},[319,2567,2568],{"class":405},"        Toggle",[319,2570,409],{"class":367},[319,2572,425],{"class":417},[319,2574,2575],{"class":421},"Dark mode",[319,2577,425],{"class":417},[319,2579,848],{"class":392},[319,2581,1859],{"class":405},[319,2583,308],{"class":367},[319,2585,2586],{"class":392}," $isOn",[319,2588,428],{"class":367},[319,2590,2591,2594,2596],{"class":321,"line":471},[319,2592,2593],{"class":392},"            .",[319,2595,492],{"class":405},[319,2597,459],{"class":367},[319,2599,2600,2603,2605,2608,2610,2612,2614,2616,2618,2620,2622,2625,2627,2629,2631,2633,2635,2637],{"class":321,"line":487},[319,2601,2602],{"class":325},"                for",[319,2604,1303],{"class":325},[319,2606,2607],{"class":392}," value ",[319,2609,1309],{"class":325},[319,2611,2117],{"class":392},[319,2613,2219],{"class":1753},[319,2615,409],{"class":367},[319,2617,1300],{"class":405},[319,2619,308],{"class":367},[319,2621,418],{"class":417},[319,2623,2624],{"class":421},"dark-mode",[319,2626,425],{"class":417},[319,2628,848],{"class":392},[319,2630,1963],{"class":405},[319,2632,308],{"class":367},[319,2634,2041],{"class":2040},[319,2636,968],{"class":367},[319,2638,459],{"class":367},[319,2640,2641,2644,2646],{"class":321,"line":497},[319,2642,2643],{"class":392},"                    isOn ",[319,2645,396],{"class":350},[319,2647,2648],{"class":392}," value\n",[319,2650,2651],{"class":321,"line":540},[319,2652,543],{"class":367},[319,2654,2655],{"class":321,"line":546},[319,2656,2657],{"class":367},"            }\n",[319,2659,2660],{"class":321,"line":552},[319,2661,555],{"class":367},[319,2663,2664],{"class":321,"line":558},[319,2665,561],{"class":367},[276,2667,2668,2670,2671,2674],{},[226,2669,2482],{}," cancels its work when the view disappears and starts it again when the view returns, which ends and re-subscribes the stream for you. Use ",[226,2672,2673],{},".task(id:)"," when the config key or the default value can change, so the stream is replaced when they do.",[163,2676,2678],{"id":2677},"update-the-user-context","Update the user context",[251,2680],{"name":2681},"sdks\u002Fswift\u002Fuser-context",[276,2683,2684,2685,2688,2689,2692],{},"In client SDKs (browser and mobile), updating the user context re-establishes a new connection to ConfigDirector servers with the new context. While the new connection is in flight, config values will continue to evaluate to the currently cached values from the prior user context.",[2686,2687],"br",{},"\nAwaiting ",[226,2690,2691],{},"updateContext"," will wait until the new config values are downloaded or the connection times out. In the case of a timeout, the client will continue to attempt to connect with the new context in the background.",[168,2694,2695,2696,2698],{},"Traits are written as ordinary Swift literals. Strings, integers, doubles, booleans, arrays, dictionaries and ",[226,2697,1549],{}," are all accepted:",[310,2700,2702],{"className":312,"code":2701,"filename":1936,"language":157,"meta":315,"style":315},"await client.updateContext(\n    ConfigDirectorContext(\n        id: \"user-123\",\n        name: \"Ada Lovelace\",\n        traits: [\n            \"plan\": \"pro\",\n            \"seats\": 12,\n            \"beta\": true,\n            \"regions\": [\"us-east\", \"eu-west\"],\n        ]\n    )\n)\n",[226,2703,2704,2715,2722,2737,2753,2763,2784,2800,2816,2849,2854,2858],{"__ignoreMap":315},[319,2705,2706,2709,2711,2713],{"class":321,"line":322},[319,2707,2708],{"class":325},"await",[319,2710,2117],{"class":392},[319,2712,2691],{"class":405},[319,2714,668],{"class":367},[319,2716,2717,2720],{"class":321,"line":333},[319,2718,2719],{"class":405},"    ConfigDirectorContext",[319,2721,668],{"class":367},[319,2723,2724,2727,2729,2731,2733,2735],{"class":321,"line":341},[319,2725,2726],{"class":405},"        id",[319,2728,308],{"class":367},[319,2730,418],{"class":417},[319,2732,532],{"class":421},[319,2734,425],{"class":417},[319,2736,684],{"class":392},[319,2738,2739,2742,2744,2746,2749,2751],{"class":321,"line":347},[319,2740,2741],{"class":405},"        name",[319,2743,308],{"class":367},[319,2745,418],{"class":417},[319,2747,2748],{"class":421},"Ada Lovelace",[319,2750,425],{"class":417},[319,2752,684],{"class":392},[319,2754,2755,2758,2760],{"class":321,"line":358},[319,2756,2757],{"class":405},"        traits",[319,2759,308],{"class":367},[319,2761,2762],{"class":392}," [\n",[319,2764,2765,2768,2771,2773,2775,2777,2780,2782],{"class":321,"line":376},[319,2766,2767],{"class":417},"            \"",[319,2769,2770],{"class":421},"plan",[319,2772,425],{"class":417},[319,2774,308],{"class":350},[319,2776,418],{"class":417},[319,2778,2779],{"class":421},"pro",[319,2781,425],{"class":417},[319,2783,684],{"class":392},[319,2785,2786,2788,2791,2793,2795,2798],{"class":321,"line":431},[319,2787,2767],{"class":417},[319,2789,2790],{"class":421},"seats",[319,2792,425],{"class":417},[319,2794,308],{"class":350},[319,2796,2797],{"class":1248}," 12",[319,2799,684],{"class":392},[319,2801,2802,2804,2807,2809,2811,2814],{"class":321,"line":436},[319,2803,2767],{"class":417},[319,2805,2806],{"class":421},"beta",[319,2808,425],{"class":417},[319,2810,308],{"class":350},[319,2812,2813],{"class":2040}," true",[319,2815,684],{"class":392},[319,2817,2818,2820,2823,2825,2827,2830,2832,2835,2837,2839,2841,2844,2846],{"class":321,"line":453},[319,2819,2767],{"class":417},[319,2821,2822],{"class":421},"regions",[319,2824,425],{"class":417},[319,2826,308],{"class":350},[319,2828,2829],{"class":392}," [",[319,2831,425],{"class":417},[319,2833,2834],{"class":421},"us-east",[319,2836,425],{"class":417},[319,2838,848],{"class":392},[319,2840,425],{"class":417},[319,2842,2843],{"class":421},"eu-west",[319,2845,425],{"class":417},[319,2847,2848],{"class":392},"],\n",[319,2850,2851],{"class":321,"line":462},[319,2852,2853],{"class":392},"        ]\n",[319,2855,2856],{"class":321,"line":471},[319,2857,749],{"class":367},[319,2859,2860],{"class":321,"line":487},[319,2861,428],{"class":367},[168,2863,2864,2865,2868,2869,2871,2872,2874],{},"For a signed-out user, set ",[226,2866,2867],{},"isAnonymous"," to ",[226,2870,1166],{},". The values are still used to evaluate targeting rules, but the context is not persisted and does not appear in the dashboard. Leaving ",[226,2873,525],{}," unset lets the SDK generate a random identifier for it — note that this value segments users in percentage rollouts, so changing it can move a user into a different percentile.",[163,2876,2878],{"id":2877},"other-useful-client-features","Other useful client features",[168,2880,2881],{},"The client provides additional properties and methods.",[610,2883,2884],{"id":515},[226,2885,515],{},[168,2887,2888,2889,2891,2892,2894,2895,2897,2898,2900],{},"Returns the current user context (which may be ",[226,2890,1549],{},"). When calling ",[226,2893,2691],{},", the ",[226,2896,515],{}," is not immediately updated. The ",[226,2899,515],{}," is updated after the new connection for the new context succeeds (or times out and goes on retry).",[610,2902,2904],{"id":2903},"isready",[226,2905,300],{},[168,2907,2908,2909,2911,2912,2914,2915,2917,2918,2920,2921,2923,2924,2926,2927,2929,2930,2932],{},"Returns a ",[226,2910,1810],{}," indicating if the client has been successfully initialized and is ready to evaluate configs for the given user context. It is initially ",[226,2913,1151],{}," and becomes ",[226,2916,1166],{}," after ",[226,2919,296],{}," succeeds.\nUpon calling ",[226,2922,2691],{}," it becomes ",[226,2925,1151],{}," again and it is set to ",[226,2928,1166],{}," once ",[226,2931,2691],{}," succeeds.",[610,2934,2936],{"id":2935},"isinitializing",[226,2937,2938],{},"isInitializing",[168,2940,2908,2941,2943,2944,2946,2947,2917,2949,2951,2952,2954],{},[226,2942,1810],{}," indicating whether the client is currently initializing. It is ",[226,2945,1151],{}," on creation, ",[226,2948,1166],{},[226,2950,296],{}," is called, and ",[226,2953,1151],{}," again once initialization completes. This is useful to show a loading state instead of transitioning from the in-code default value to the evaluated value on a slow connection.",[610,2956,2958,859,2960],{"id":2957},"pausenetwork-and-resumenetwork",[226,2959,1155],{},[226,2961,1158],{},[168,2963,2964,2966,2967,2969,2970,1069,2972,508],{},[226,2965,1155],{}," releases the network connection without discarding config state, event streams, or watch streams, and ",[226,2968,1158],{}," re-establishes it using the last context given to ",[226,2971,296],{},[226,2973,2691],{},[168,2975,2976,2977,2868,2979,2981],{},"The client already does this on its own while the app is backgrounded, so these are only needed if you set ",[226,2978,1143],{},[226,2980,1151],{}," in order to manage the connection yourself.",[610,2983,2985],{"id":2984},"close",[226,2986,2987],{},"close()",[168,2989,2990],{},"Closes the connection, every watch stream, and every event stream, and reports whatever telemetry is left. The client cannot be used afterwards.",[168,2992,2993,2994,2996],{},"The client closes itself when it is released, so calling ",[226,2995,2987],{}," is only necessary to shut it down while a reference to it is still held.",[2998,2999,3000],"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 .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--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 .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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 .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 .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 .s95qv, html code.shiki .s95qv{--shiki-light:#6182B8;--shiki-light-font-style:italic;--shiki-default:#6F42C1;--shiki-default-font-style:inherit;--shiki-dark:#B392F0;--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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sfo-9, html code.shiki .sfo-9{--shiki-light:#90A4AE;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .syTEX, html code.shiki .syTEX{--shiki-light:#FF5370;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":315,"searchDepth":333,"depth":333,"links":3002},[3003,3004,3005,3009,3014,3015],{"id":165,"depth":333,"text":166},{"id":239,"depth":333,"text":240},{"id":256,"depth":333,"text":257,"children":3006},[3007,3008],{"id":612,"depth":341,"text":613},{"id":1271,"depth":341,"text":1272},{"id":1899,"depth":333,"text":1900,"children":3010},[3011,3012,3013],{"id":2046,"depth":341,"text":2047},{"id":2274,"depth":341,"text":2275},{"id":2460,"depth":341,"text":2461},{"id":2677,"depth":333,"text":2678},{"id":2877,"depth":333,"text":2878,"children":3016},[3017,3018,3019,3020,3022],{"id":515,"depth":341,"text":515},{"id":2903,"depth":341,"text":300},{"id":2935,"depth":341,"text":2938},{"id":2957,"depth":341,"text":3021},"pauseNetwork() and resumeNetwork()",{"id":2984,"depth":341,"text":2987},"md",null,{},{"title":83,"icon":86},{"title":150,"description":315},"Qc-YkDHftsimqmZg7vvu9JJpFwGJ2XQiqUZlj_ZJu-E",[3030,3031],{"title":78,"path":79,"stem":80,"description":315,"icon":81,"children":-1},{"title":88,"path":89,"stem":90,"description":315,"icon":91,"children":-1},{"id":3033,"title":3034,"body":3035,"description":3212,"extension":3023,"links":3024,"meta":3213,"navigation":6,"path":3214,"seo":3215,"stem":3216,"__hash__":3217},"docs\u002F_partials\u002Fsdks\u002Fswift\u002Finstall.md","Install",{"type":152,"value":3036,"toc":3210},[3037,3045,3056,3062,3207],[168,3038,3039,3040,3044],{},"In Xcode, go to ",[3041,3042,3043],"strong",{},"File → Add Package Dependencies…"," and enter the package URL:",[310,3046,3050],{"className":3047,"code":3048,"language":3049,"meta":315,"style":315},"language-txt shiki shiki-themes material-theme-lighter github-light github-dark","https:\u002F\u002Fgithub.com\u002FConfigDirector\u002Fswift-sdk\n","txt",[226,3051,3052],{"__ignoreMap":315},[319,3053,3054],{"class":321,"line":322},[319,3055,3048],{},[168,3057,3058,3059,308],{},"To add it to a Swift package instead, declare it in ",[226,3060,3061],{},"Package.swift",[310,3063,3065],{"className":312,"code":3064,"filename":3061,"language":157,"meta":315,"style":315},"dependencies: [\n    .package(url: \"https:\u002F\u002Fgithub.com\u002FConfigDirector\u002Fswift-sdk\", from: \"1.1.0\"),\n],\ntargets: [\n    .target(\n        name: \"YourTarget\",\n        dependencies: [.product(name: \"ConfigDirector\", package: \"swift-sdk\")]\n    ),\n]\n",[226,3066,3067,3076,3115,3119,3128,3137,3152,3196,3203],{"__ignoreMap":315},[319,3068,3069,3072,3074],{"class":321,"line":322},[319,3070,3071],{"class":392},"dependencies",[319,3073,308],{"class":350},[319,3075,2762],{"class":392},[319,3077,3078,3081,3084,3086,3089,3091,3093,3095,3097,3099,3102,3104,3106,3109,3111,3113],{"class":321,"line":333},[319,3079,3080],{"class":392},"    .",[319,3082,3083],{"class":405},"package",[319,3085,409],{"class":367},[319,3087,3088],{"class":405},"url",[319,3090,308],{"class":367},[319,3092,418],{"class":417},[319,3094,247],{"class":421},[319,3096,425],{"class":417},[319,3098,848],{"class":392},[319,3100,3101],{"class":405},"from",[319,3103,308],{"class":367},[319,3105,418],{"class":417},[319,3107,3108],{"class":421},"1.1.0",[319,3110,425],{"class":417},[319,3112,968],{"class":367},[319,3114,684],{"class":392},[319,3116,3117],{"class":321,"line":341},[319,3118,2848],{"class":392},[319,3120,3121,3124,3126],{"class":321,"line":347},[319,3122,3123],{"class":392},"targets",[319,3125,308],{"class":350},[319,3127,2762],{"class":392},[319,3129,3130,3132,3135],{"class":321,"line":358},[319,3131,3080],{"class":392},[319,3133,3134],{"class":405},"target",[319,3136,668],{"class":367},[319,3138,3139,3141,3143,3145,3148,3150],{"class":321,"line":376},[319,3140,2741],{"class":405},[319,3142,308],{"class":367},[319,3144,418],{"class":417},[319,3146,3147],{"class":421},"YourTarget",[319,3149,425],{"class":417},[319,3151,684],{"class":392},[319,3153,3154,3157,3159,3162,3165,3167,3170,3172,3174,3177,3179,3181,3183,3185,3187,3189,3191,3193],{"class":321,"line":431},[319,3155,3156],{"class":405},"        dependencies",[319,3158,308],{"class":367},[319,3160,3161],{"class":392}," [.",[319,3163,3164],{"class":405},"product",[319,3166,409],{"class":367},[319,3168,3169],{"class":405},"name",[319,3171,308],{"class":367},[319,3173,418],{"class":417},[319,3175,3176],{"class":421},"ConfigDirector",[319,3178,425],{"class":417},[319,3180,848],{"class":392},[319,3182,3083],{"class":405},[319,3184,308],{"class":367},[319,3186,418],{"class":417},[319,3188,161],{"class":421},[319,3190,425],{"class":417},[319,3192,968],{"class":367},[319,3194,3195],{"class":392},"]\n",[319,3197,3198,3201],{"class":321,"line":436},[319,3199,3200],{"class":367},"    )",[319,3202,684],{"class":392},[319,3204,3205],{"class":321,"line":453},[319,3206,3195],{"class":392},[2998,3208,3209],{},"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 .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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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}",{"title":315,"searchDepth":333,"depth":333,"links":3211},[],"In Xcode, go to File → Add Package Dependencies… and enter the package URL:",{},"\u002F_partials\u002Fsdks\u002Fswift\u002Finstall",{"description":3212},"_partials\u002Fsdks\u002Fswift\u002Finstall","WL_yOUBPr0fEnLLkkcyTva3_7EPbQUoV8V5IDFA0jAg",{"id":3219,"title":3220,"body":3221,"description":315,"extension":3023,"links":3024,"meta":3306,"navigation":6,"path":3307,"seo":3308,"stem":3309,"__hash__":3310},"docs\u002F_partials\u002Fsdks\u002Fswift\u002Fconfigure.md","Configure",{"type":152,"value":3222,"toc":3304},[3223,3298,3301],[310,3224,3226],{"className":312,"code":3225,"filename":650,"language":157,"meta":315,"style":315},"import ConfigDirector\n\n\u002F\u002F Creating the client makes no network calls. It throws only when the SDK key is\n\u002F\u002F blank or a custom base URL is invalid.\nlet client = try ConfigDirectorClient(clientSDKKey: \"YOUR-CLIENT-SDK-KEY\")\n\n\u002F\u002F Connects and waits until config values are received, or until it times out.\n\u002F\u002F After a timeout the client keeps trying to connect in the background.\nawait client.initialize()\n",[226,3227,3228,3234,3238,3243,3248,3274,3278,3283,3288],{"__ignoreMap":315},[319,3229,3230,3232],{"class":321,"line":322},[319,3231,326],{"class":325},[319,3233,330],{"class":329},[319,3235,3236],{"class":321,"line":333},[319,3237,344],{"emptyLinePlaceholder":32},[319,3239,3240],{"class":321,"line":341},[319,3241,3242],{"class":900},"\u002F\u002F Creating the client makes no network calls. It throws only when the SDK key is\n",[319,3244,3245],{"class":321,"line":347},[319,3246,3247],{"class":900},"\u002F\u002F blank or a custom base URL is invalid.\n",[319,3249,3250,3252,3254,3256,3258,3260,3262,3264,3266,3268,3270,3272],{"class":321,"line":358},[319,3251,657],{"class":385},[319,3253,393],{"class":392},[319,3255,396],{"class":350},[319,3257,399],{"class":325},[319,3259,406],{"class":405},[319,3261,409],{"class":367},[319,3263,412],{"class":405},[319,3265,308],{"class":367},[319,3267,418],{"class":417},[319,3269,422],{"class":421},[319,3271,425],{"class":417},[319,3273,428],{"class":367},[319,3275,3276],{"class":321,"line":376},[319,3277,344],{"emptyLinePlaceholder":32},[319,3279,3280],{"class":321,"line":431},[319,3281,3282],{"class":900},"\u002F\u002F Connects and waits until config values are received, or until it times out.\n",[319,3284,3285],{"class":321,"line":436},[319,3286,3287],{"class":900},"\u002F\u002F After a timeout the client keeps trying to connect in the background.\n",[319,3289,3290,3292,3294,3296],{"class":321,"line":453},[319,3291,2708],{"class":325},[319,3293,2117],{"class":392},[319,3295,296],{"class":405},[319,3297,468],{"class":367},[168,3299,3300],{},"The client is thread safe. Create one and share it for the lifetime of the app.",[2998,3302,3303],{},"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 .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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":315,"searchDepth":333,"depth":333,"links":3305},[],{},"\u002F_partials\u002Fsdks\u002Fswift\u002Fconfigure",{"description":315},"_partials\u002Fsdks\u002Fswift\u002Fconfigure","4cc34cb2Zn8iiXMek1lprjRmSCaaqJxriFegCER1dsk",{"id":3312,"title":3313,"body":3314,"description":315,"extension":3023,"links":3024,"meta":3450,"navigation":6,"path":3451,"seo":3452,"stem":3453,"__hash__":3454},"docs\u002F_partials\u002Fsdks\u002Fswift\u002Fsimple-usage.md","Simple Usage",{"type":152,"value":3315,"toc":3448},[3316,3445],[310,3317,3319],{"className":312,"code":3318,"filename":1936,"language":157,"meta":315,"style":315},"\u002F\u002F Retrieve the current value. The default value decides the type the config\n\u002F\u002F is read as, and is returned until the client is ready.\nlet darkMode = client.value(for: \"my-config-key\", default: false)\n\n\u002F\u002F Subscribe to value updates. The stream yields the current value right away\n\u002F\u002F and then every time the evaluated value changes.\nfor await darkMode in client.values(for: \"my-config-key\", default: false) {\n    print(\"Value updated: \\(darkMode)\")\n}\n",[226,3320,3321,3326,3331,3367,3371,3376,3381,3419,3441],{"__ignoreMap":315},[319,3322,3323],{"class":321,"line":322},[319,3324,3325],{"class":900},"\u002F\u002F Retrieve the current value. The default value decides the type the config\n",[319,3327,3328],{"class":321,"line":333},[319,3329,3330],{"class":900},"\u002F\u002F is read as, and is returned until the client is ready.\n",[319,3332,3333,3335,3338,3340,3342,3344,3346,3348,3350,3352,3355,3357,3359,3361,3363,3365],{"class":321,"line":341},[319,3334,657],{"class":385},[319,3336,3337],{"class":392}," darkMode ",[319,3339,396],{"class":350},[319,3341,2117],{"class":392},[319,3343,1609],{"class":1753},[319,3345,409],{"class":367},[319,3347,1300],{"class":405},[319,3349,308],{"class":367},[319,3351,418],{"class":417},[319,3353,3354],{"class":421},"my-config-key",[319,3356,425],{"class":417},[319,3358,848],{"class":392},[319,3360,1963],{"class":405},[319,3362,308],{"class":367},[319,3364,2041],{"class":2040},[319,3366,428],{"class":367},[319,3368,3369],{"class":321,"line":347},[319,3370,344],{"emptyLinePlaceholder":32},[319,3372,3373],{"class":321,"line":358},[319,3374,3375],{"class":900},"\u002F\u002F Subscribe to value updates. The stream yields the current value right away\n",[319,3377,3378],{"class":321,"line":376},[319,3379,3380],{"class":900},"\u002F\u002F and then every time the evaluated value changes.\n",[319,3382,3383,3385,3387,3389,3391,3393,3395,3397,3399,3401,3403,3405,3407,3409,3411,3413,3415,3417],{"class":321,"line":431},[319,3384,1300],{"class":325},[319,3386,1303],{"class":325},[319,3388,3337],{"class":392},[319,3390,1309],{"class":325},[319,3392,2117],{"class":392},[319,3394,2219],{"class":1753},[319,3396,409],{"class":367},[319,3398,1300],{"class":405},[319,3400,308],{"class":367},[319,3402,418],{"class":417},[319,3404,3354],{"class":421},[319,3406,425],{"class":417},[319,3408,848],{"class":392},[319,3410,1963],{"class":405},[319,3412,308],{"class":367},[319,3414,2041],{"class":2040},[319,3416,968],{"class":367},[319,3418,459],{"class":367},[319,3420,3421,3423,3425,3427,3430,3432,3435,3437,3439],{"class":321,"line":436},[319,3422,1722],{"class":405},[319,3424,409],{"class":367},[319,3426,425],{"class":417},[319,3428,3429],{"class":421},"Value updated: ",[319,3431,1362],{"class":417},[319,3433,3434],{"class":1365},"darkMode",[319,3436,968],{"class":417},[319,3438,425],{"class":417},[319,3440,428],{"class":367},[319,3442,3443],{"class":321,"line":453},[319,3444,561],{"class":367},[2998,3446,3447],{},"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 .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}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 .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .syTEX, html code.shiki .syTEX{--shiki-light:#FF5370;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .sfo-9, html code.shiki .sfo-9{--shiki-light:#90A4AE;--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":315,"searchDepth":333,"depth":333,"links":3449},[],{},"\u002F_partials\u002Fsdks\u002Fswift\u002Fsimple-usage",{"description":315},"_partials\u002Fsdks\u002Fswift\u002Fsimple-usage","Ilica6nB78G2yq_92OZfEBhhQ3nKIqKxbD36O69ZSpE",{"id":3456,"title":3457,"body":3458,"description":3462,"extension":3023,"links":3024,"meta":3735,"navigation":6,"path":3736,"seo":3737,"stem":3738,"__hash__":3739},"docs\u002F_partials\u002Fsdks\u002Fswift\u002Fuser-context.md","User Context",{"type":152,"value":3459,"toc":3733},[3460,3463,3604,3609,3730],[168,3461,3462],{},"A user context can be provided when initializing the client:",[310,3464,3466],{"className":312,"code":3465,"filename":650,"language":157,"meta":315,"style":315},"import ConfigDirector\n\nlet client = try ConfigDirectorClient(clientSDKKey: \"YOUR-CLIENT-SDK-KEY\")\n\nawait client.initialize(\n    context: ConfigDirectorContext(\n        id: \"12345\",\n        name: \"Example User\",\n        traits: [\n            \u002F\u002F Any arbitrary traits which can be referenced in targeting rules\n            \"region\": \"North America\",\n        ]\n    )\n)\n",[226,3467,3468,3474,3478,3504,3508,3518,3529,3544,3559,3567,3572,3592,3596,3600],{"__ignoreMap":315},[319,3469,3470,3472],{"class":321,"line":322},[319,3471,326],{"class":325},[319,3473,330],{"class":329},[319,3475,3476],{"class":321,"line":333},[319,3477,344],{"emptyLinePlaceholder":32},[319,3479,3480,3482,3484,3486,3488,3490,3492,3494,3496,3498,3500,3502],{"class":321,"line":341},[319,3481,657],{"class":385},[319,3483,393],{"class":392},[319,3485,396],{"class":350},[319,3487,399],{"class":325},[319,3489,406],{"class":405},[319,3491,409],{"class":367},[319,3493,412],{"class":405},[319,3495,308],{"class":367},[319,3497,418],{"class":417},[319,3499,422],{"class":421},[319,3501,425],{"class":417},[319,3503,428],{"class":367},[319,3505,3506],{"class":321,"line":347},[319,3507,344],{"emptyLinePlaceholder":32},[319,3509,3510,3512,3514,3516],{"class":321,"line":358},[319,3511,2708],{"class":325},[319,3513,2117],{"class":392},[319,3515,296],{"class":405},[319,3517,668],{"class":367},[319,3519,3520,3523,3525,3527],{"class":321,"line":376},[319,3521,3522],{"class":405},"    context",[319,3524,308],{"class":367},[319,3526,520],{"class":405},[319,3528,668],{"class":367},[319,3530,3531,3533,3535,3537,3540,3542],{"class":321,"line":431},[319,3532,2726],{"class":405},[319,3534,308],{"class":367},[319,3536,418],{"class":417},[319,3538,3539],{"class":421},"12345",[319,3541,425],{"class":417},[319,3543,684],{"class":392},[319,3545,3546,3548,3550,3552,3555,3557],{"class":321,"line":436},[319,3547,2741],{"class":405},[319,3549,308],{"class":367},[319,3551,418],{"class":417},[319,3553,3554],{"class":421},"Example User",[319,3556,425],{"class":417},[319,3558,684],{"class":392},[319,3560,3561,3563,3565],{"class":321,"line":453},[319,3562,2757],{"class":405},[319,3564,308],{"class":367},[319,3566,2762],{"class":392},[319,3568,3569],{"class":321,"line":462},[319,3570,3571],{"class":900},"            \u002F\u002F Any arbitrary traits which can be referenced in targeting rules\n",[319,3573,3574,3576,3579,3581,3583,3585,3588,3590],{"class":321,"line":471},[319,3575,2767],{"class":417},[319,3577,3578],{"class":421},"region",[319,3580,425],{"class":417},[319,3582,308],{"class":350},[319,3584,418],{"class":417},[319,3586,3587],{"class":421},"North America",[319,3589,425],{"class":417},[319,3591,684],{"class":392},[319,3593,3594],{"class":321,"line":487},[319,3595,2853],{"class":392},[319,3597,3598],{"class":321,"line":497},[319,3599,749],{"class":367},[319,3601,3602],{"class":321,"line":540},[319,3603,428],{"class":367},[168,3605,3606,3607,308],{},"The user context can also be updated via ",[226,3608,2691],{},[310,3610,3612],{"className":312,"code":3611,"filename":1936,"language":157,"meta":315,"style":315},"await client.updateContext(\n    ConfigDirectorContext(\n        id: \"654321\",\n        name: \"Another User\",\n        traits: [\"region\": \"Australia\"]\n    )\n)\n\n\u002F\u002F Update it to an anonymous context when a user signs out. Leaving `id` unset\n\u002F\u002F lets the SDK generate a random identifier for it.\nawait client.updateContext(ConfigDirectorContext(isAnonymous: true))\n",[226,3613,3614,3624,3630,3645,3660,3685,3689,3693,3697,3702,3707],{"__ignoreMap":315},[319,3615,3616,3618,3620,3622],{"class":321,"line":322},[319,3617,2708],{"class":325},[319,3619,2117],{"class":392},[319,3621,2691],{"class":405},[319,3623,668],{"class":367},[319,3625,3626,3628],{"class":321,"line":333},[319,3627,2719],{"class":405},[319,3629,668],{"class":367},[319,3631,3632,3634,3636,3638,3641,3643],{"class":321,"line":341},[319,3633,2726],{"class":405},[319,3635,308],{"class":367},[319,3637,418],{"class":417},[319,3639,3640],{"class":421},"654321",[319,3642,425],{"class":417},[319,3644,684],{"class":392},[319,3646,3647,3649,3651,3653,3656,3658],{"class":321,"line":347},[319,3648,2741],{"class":405},[319,3650,308],{"class":367},[319,3652,418],{"class":417},[319,3654,3655],{"class":421},"Another User",[319,3657,425],{"class":417},[319,3659,684],{"class":392},[319,3661,3662,3664,3666,3668,3670,3672,3674,3676,3678,3681,3683],{"class":321,"line":358},[319,3663,2757],{"class":405},[319,3665,308],{"class":367},[319,3667,2829],{"class":392},[319,3669,425],{"class":417},[319,3671,3578],{"class":421},[319,3673,425],{"class":417},[319,3675,308],{"class":350},[319,3677,418],{"class":417},[319,3679,3680],{"class":421},"Australia",[319,3682,425],{"class":417},[319,3684,3195],{"class":392},[319,3686,3687],{"class":321,"line":376},[319,3688,749],{"class":367},[319,3690,3691],{"class":321,"line":431},[319,3692,428],{"class":367},[319,3694,3695],{"class":321,"line":436},[319,3696,344],{"emptyLinePlaceholder":32},[319,3698,3699],{"class":321,"line":453},[319,3700,3701],{"class":900},"\u002F\u002F Update it to an anonymous context when a user signs out. Leaving `id` unset\n",[319,3703,3704],{"class":321,"line":462},[319,3705,3706],{"class":900},"\u002F\u002F lets the SDK generate a random identifier for it.\n",[319,3708,3709,3711,3713,3715,3717,3720,3722,3724,3726,3728],{"class":321,"line":471},[319,3710,2708],{"class":325},[319,3712,2117],{"class":392},[319,3714,2691],{"class":405},[319,3716,409],{"class":367},[319,3718,3719],{"class":405},"ConfigDirectorContext",[319,3721,409],{"class":367},[319,3723,2867],{"class":405},[319,3725,308],{"class":367},[319,3727,2813],{"class":2040},[319,3729,537],{"class":367},[2998,3731,3732],{},"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 .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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);}html pre.shiki code .syTEX, html code.shiki .syTEX{--shiki-light:#FF5370;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":315,"searchDepth":333,"depth":333,"links":3734},[],{},"\u002F_partials\u002Fsdks\u002Fswift\u002Fuser-context",{"description":3462},"_partials\u002Fsdks\u002Fswift\u002Fuser-context","bfRGjdZwmZ-f7DXaCq1ZzigC-LGPNHknjlbLPUX6ZSw",1788747970049]