unstale

npm / @nestjs/throttler

@nestjs/throttler

What changed in @nestjs/throttler 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

10 breaking9 new APIs and options4 behavior and defaults1 tooling11 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@nestjs/throttler 623 changes

Breaking changes 5

  • The default tracker identifies NAT64 well-known prefix source addresses by their embedded IPv4 address instead of grouping IPv4 clients behind a gateway into one rate-limit bucket.

    6.8.0release notes

  • With blockDuration: 0, Retry-After reports when the oldest hit expires rather than when the window ends.

    6.7.1release notes

  • The built-in tracker masks IPv6 addresses to a subnet prefix, so clients within that subnet share a rate-limit counter. IPv6 tracker strings change shape, rotating storage keys once on upgrade.

    6.7.0release notes

  • A separate time will be provided to block requests, independently of the ttl; this is a breaking change for storage library owners.

    6.0.0release notes

  • Storage now uses Map instead of a simple object for key-value storage, improving performance in scenarios with frequent key additions and deletions; this is a breaking change for storage library owners.

    6.0.0release notes

New APIs and options 3

  • Adds a protected method subclasses can override to set rate limit headers; the guard uses res.setHeader() when res.header() is unavailable.

    6.7.1release notes

  • Configure the IPv6 subnet prefix length used by the default tracker.

    6.7.0release notes

  • Adds an option to control whether headers are added to the response.

    6.5.0release notes

Behavior and default changes 3

  • skipIf can return a promise, allowing the decision to skip throttling to depend on an asynchronous lookup; synchronous callbacks still work.

    6.8.0release notes

  • Storage no longer retains request contexts through per-hit timers; it records hit expiry times and prunes expired hits on access, and the idle-record sweep is no longer tied to the first request's context.

    6.7.1release notes

  • Idle records are removed after their window fully elapses and all pending hits and blocks have expired, preventing the in-memory map from growing indefinitely.

    6.7.0release notes

Tooling 1

  • Declares the supported Node versions in package engines, matching the range tested by the CI matrix.

    6.6.0release notes

Fixes and other changes 11

  • Using blockDuration: 0 no longer causes a stack overflow after a window holds more than about 125,000 hits, which previously made requests fail with a 500.

    6.8.0release notes

  • Every request is matched against ignoreUserAgents patterns with the g or y flag, preventing every other matching request from being counted against the limit.

    6.8.0release notes

  • Requests continue to be rejected with limit: 0 after a block has elapsed; the first hit after a block is now checked against the limit.

    6.8.0release notes

  • Request-scoped guards, including guards that depend on a request-scoped provider, no longer fail requests because onModuleInit() is not called on those instances.

    6.8.0release notes

  • Throttlers are sorted correctly when one uses a callback ttl, preventing a request rejected by a short throttler from being counted against a longer one.

    6.8.0release notes

  • Numeric strings are coerced to numbers, and an explicit 0 is respected; with blockDuration: 0, rejected requests are not recorded and can pass as soon as the oldest hit expires.

    6.7.1release notes

  • Numeric strings are coerced to numbers, and an explicit 0 in @Throttle() or module options is respected instead of falling back to the default.

    6.7.1release notes

  • The guard logs a warning at boot when no throttler is configured; it otherwise limits nothing.

    6.7.1release notes

  • Numeric strings are coerced to numbers, and an explicit 0 in @Throttle() or module options is respected instead of falling back to the default.

    6.7.1release notes

  • Updates the package to support Nest version 12.

    6.6.0release notes

  • Adds support for Nest version 11.

    6.5.0release notes

@nestjs/throttler 512 changes

Breaking changes 5

  • limit is no longer optional in module options; an option object must define defaults for its throttler.

    5.0.0release notes

  • Custom ThrottlerStorage implementations no longer need a storage property.

    5.0.0release notes

  • @Throttle() now accepts an object keyed by throttler context names, with limit and ttl values, instead of two parameters.

    5.0.0release notes

  • ttl is now measured in milliseconds rather than seconds; the seconds helper is available to ease migration.

    5.0.0release notes

  • ttl is no longer optional in module options; an option object must define defaults for its throttler.

    5.0.0release notes

New APIs and options 6

  • The seconds helper multiplies a ttl by 1000 to express it in milliseconds.

    5.0.0release notes

  • ThrottleGuard#shouldSkip enables conditionally skipping throttling.

    5.0.0release notes

  • A guard method allows the throttler message to be overridden.

    5.0.0release notes

  • Module options can now be an array or an object with a throttlers array property, enabling multiple throttler contexts.

    5.0.0release notes

  • @ThrottleSkip() now accepts an object whose string keys identify throttlers and whose boolean values specify which throttlers to skip.

    5.0.0release notes

  • The throw method receives extra context for customizing the message.

    5.0.0release notes

Behavior and default changes 1