Getting Started

This utility middleware was mainly built to protect your MedusaJS application from abuse. It allows you to easily manage request limits without stepping outside the familiar Medusa environment.

Why Rate Limiting Matters

  1. Shield Against Attacks: Prevent Denial of Service (DoS) attempts by capping the number of requests from a single source.
  2. Boost Security: Thwart brute force attacks and other automated threats by controlling request frequency.
  3. Easy Setup: Seamlessly integrate rate limiting into your existing Medusa configuration files.

Installation

To get started, install the plugin using your preferred package manager:

npm install @perseidesjs/medusa-plugin-rate-limit

Usage

This middleware uses the CacheModule available (InMemory, Redis, etc.) under the hood and exposes a simple middleware to limit the number of requests per IP address.

To learn how to apply rate limiting to your routes, head over to the Basic Usage section.