🤝 Better REST
A Kirby plugin that exposes the internal REST API at
/rest with the option to convert Kirbytags to HTML and add a
srcset to images in the process. Intended to convert Kirby into a headless CMS.
The API can be accessed at
/rest. The plugin only allows
Requests need to be authenticated via Basic Auth. It’s recommended to create a seperate API User with either a custom blueprint or with the one provided by this plugin called better-rest API. Read more about user roles in the docs.
Kirby 3 API
Better-Rest Settings from Query
All standard setting as well as settings defined in
site/config/onfig.php can be overwritten on a per-request basis. Simply prefix the setting with
br- and include it as a query.
rest/pages/test?br-kirbytags=0&br-srcset=0: br-kirbytag br-srcset
The plugin supports multiple language settings. To fetch content for a specific language include a X-Language header containing the desired language code with your request. Alternatively a
br-language query can be used.
- The plugin converts kirbytags to HTML and adds a
srcsetto images by default.
- Additionally it is possible to enable smartypants.
- To overwrite the default language it is possible to set a language code.
All settings need to be prefixed with
The Kirby installation needs to be served with a TLS Certicificate via
For local development use Laravel Valet or disable
https in the
return [ 'api' => [ 'allowInsecure' => 'true' ] ];
WARNING: Do not use this setting for production environments!
Download and copy this repository to
composer require robinscholz/better-rest
git submodule add https://github.com/robinscholz/better-rest.git site/plugins/better-rest