Skip to content
PACKAGES

createFixedWindowRateLimitPolicy()

Create one exact scoped fixed-window-v1 policy from an already-identifiable request.

import { createFixedWindowRateLimitPolicy } from "@graphrefly/ts/rate-limit";
function createFixedWindowRateLimitPolicy(
requestValue: unknown,
opts: CreateFixedWindowRateLimitPolicyOptions,
): FixedWindowRateLimitPolicy
ParameterTypeDescription
requestValueunknownComplete strict request that establishes the exact scope.
optsCreateFixedWindowRateLimitPolicyOptionsState revision, capacity, and epoch-aligned window duration.

The immutable normalized fixed-window policy.

import { createFixedWindowRateLimitPolicy } from "@graphrefly/ts/rate-limit";

packages/ts/src/rate-limit/keyed-rate-limit-algorithms.ts