Skip to content

keyedRateLimitTable<K>(options): KeyedRateLimitTable<K>

Defined in: packages/rate-limit/src/keyed-table.ts:170

Create a KeyedRateLimitTable over a caller-supplied meter factory.

Choose it when the server limits many clients and must survive a flood of new keys without growing with every client it has ever seen. Choose a single meter instead when there is one quota and no keys: a table for one key is a meter with extra steps.

K

KeyedRateLimitTableOptions

The key bound, the meter factory, the clock, and the table-full choice.

KeyedRateLimitTable<K>

With code INVALID_MAX_KEY_COUNT when maxKeyCount is not a positive safe integer, or INVALID_WHEN_FULL when whenFull is neither refuse nor allow-untracked. A factory that rejects its own options throws its own package’s error from here, because the table builds one meter at construction to answer for keys it does not hold.