Feed core — overview
@ghostwritr/feed is the keyless, framework-free core that the Next, Astro, and React Router adapters are built on. It fetches your published articles from the content feed and gives you typed Article objects. No API key — the siteId is the read capability. See keyless reads.
Who it’s for
Section titled “Who it’s for”Reach for the core directly when there isn’t an adapter for your stack, or when you want the fetchers with no framework caching wrapped around them.
- Any JS/TS runtime with
fetch+ Web Crypto — Node 20+, Cloudflare Workers, Deno, Bun, and the browser. - Zero dependencies. Nothing to audit, nothing to bundle but the core itself.
- The adapters re-export it.
@ghostwritr/nextand@ghostwritr/astrore-export its types and wrap its fetchers with framework caching, so the shapes you learn here are the shapes you get everywhere.
30-second fetch
Section titled “30-second fetch”-
Install the core.
npm install @ghostwritr/feedpnpm add @ghostwritr/feedyarn add @ghostwritr/feedbun add @ghostwritr/feed -
Fetch your articles with your site ID. That’s the only key.
feed.ts import { fetchArticles, fetchArticle } from "@ghostwritr/feed";// Every published article, newest first.const articles = await fetchArticles({ siteId: process.env.GHOSTWRITR_SITE_ID! });// One article by slug, or null.const post = await fetchArticle({siteId: process.env.GHOSTWRITR_SITE_ID!,slug: "my-first-post",}); -
Render the Markdown. In React, hand
article.markdownto<ArticleContent>; anywhere else, use your own Markdown renderer.
What to reach for next
Section titled “What to reach for next”- The fetchers —
fetchArticles,fetchArticle,toArticle, and theopts.fetchseam. See Fetchers. - Instant updates — verify the signed
feed.updatedwebhook. See Webhook helpers and instant updates. - Errors — the
GhostwritrErrorcode union and the fail-closed contract. See Error handling. - Full surface — every export, typed. See API reference.