Skip to content

What is Nuxt Kirby?

Nuxt Kirby is a Nuxt module for reading and writing Kirby CMS content. Requests travel through a Nuxt server route, so the Kirby credentials never reach the browser, and the same composables work server-side and client-side.

Two Ways to Reach Kirby

KQL, Kirby's Query Language, for content queries that follow relationships and filter:

ts
const { data, error } = await useKql({
  query: 'site',
  select: ['title', 'children']
})

The Kirby REST API, for plain requests, file downloads and endpoints of your own:

ts
const { data, error } = await useKirbyData('api/pages/blog')

Both cache their responses and surface errors the same way. Data Fetching Methods covers which to reach for.

Kirby Headless Plugin

The Kirby Headless plugin adds a KQL endpoint with token authentication and takes care of CORS. It is optional, but it is what this module is built against, and the recommended setup for a headless Kirby.

It brings:

Next Steps

Released under the MIT License.