atproto record helpers
JavaScript 99%
Makefile <1%

README.md

tinyrecord #

tinyrecord is a tiny set of helpers for interacting with atproto records.

Construct a repo for an actor, then declare collections by NSID (optionally with a validator). Each collection exposes create, put, get, delete, list, and listAll.

Validators follow Standard Schema, a shared interface implemented by libraries like Zod, Valibot, and ArkType — so you can plug in whichever you prefer (or none).

import { Repo } from "./tinyrecord.js";

const repo = new Repo({ actor: "jakelazaroff.com" });
const follow = repo.collection("com.example.follow");

await follow.create({
  subject: "did:plc:...",
  createdAt: new Date().toISOString(),
});

for await (const record of follow.listAll()) {
  console.log(record.uri.href, record.value);
}

Use repo.collection(nsid).of(actor) to read another user's records.