{
"path": "/projects/atproto",
"site": "at://did:plc:ofrbh253gwicbkc5nktqepol/site.standard.publication/3mfyq5mpohw25",
"tags": [
"atproto",
"pkgs",
"typescript"
],
"$type": "site.standard.document",
"title": "@ewanc26/atproto",
"description": "AT Protocol service layer extracted from ewancroft.uk — profile fetching, Standard.site documents, Bluesky posts, music/mood status, Tangled repos, and a built-in in-memory cache.",
"publishedAt": "2026-03-06T00:00:00.000Z",
"textContent": "@ewanc26/atproto is the AT Protocol service layer extracted from ewancroft.uk. It handles all communication with the AT Protocol network: resolving identities, fetching profiles and lexicon records, reading Standard.site blog posts and documents, streaming Bluesky posts, and looking up music/mood status — all with a built-in in-memory cache.\n\nPart of the @ewanc26/pkgs monorepo.\n\nInstallation\n\nRequires @atproto/api >= 0.13.0 as a peer dependency.\n\nKey Design\n\nAll functions that previously read PUBLIC_ATPROTO_DID from the SvelteKit environment now accept did: string as their first argument, making the package fully portable outside of SvelteKit.\n\nAn optional fetchFn parameter is accepted throughout for custom fetch implementations (e.g. SvelteKit's server-side fetch).\n\nUsage\n\nProfile\n\nStandard.site Documents & Blog Posts\n\nBluesky Posts\n\nStatus Records\n\nTangled Repos & Links\n\nEngagement (Constellation API)\n\nIdentity Resolution\n\nPagination\n\nMusic Artwork\n\nCaching\n\nAll fetch functions use a shared ATProtoCache instance. TTLs are configured via the exported CACHE_TTL object:\n\n| Key | Default TTL |\n|-----|-------------|\n| PROFILE | 1 hour |\n| SITE_INFO | 2 hours |\n| MUSIC_STATUS | 10 minutes |\n| KIBUN_STATUS | 15 minutes |\n| BLOG_POSTS | 30 minutes |\n| IDENTITY | 24 hours |\n\nYou can import cache directly to clear or inspect entries:\n\nTypes\n\nAll interfaces are exported from the package root:\n\nTech Stack\n\nTypeScript 5.9+. Peer dependency on @atproto/api. Compiled to ESM with tsc.\n\nLicence\n\nAGPL-3.0-only — see the pkgs monorepo.",
"canonicalUrl": "https://docs.ewancroft.uk/projects/atproto"
}