zenmanage 1.0.0
zenmanage: ^1.0.0 copied to clipboard
Official Dart/Flutter SDK for Zenmanage feature flags with local evaluation. Control feature rollouts, A/B test, and manage configurations without deploying code.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
1.0.0 #
Released on 2026-11-11. First public release.
Added #
- Flag client for Dart and Flutter apps.
Zenmanage.initialize()fetches the rules once, and flags are then evaluated locally withflags().single(),singleOrDefault()andall(). - Flutter bindings for app-wide initialization and widget-level use:
ZenmanageProvider,ZenmanageInitializerandZenmanageFlagBuilder. - Typed value accessors:
asBool(),asString(),asNumber(),asInt(),asDouble(),asJson()andasList(). Calling the "wrong" accessor never throws; each one falls back to a safe zero value, the same as the other Zenmanage SDKs. boolean,string,numberandjsonflags. AMaporListdefault passed tosingle()produces ajsonflag. A flag with a type this release doesn't recognize falls back to your default instead of failing the whole rules payload.- Local rule evaluation with user, organization and account contexts and custom attributes, percentage rollouts, and A/B variants. Rules are evaluated from the lowest
positionto the highest and the first match wins. - Three rule caches:
InMemoryCache(default),SharedPreferencesCache(persists rules on the device) andNullCache. single()falls back to the default you provide, instead of throwing, when the rules can't be loaded (for example an invalid key or no network).- Failed rules fetches are retried: up to 3 attempts with 100ms then 200ms of backoff, the same as the other Zenmanage SDKs. A rejected token (HTTP 401/403) is not retried.
ConfigBuilder.withRequestTimeout(Duration)sets how long a rules request may wait. It defaults to 10 seconds; usage reports are capped at 5 seconds.ConfigBuilder.withLogger(ZenmanageLogger)routes SDK diagnostics (fetch attempts, retries, failures) to your own logging. Nothing is logged by default.zenmanageSdkVersion, the version reported to the API in theX-ZEN-CLIENT-AGENTheader (zenmanage-flutter/<version>).- Typed exceptions:
ConfigurationException,ApiException,FlagNotFoundException,TypeConversionException,RuleEvaluationExceptionandCacheException. - Examples for common use cases, including a runnable Flutter example app in
example/.
Security #
- Environment tokens must be a mobile key (
mob_...) or a client key (cli_...; use this one for Flutter web, which has no mobile key). Server keys (srv_...) are rejected when the configuration is created: a server key bundled into an app can be extracted by anyone. - All API communication uses HTTPS.