Skip to main content

resetKey(key)

Resets the rate limiting for a given key. An example use case is to allow users to complete a captcha to reset their rate limit, then call this function. Example:
If you use a custom keyGenerator, be sure to replace req.ip with the correct key.

getKey(key)

Retrieves the hit count and reset time from the store for a given key. Note: getKey depends on store support. It works with the MemoryStore and cluster-memory-store, but may not work with other stores. Calling it will throw an error if the store does not have a get method.