The Ablo SDK is designed for long-lived presentations that you update repeatedly. Rather than recreating a deck from scratch on every run, you create it once, store the IDs of the resources you care about, and then issue targeted patches on subsequent runs. This keeps your deck’s history intact, avoids unnecessary churn, and is significantly more efficient for large presentations.
The hold-the-ID pattern
ablo.decks.create() returns a DeckResource containing the id of every resource that was created — the deck itself, each slide, and each layer. Store these IDs in your own persistence layer (a database, a config file, an environment variable) on the first run, and use them directly on every subsequent run.
You only need to call decks.create() once per presentation. On every run after that, go straight to the update methods using your stored IDs.
Updating a deck
Use ablo.decks.update() to change deck-level metadata. All fields except id are optional; only the fields you provide are changed.
Available fields:
Updating a slide
Use ablo.slides.update() to change a slide’s metadata or settings.
Available fields:
Updating a layer
Use ablo.layers.update() for field-level patches. This overwrites the entire field you specify, so pass the complete new value.
Available fields:
Typed ops for charts, tables, and text
For chart, table, and text layers, ablo.layers.applyOp() lets you apply a targeted, typed operation instead of replacing the entire payload. The SDK reads the current layer, applies the op with the same reducer the editor uses, and writes the result back — all in one method call.
layers.applyOp() performs a read-modify-write internally, so it requires a readable client. The standard new Decks(apiKey) constructor always provides one. If you ever construct the SDK with a commit-only transport, applyOp will throw a descriptive error.
Reading resources
Before updating, you may need to read the current state of a resource. Every resource type has a retrieve() method, and collections have a list() method.
Deleting resources
Every resource type has a delete() method. Deletions are atomic commits like all other mutations.
decks.delete() removes the deck and all of its slides and layers permanently. There is no undo. Make sure you are operating on the correct ID before calling it.
Full live-update example
The following pattern is typical for a dashboard or report that regenerates on a schedule.