Strapi plugin logo for Moesif

Plugin verified by Strapi

Add Moesif API Analytics and Monitoring to Strapi

Strapi plugin moesif

WARNING (Breaking Changes): ^2.0.0 only supports Strapi v4 and above. For Strapi v3 support, use ^1.0.5

Plugin to add Moesif API Analytics and Monitoring to Strapi!


  1. Install the plugin

npm install --save strapi-plugin-moesif
  1. Enable the plugin ./config/plugins.js
module.exports = {
  'strapi-plugin-moesif': {
    enabled: true,
    config: {
      moesif: {
        //custom config passed to moesif middleware goes here
  1. Add Moesif to your middleware array ./config/middleware.js

module.exports = [

Add MOESIFAPPLICATION_ID to your environment variables Your Moesif Application Id can be found in the [_Moesif Portal]( After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.

  1. Run Strapi


npm run develop


yarn develop

Make a few API calls to your resources like so:

curl `http://localhost:1337`


If using Heroku, simply install the Moesif application as an add-on. The MOESIF_APPLICATION_ID environment variable will be automatically created and managed by Heroku.

Configuration options

Because this plugin uses moesif-nodejs under the hood, all of the configuration options for moesif-nodejs are supported by this plugin also.


To track Strapi users, we set the identifyUser function by default:

identifyUser: function (req, res) {
  if (req.state && req.state.user) {
    return String(;
  return undefined;


Moesif can be setup to track all traffic in and out of your application, but usually the interest is in API metrics specifically. The default configuration of this plugin skips all non-JSON communication to avoid having tons of file requests in your Moesif dashboard.

To override the skip function, simple include one in your config, or set to to send all communications:

// return true if the data should be skipped
skip: function (req, res) {
  // don't log non JSON types
  return (
    res.headers && !res.headers["Content-Type"].includes("application/json")

//send all data regardless of type
skip: null


This plugin was originally created by Bobby Glidwell

Install now

npm install strapi-plugin-moesif

Last updated

229 days ago

Strapi Version

4.0 and above


github profile image for Bobby Glidwell
Bobby Glidwell

Useful links