Build guides

Build a live watchlist with the Base76 SDK

A movie watchlist your agent keeps, plus a one-file web page that updates the moment a status changes. Uses the Base76 realtime SDK.

Snippets checked against the live API October 22, 2026
  • Select fields
  • Realtime SDK
  • Collection templates
  • Bulk import

A watchlist is one collection with a status field. Your agent adds movies and moves them along as you watch. The fun part is the page: a single HTML file that shows what you’re watching now and updates the instant anything changes, whether your agent made the change, you did it in the app, or a script did.

The prompt

Start a movie watchlist in Base76: title, poster image, status (want, watching, watched), year, runtime, and my notes. Add Past Lives, Arrival, and Seven Samurai as want.

The schema

FieldTypeNotes
titletextDisplay field
posterfileaccept: ["image/*"]
statusselectwant, watching, watched
yearnumberWhole numbers
runtimedurationPT1H56M
notesmarkdown

A select field rejects anything outside its choices. If the agent tries "status": "seen", the write fails with validation_failed and a fix the agent can act on:

{"path": "status", "message": "Not one of the field's choices.",
 "fix": "Send one of: \"want\", \"watching\", \"watched\". To allow new values, set options.allow_new with define_collection."}

A page that updates itself

Make an API key in the app under Settings > API keys. Give it only the Read scope and limit it to this base. Anyone who can load the page can read the key, so a read-only key on one base is the right size.

<!doctype html>
<meta charset="utf-8">
<title>Watching now</title>
<ul id="now"></ul>
<script type="module">
  import { base } from "https://api.base76.com/sdk/v1.js";

  const db = base("tim/watchlist", { token: "b76_your_read_only_key" });
  const list = document.getElementById("now");

  db.collection("movies")
    .where({ status: "watching" })
    .sort("title")
    .onSnapshot((rows) => {
      list.replaceChildren(...rows.map((movie) => {
        const li = document.createElement("li");
        li.textContent = `${movie.title} (${movie.year})`;
        return li;
      }));
    });
</script>

The callback runs once with every matching movie, then again after each change. Its second argument lists what changed, as add, modify, or remove. Tell your agent “I started Everything Everywhere All at Once” and the title appears in the page; mark it watched and it drops out. If the connection drops, the SDK reconnects and picks up from the last change it saw.

You don’t have to write this page yourself either. Every base publishes its own agent guide at https://api.base76.com/v1/bases/tim/watchlist/llms.txt, with your real field names and sample calls, so an agent that reads it writes code against your actual schema.

A poster wall to share

Collections get pages too. This template groups movies by status and shows them as a gallery of posters:

[{"type": "group_by", "field": "status",
  "layout": {"type": "gallery", "image": "poster",
             "fields": ["year", "runtime"], "sort": "title"}}]

Ask the agent to share the movies collection and the link opens that wall. Each poster links to the movie’s own page under the same share link.

Bring the list you already have

If your list lives in a spreadsheet or a notes app, ask the agent for an import session. It calls import_session and gets back an upload URL that accepts records for one collection, up to a count you set, for up to 24 hours. Here it adds every row as want:

{"collection": "movies", "expect": 500, "ttl": "PT1H",
 "defaults": {"status": "want"}}

Then one line of NDJSON per movie goes to that URL:

curl -s -X POST "$IMPORT_URL" \
  -H 'content-type: application/x-ndjson' \
  --data-binary @movies.ndjson
{"_key": "tt0047478", "title": "Paris, Texas", "year": 1984}

The _key makes reruns safe: send the file twice and the second run reports duplicates instead of adding copies. If the import was a mistake, restore with {"batch": "<session_id>"} removes every record it added.

Limits

  • A live query returns up to 200 rows, 50 by default.
  • Pages can’t sign visitors in. A public page needs a key you’re happy for its readers to have, which is why the example uses a read-only key on one base.
  • The upload URL can only add records to one collection. It can’t read anything, which is what makes it safe to paste into a script.
Base76 is in closed beta.

Join the waitlist and you'll get an email when your account is approved. Beta accounts are free.