Build a shared checklist
This page builds the smallest useful Wispist site: a checklist that persists and updates in every open browser. The site has no build step and no connection configuration.
Declare the collection #
Create wispist.json at the root of the site bundle:
The shared profile lets every viewer read and change the collection. Use it only when that is the intended product behaviour. The two limits lower Wispist's installation defaults for this collection.
Write the page #
Create index.html:
<!doctype html>
Before you go
Before you go
New item
Add
Loading…
Do not add the Wispist client script yourself on Wispdeck. Wispdeck inserts it before the page's own script element, so wispist exists when app.js runs.
Add and render documents #
Create app.js:
const = ;
const = ;
const = ;
const = ;
let = new;
;
add creates a document with a generated ID and returns the complete document envelope. The client supplies the required idempotency key automatically.
Apply safe updates #
Add a delegated change listener:
;
update accepts the observed document, not only its ID. It shallow-merges the new fields locally and sends a replacement conditional on item.revision. A stale revision becomes a typed revision conflict.
Subscribe #
Start the live collection at the end of app.js:
const = ;
subscribe returns immediately. It lists every page, opens a change stream from that list cursor, maintains a document map, and calls render with the initial state and every later state.
Call unsubscribe() when a long-lived page no longer needs the collection. Closing a page closes its EventSource automatically.
Upload and test #
Put the three files at the ZIP root:
checklist.zip
├── index.html
├── app.js
└── wispist.json
Upload the archive as a Wispdeck site draft. In preview, the checklist uses draft data. Publish the release, open the public site in two independent browser windows, and add or check an item in one. The other should update without a refresh.
When a later draft exists, changes made in Draft remain separate. Select Current to see live data in read-only mode. Publishing that draft changes the code and declaration while leaving the public checklist intact.
Where to go next #
- Documents and collections — the envelope, revision, and conditional-mutation model behind
update. - Live updates — what
subscribedoes underneath: snapshot, cursor, Server-Sent Events, reconnect, reset. - wispist.json reference — every declaration field, profile, and limit.