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:
- 🧩 Optional bearer token authentication for KQL and custom API endpoints
- 🧱 Resolve fields in blocks: UUIDs to file and page objects or any other field
- ⚡️ Cached KQL queries
- 🌐 Multi-language support for KQL queries
- 😵 Built-in CORS handling
- 🍢 Express-esque API builder with middleware support
- 🗂 Return JSON from templates instead of HTML
Next Steps
- Getting Started – Install the module and send a first query.
- Data Fetching Methods – Choose between KQL and the REST API.
- Authentication – Set up bearer or basic authentication.
- Starter Kits – Ready-made templates to build on.