Use configwatcher to react to live configuration changes — the core feature flag pattern.
- Registering typed boolean fields with default values
- Starting the watcher (loads initial snapshot + subscribes to live stream)
- Reacting to changes via the
Changes()channel - No polling — changes arrive instantly via server-push
go run .Then in another terminal, toggle a flag:
decree config set <tenant-id> features.dark_mode false --insecureWatch the output update in real time.
Feature flags loaded:
dark_mode: true
beta_access: false
Watching for changes... (Ctrl+C to stop)
[14:32:05] dark_mode changed: true → false
- configwatcher package — watcher API reference
- Subscribe RPC — underlying gRPC streaming API
- Previous: Quickstart | Next: Live Config →