Socket
Book a DemoInstallSign in
Socket

@strapi-community/plugin-healthcheck

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strapi-community/plugin-healthcheck

Adds additional API endpoints for checking health of Strapi Components

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
145
-16.18%
Maintainers
5
Weekly downloads
 
Created
Source

Strapi Healthcheck Plugin

Adds additional API endpoints for checking health of Strapi Components

Strapi Discord NPM Version Monthly download on NPM

Table of Contents

🚦 Current Status

This package is currently maintained and should be considered Beta in terms of state. I/We are currently accepting contributions and/or dedicated contributors to help develop and maintain this package.

For more information on contributing please see the contrib message below.

🛑 Foreword

This package's lead maintainer is an employee of Strapi however this package is not officially maintained by Strapi Solutions SAS nor Strapi, Inc. and is currently maintained in the free time of the lead maintainer.

[!WARNING] Absolutely no part of this code should be considered covered under any agreement you have with Strapi proper including but not limited to any Enterprise and/or Cloud Agreement you have with Strapi.

✨ Features

These are the primary features that are finished or currently being worked on:

  • Generic ping endpoint to check if the server is running (good for checking network response time)
  • Generic server endpoint to check if the server is running, server uptime, server memory usage, and server/strapi version
  • Generic database endpoint to check if the database is connected, current/max connections, current database uptime, total database size, and database version
  • Generic all endpoint to check all components at once
  • Completely configurable to disable any data you don't want to be shown
  • Integration with other plugins and providers (Redis, Upload, ect)

🤔 Motivation

The purpose of this package is to have a deeper insight into the health of a Strapi instance. This is especially useful for monitoring and debugging purposes.

🖐 Requirements

[!CAUTION] This plugin will not work with Strapi v3 or v4 projects

Supported Strapi Versions:

Strapi VersionPlugin VersionSupportedTested On
v3.x.xN/AN/A
v4.x.xN/AN/A
v5.x.x>= 1.0.0Jan 2025

⏳ Installation

Install the plugin in your Strapi project or your Strapi plugin.

Strapi VersionPlugin VersionPackage ManagerCommand
v5.x.xLatestYarnyarn add @strapi-community/plugin-healthcheck
v5.x.xLatestnpmnpm i @strapi-community/plugin-healthcheck

🔧 Configuration

There is a very simple configuration to tailor the plugin to your needs and enable or disable certain responses (like the database size).

By default, all options are enabled, however you must enable specific endpoints in the Users-Permissions configuration or API Tokens Configuration to access them.

Sample Configuration

// ./config/plugins.js

module.exports = (env) => ({
// ...
  healthcheck: {
    enabled: true,
    config: {
      server: {
        uptime: true,
        memory: true,
        version: true,
      },
      database: {
        client: true,
        connections: true,
        uptime: true,
        size: true,
        version: true,
      },
    },
  },
// ...
});

Configuration Options

OptionTypeDefaultDescription
serverObject{}Server configuration options
server.uptimeBooleantrueShow server uptime
server.memoryBooleantrueShow server memory usage
server.versionBooleantrueShow server version
databaseObject{}Database configuration options
database.clientBooleantrueShow database client
database.connectionsBooleantrueShow database connections
database.uptimeBooleantrueShow database uptime
database.sizeBooleantrueShow database size
database.versionBooleantrueShow database version

API Endpoints

EndpointDescriptionSample Response
/api/healthcheck/pingResponds with a simple "Pong"Sample
/api/healthcheck/serverResponds with information about the Strapi and Node ServerSample
/api/healthcheck/databaseResponds with information about the connected databaseSample
/api/healthcheck/allResponds with with server and database informationSample

Ping Endpoint Sample

{
  "data": {
    "message": "pong"
  }
}

Server Endpoint Sample

