open-feature / open-feature/swift-sdk
Add Domains (formerly Named Clients)
- Dominant language
- Swift
- Stars
- 31
- Forks
- 14
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 2
Description
Domains allow logical (late) binding of clients with providers, enabling multiple providers in a single application.
**Specification References:**
- [1.1.3](https://openfeature.dev/specification/sections/flag-evaluation#requirement-113): The API MUST provide a function to bind a given provider to one or more clients using a domain.
- [1.1.6](https://openfeature.dev/specification/sections/flag-evaluation#requirement-116): The API MUST provide a function for creating a client which accepts an optional domain parameter.
- [3.2.2.3](https://openfeature.dev/specification/sections/evaluation-context#conditional-requirement-3223): The API MUST have a method for setting evaluation context for a domain.
- [3.2.2.4](https://openfeature.dev/specification/sections/evaluation-context#conditional-requirement-3224): The API MUST have a mechanism to manage evaluation context for an associated domain.
**Implementation Notes:**
- `OpenFeatureAPI.shared.setProvider(domain:provider:)` - Set provider for a domain
- `OpenFeatureAPI.shared.setProviderAndWait(domain:provider:)` - Set provider for a domain
- `OpenFeatureAPI.shared.getClient(domain:)` - Get client bound to domain
- `OpenFeatureAPI.shared.setEvaluationContext(domain:context:)` - Set context for a domain
- Client event handlers should only fire for events from associated provider
Contributor guide
Assessment
This issue has not been assessed yet.