The Astro starter runs as a server (Node adapter), so drafts in the visual editor and the revalidate webhook work. It lists a collection, renders any entry from your schema and counts visits with t.js. Download it from Connect your site → Astro → Starter, with your keys already in .env.
Setup in three steps
- Keys. Copy
.env.exampleto.env(filled in the downloaded starter). - Install.
npm install, thennpm run types(writessrc/manifolio.d.ts). - Run.
npm run devand open http://localhost:4321. In production:npm run build && npm start.
Caching and the webhook
Astro has no data cache of its own. src/lib/manifolio.ts keeps published responses in memory for five minutes; src/pages/api/revalidate.ts verifies the webhook signature and clears that cache. With several servers, purge your CDN there instead.
const client = preview
? createClient({ project, preview }) // drafts, never cached
: createClient({ project, key, fetch: cachedFetch }); // published, cachedA fully static Astro site works too: read in getStaticPaths, remove the adapter and point the webhook at your host's build hook. Drafts then need a separate server route.
Visual editor
src/middleware.ts allows framing by MANIFOLIO_ADMIN_ORIGIN and sends Cache-Control: private, no-store in preview. Preview URL: https://your-site/{type}/{slug}.
Until @manifolio/sdk is on npm, the downloaded starter carries it in vendor/manifolio-sdk.