Stone.js API
    Preparing search index...

    Type Alias RateLimitSubjectResolver<EventType>

    RateLimitSubjectResolver: (
        event: EventType,
    ) => string | undefined | Promise<string | undefined>

    How an application resolves what a request should be billed to.

    The escape hatch that keeps this module out of the business of guessing: an application knows where its subject lives, whether that is a claim in a token, a field of a body, a header its own edge signs, or a lookup a middleware of its own already did. Return nothing when the request carries none, and never throw: a subject that cannot be read must degrade, not break the route.

    Type Parameters

    • EventType = any

    Type Declaration

      • (event: EventType): string | undefined | Promise<string | undefined>
      • Parameters

        Returns string | undefined | Promise<string | undefined>