genko.meDocs
Frameworks and languagesAstro

Astro

Render genko.me entry lists and details as static HTML in Astro with @genko-me/astro. No React, Vue, or Svelte needed.

Astro renders pages to HTML on the server, either at build time or on request, and sends no client JavaScript by default. That default works well for content sites backed by a CMS such as genko.me.

Call @genko-me/sdk directly in the frontmatter of a .astro file (the part between --- lines at the top), then render the result with the Astro components from @genko-me/astro. Field, RichText, Pagination, ShareButtons, and PreviewNotice work in any .astro file without adding React, Vue, or Svelte and without registering an integration. Entry bodies, fields, and pagination are static HTML, and no client:load or other directive is needed. Only the share buttons' copy and share-sheet actions use a small script.

If your site already uses Next.js, Nuxt, or SvelteKit, see their dedicated guides: Next.js, Nuxt, or SvelteKit. Their display components provide a shorter path.

Packages

PackagePurpose
@genko-me/sdkCall the delivery API from frontmatter. It has no runtime dependencies and works at build time or request time
@genko-me/astroThe Field, RichText, Pagination, ShareButtons, and PreviewNotice components. fetchGenkoEntry from @genko-me/astro/server fetches an entry with a draftKey for SSR draft previews. Targets Astro 7.4 and later 7.x
@genko-me/cli (optional)npx @genko-me/cli init --pages generates the connection settings and list and detail pages

Not supported in Astro: List, View, and Pagination from @genko-me/react/next. They depend on the Next.js App Router and Server Actions. In Astro, use Pagination from @genko-me/astro with Astro's paginate().

Good fit

  • Content-heavy sites where search traffic matters. Most pages reach the browser as static HTML with no JavaScript.
  • Sites that build most pages statically but render draft previews on request.
  • Sites that rebuild from a webhook whenever an entry is published, updated, or deleted and stay static otherwise.

Limitations

  • Apps where most of the screen depends on client state. React alone, Next.js, Nuxt, or SvelteKit offers more suitable components.
  • Sites already built with Next.js, Nuxt, or SvelteKit. Their dedicated display components are simpler to use.

Next steps

  • Get started: install the packages and show a list, a single entry, and draft previews
  • Tutorial: adjusting the components and rebuilding with webhooks
  • Delivery API: fetch over HTTP without the SDK

Last updated: October 27, 2026

On this page