Skip to content

What is Nuxt KQL?

Nuxt KQL is a lightweight Nuxt module to reliably retrieve data from your Kirby instance using the Kirby Query Language API. It keeps your authentication credentials safe and works on the server and client.

Motivation

Kirby lends itself well to a headless CMS. Setting up KQL is fairly easy, but fetching queries can be cumbersome at times. Not to mention CORS issues. This module solves these common problems by providing easy-to-use composables to query your Kirby instance with KQL.

With provided composables like useKql, your KQL responses are cached and authorization is handled for you right out of the box.

Most importantly, your Kirby authentication credentials are protected when fetching data, even on the client.

Kirby Headless Plugin

Setting up Kirby to support headless mode is a bit of a hassle. To make your life easier, you can use the Kirby Headless plugin. It provides a custom KQL endpoint with token-based authentication and other useful features. You do not have to use it, but it is the best way to use Kirby as a headless CMS and avoids common pitfalls like CORS issues. This Nuxt module is designed to work with it.

With the Kirby Headless plugin you are ready to go:

Nuxt Starter Kits

Instead of building your Nuxt project from scratch, you can use one of the provided starter kits to get up and running quickly. Choose the one that best suits your needs.

Released under the MIT License.