{
  "data": {
    "alive": true,
    "uptime": {
      "raw": 10.052894558,
      "text": "0d 0h 0m 10s",
      "days": 0,
      "hours": 0,
      "minutes": 0,
      "seconds": 10
    },
    "memory": {
      "memory": {
        "total": {
          "raw": 148.984375,
          "text": "149 MB"
        },
        "used": {
          "raw": 117.34453582763672,
          "text": "117 MB"
        },
        "free": {
          "raw": 31.63903045654297,
          "text": "32 MB"
        },
        "max": {
          "raw": 4144,
          "text": "4144 MB"
        },
        "percent": {
          "totalRaw": 78.77086269336654,
          "totalText": "78.77 %",
          "maxRaw": 2.831986143782332,
          "maxText": "2.83 %"
        }
      }
    },
    "version": {
      "application": "0.1.0",
      "strapi": "5.7.0"
    }
  }
}

Database Endpoint Sample

PostgreSQL

{
  "data": {
    "alive": true,
    "client": "postgres",
    "connections": {
      "max": 100,
      "current": "18"
    },
    "uptime": {
      "raw": 2426042.935729,
      "text": "28d 1h 54m 2s",
      "days": 28,
      "hours": 1,
      "minutes": 54,
      "seconds": 2
    },
    "size": {
      "raw": 17.502691,
      "text": "17.50 MB"
    },
    "version": "PostgreSQL: 16.6"
  }
}

MySQL/MariaDB

{
  "data": {
    "alive": true,
    "client": "mysql",
    "connections": {
      "max": 151,
      "current": 13
    },
    "uptime": {
      "raw": 170685,
      "text": "1d 23h 24m 45s",
      "days": 1,
      "hours": 23,
      "minutes": 24,
      "seconds": 45
    },
    "size": {
      "raw": 2.6050560000000003,
      "text": "2.61 MB"
    },
    "version": "MariaDB: 11.6.2"
  }
}

SQLite

[!NOTE] SQLite does not have a max connection limit, so that value is always 1.

[!IMPORTANT] SQLite does not have an uptime value, so the Node process uptime is used instead.

{
  "data": {
    "alive": true,
    "client": "sqlite",
    "connections": {
      "max": 1,
      "current": 1
    },
    "uptime": {
      "raw": 4.93527706,
      "text": "0d 0h 0m 4s",
      "days": 0,
      "hours": 0,
      "minutes": 0,
      "seconds": 4
    },
    "size": {
      "raw": 0.90112,
      "text": "0.90 MB"
    },
    "version": "SQLite: 3.46.1"
  }
}

All Endpoint Sample

{
  "data": {
    "server": {
      "alive": true,
      "uptime": {
        "raw": 5.126152349,
        "text": "0d 0h 0m 5s",
        "days": 0,
        "hours": 0,
        "minutes": 0,
        "seconds": 5
      },
      "memory": {
        "memory": {
          "total": {
            "raw": 148.984375,
            "text": "149 MB"
          },
          "used": {
            "raw": 117.34453582763672,
            "text": "117 MB"
          },
          "free": {
            "raw": 31.63903045654297,
            "text": "32 MB"
          },
          "max": {
            "raw": 4144,
            "text": "4144 MB"
          },
          "percent": {
            "totalRaw": 78.77086269336654,
            "totalText": "78.77 %",
            "maxRaw": 2.831986143782332,
            "maxText": "2.83 %"
          }
        }
      },
      "version": {
        "application": "0.1.0",
        "strapi": "5.7.0"
      }
    },
    "database": {
      "alive": true,
      "client": "postgres",
      "connections": {
        "max": 100,
        "current": "15"
      },
      "uptime": {
        "raw": 2503002.43527,
        "text": "28d 23h 16m 42s",
        "days": 28,
        "hours": 23,
        "minutes": 16,
        "seconds": 42
      },
      "size": {
        "raw": 17.502691,
        "text": "17.50 MB"
      },
      "version": "PostgreSQL: 16.6"
    }
  }
}

Contributing

I/We are actively looking for contributors, maintainers, and others to help shape this package.

If interested please feel free to open up a GitHub issue/PR or ping DMehaffy on Discord.

[!NOTE] This package is maintained collectively by the strapi community organization. While there may be a lead maintainer, they are not the sole maintainer of this code and this code does not belong to the lead maintainer.

License

See the LICENSE file for licensing information.

Keywords

strapi

FAQs

Package last updated on 09 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.