atfield-core
v0.2.0
Published
`atfield-core` provides framework-agnostic AT Protocol data primitives for ATField.
Downloads
1,459
Readme
atfield-core
atfield-core provides framework-agnostic AT Protocol data primitives for ATField.
It contains reusable identity, DID, repository, transport, schema, and provider logic that can be used by endpoint kits, static-site integrations, admin tools, CLIs, or other JavaScript/TypeScript applications.
For a deployable SvelteKit endpoint provider built on top of this package, see atfield-kit.
Install
npm install atfield-coreWhat it provides
Current scope:
- DID-first identity resolution
- handle-to-DID resolution
- DID document fetching and parsing
- PDS endpoint discovery
- AT Protocol repo record reads
- generic XRPC / HTTP transport helpers
- lightweight schema decoding helpers
- provider helpers for supported AT Protocol applications
Supported provider modules:
- Bluesky profile and post helpers
site.standard.publicationandsite.standard.documenthelpers- WhiteWind article helpers
Quick example
import { createCore } from 'atfield-core';
const core = createCore();
const identity = await core.identity.resolveIdentity({
handle: 'example.bsky.social'
});
const profile = await core.providers.bsky.getProfile(identity);
const documents = await core.providers.standardsite.document.list(identity, {
limit: 10
});
const firstDocument = documents.documents[0];
if (firstDocument?.content) {
const markdown = core.providers.standardsite.content.renderMarkdown(firstDocument.content, {
inlineStyle: 'markdown',
mentionProfileBaseUrl: 'https://bsky.app/profile/'
});
console.log(markdown);
}
console.log(identity);
console.log(profile);
console.log(documents.documents[0]);Documentation
Package role
atfield-core intentionally does not provide a web server, UI, admin console, CMS, editor, RSS generator, sitemap generator, or publishing frontend.
License
MIT
