@ewanc26/atproto

ewan March 6, 2026
Source

@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.

Part of the @ewanc26/pkgs monorepo.

Installation

Requires @atproto/api >= 0.13.0 as a peer dependency.

Key Design

All 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.

An optional fetchFn parameter is accepted throughout for custom fetch implementations (e.g. SvelteKit's server-side fetch).

Usage

Profile

Standard.site Documents & Blog Posts

Bluesky Posts

Status Records

Tangled Repos & Links

Engagement (Constellation API)

Identity Resolution

Pagination

Music Artwork

Caching

All fetch functions use a shared ATProtoCache instance. TTLs are configured via the exported CACHE_TTL object:

Key Default TTL
PROFILE 1 hour
SITE_INFO 2 hours
MUSIC_STATUS 10 minutes
KIBUN_STATUS 15 minutes
BLOG_POSTS 30 minutes
IDENTITY 24 hours

You can import cache directly to clear or inspect entries:

Types

All interfaces are exported from the package root:

Tech Stack

TypeScript 5.9+. Peer dependency on @atproto/api. Compiled to ESM with tsc.

Licence

AGPL-3.0-only โ€” see the pkgs monorepo.

Discussion in the ATmosphere

Loading comments...