What is Sync?
When a device operates offline, events are captured and queued locally. Once connectivity is restored, the Wede SDK submits these events as a batch to the platform for processing, deduplication and delivery. The sync mechanism ensures that no event is lost, regardless of how long the device was offline or which channel was used for transmission.How it works
- Events are captured and stored locally with an
idempotency_key - When connectivity is restored, the SDK submits a sync batch via
POST /v1/sync/batch - Wede processes each event, checks idempotency keys and deduplicates
- The platform confirms which events were accepted and which were rejected
- Rejected events are returned with a reason - the integrator decides whether to retry
Idempotency
Every event must have a uniqueidempotency_key. This key is used to prevent duplicate processing if the same batch is submitted more than once - for example, if the network drops mid-submission.
The key should be generated on the device before the event is captured, not at submission time.
Batch submission
Checking sync status
Best practices
- Generate
idempotency_keyat event capture time, not at submission - Keep batches under 500 events for optimal performance
- Always check the
rejectedcount and handle rejections - Use
device_idconsistently to correlate events from the same device - Submit batches as soon as connectivity is restored - do not accumulate indefinitely

