record-resolver

Factory functions that return RecordResolver implementations for verifying remote (strongRef) attestations. Each factory returns a function with the canonical RecordResolver signature, ready to drop into verify.

Installation

bash
npm install @atiproto/record-resolver

Pick a resolver

  • createFetchRecordResolver: calls com.atproto.repo.getRecord on a configurable relay using fetch. Works anywhere HTTPS works. No auth needed for public proof records.
  • createAgentRecordResolver: routes the call through any XRPC-shaped client (@atiproto/agent, @atproto/api, @atproto/xrpc). Use this when auth, retries, or proxying live on the client already.
  • createCachedRecordResolver: same as createFetchRecordResolver with a SimpleStore cache. Proof records are content-addressed, so caching by URI is safe forever.

Quick start

typescript
import { verify } from "@atiproto/atproto-attestation";
import { createCachedRecordResolver } from "@atiproto/record-resolver";
const recordResolver = createCachedRecordResolver({
relay: "https://bsky.network",
});
const result = await verify({
record,
repository: "did:plc:recipient",
fields: ["items", "currency", "status"],
recordResolver,
});

See also