Treblle with Strapi
To integrate Treblle with Strapi, we provide an official SDK for Strapi which is a Strapi plugin - treblle-strapi
.
Requirements
- Strapi v4
Installation
After installation set the following environment variables your .env
You can find the values in your Treblle dashboard
TREBLLE_API_KEY
TREBLLE_PROJECT_ID
Setup
treblle-strapi
exposes a middleware that you can add in your config/middlewares.js
array like so:
And thatβs it, Treblle will now monitor your Strapi content API.
Config
AdditionalFieldsToMask
You can specify additional fields to be masked before sending the Treblle payload. To do so, add the following config in config/plugins.js
Do replace
FIELDS_TO_MASK_1
with the field you want to mask.
routesToMonitor
By default, this Strapi plugin will monitor only routes that starts has /api
in the URL. You can override this by passing a routesToMonitor
array in the config
of the plugin.