Summary
Add a recipe showing how to use objectEvents() with cursor-based pagination to
incrementally sync object changes (new uploads, metadata updates, and deletions)
without re-fetching the full object list on every call.
What the recipe should cover
- Perform an initial full fetch by calling
sdk.objectEvents(nil, limit) (no cursor)
- Persist the cursor after the first page:
{ after: event.updated_at, id: event.id }
from the last event in the returned slice
- On subsequent calls, pass the saved cursor to receive only newer events
- Detect end-of-feed: when the returned slice is shorter than
limit, all events
have been consumed
- Handle both event types:
deleted == false -> upsert the object into local state
deleted == true -> remove it (event.object will be None in this case)
- Show a simple polling loop (e.g. check every 30 seconds) as a practical usage pattern
Proposed location
docs/recipes/sync-object-changes.md
Add to docs/nav.json under Recipes, directly after "List Pinned Objects".
Languages
Rust · Go · Python · JavaScript (Node) · JavaScript (Browser)
Summary
Add a recipe showing how to use
objectEvents()with cursor-based pagination toincrementally sync object changes (new uploads, metadata updates, and deletions)
without re-fetching the full object list on every call.
What the recipe should cover
sdk.objectEvents(nil, limit)(no cursor){ after: event.updated_at, id: event.id }from the last event in the returned slice
limit, all eventshave been consumed
deleted == false-> upsert the object into local statedeleted == true-> remove it (event.objectwill beNonein this case)Proposed location
docs/recipes/sync-object-changes.mdAdd to
docs/nav.jsonunder Recipes, directly after "List Pinned Objects".Languages
Rust · Go · Python · JavaScript (Node) · JavaScript (Browser)