Learn how to customize the @perseidesjs/medusa-plugin-rate-limit
plugin in your Medusa app
configureDefaults
to update the default global values, such as the limit
, window
and includeHeaders
. This allows you to set your own default values that will be applied across many routes, while still having the flexibility to specify more granular settings for specific routes. By configuring the middleware options, you can establish a baseline rate limiting policy that suits the majority of your application, and then override these defaults as needed for particular routes.
Option | Type | Default | Description |
---|---|---|---|
limit | Number | 100 | The number of requests allowed in the given time window |
window | Number | 60 * 15 (15 minutes) | The time window in seconds |
includeHeaders | Boolean | false | Whether to include the headers (X-RateLimit-Limit , X-RateLimit-Remaining ) in the response |