ThrottlerModuleOptions


interface ThrottlerModuleOptions {
  limit?: number
  ttl?: number
  ignoreUserAgents?: RegExp[]
  storage?: any
  skipIf?: (context: ExecutionContext) => boolean
}

Properties

Property Description
limit?: number

The amount of requests that are allowed within the ttl's time window.

ttl?: number

The amount of seconds of how many requests are allowed within this time.

ignoreUserAgents?: RegExp[]

The user agents that should be ignored (checked against the User-Agent header).

storage?: any

The storage class to use where all the record will be stored in.

skipIf?: (context: ExecutionContext) => boolean

A factory method to determine if throttling should be skipped. This can be based on the incoming context, or something like an env value.