Integration Patterns
Choose Auth Mode
Section titled “Choose Auth Mode”| Use case | Auth mode |
|---|---|
| Embedded device telemetry/workflows | SpokeZoneConfig.device(...) |
| User-account driven app workflows | SpokeZoneConfig.user(...) |
Reliability Expectations
Section titled “Reliability Expectations”- SDK retries transport errors,
429, and5xxautomatically. - SDK does not retry non-
4294xxresponses. - Failures are surfaced as
SpokeZoneExceptionwith typed error codes.
Retry Backoff Configuration
Section titled “Retry Backoff Configuration”SpokeZoneConfig exposes separate backoff strategies for HTTP/API traffic and MQTT live-data reconnect:
apiBackoffStrategydefault:15s,30s,60s, then stop.liveDataBackoffStrategydefault:5s,15s,30s,60s,120s,300s, then repeat300s.
If you do not set either field, these defaults are used automatically.
The example below is an optional override for custom retry/backoff behavior:
final config = SpokeZoneConfig.device( deviceAuth: DeviceAuthCallbacks( cpuId: () async => 'cpu-id', uuid: () async => 'uuid', deviceId: () async => 123, initialDeviceToken: () async => 'token', ), apiBackoffStrategy: const FixedDelayBackoffStrategy( delays: [Duration(seconds: 10), Duration(seconds: 30)], ), liveDataBackoffStrategy: const FixedDelayBackoffStrategy( delays: [Duration(seconds: 2), Duration(seconds: 5), Duration(seconds: 15)], repeatLastDelay: true, ),);