Config

Rate Limiter

Stop brute-force attacks and abuse with rate limiting.

Rate limiting is a powerful feature that helps protect your API from abuse and brute-force attacks. It allows you to limit the number of requests a client can make within a specified time frame.

Usage

src/vitnode.api.config.ts
export const vitNodeApiConfig = buildApiConfig({
  rateLimiter: {
    points: 40,
    duration: 60,
  },
});

Options

PropTypeDefault
blockDuration?
number
0
execEvenlyMinDelayMs?
number
duration * 1000 / points
execEvenly?
boolean
false
duration?
number
60
points?
number
80 (120 in dev)

On this page