Skip to content

Priority

const Priority: object

Defined in: src/policies/sdk/priority.ts:10

readonly AUTH: 10 = 10

Authentication (e.g. jwtAuth, apiKeyAuth, basicAuth)

readonly CACHE: 40 = 40

Caching — before upstream

readonly CIRCUIT_BREAKER: 30 = 30

Circuit breaker — protects upstream

readonly DEFAULT: 100 = 100

Default priority for unspecified policies

readonly EARLY: 5 = 5

Early pipeline (e.g. cors) — before auth

readonly IP_FILTER: 1 = 1

IP filtering — runs before all other logic

readonly METRICS: 1 = 1

Metrics collection — just after observability

readonly MOCK: 999 = 999

Mock — terminal, replaces upstream

readonly OBSERVABILITY: 0 = 0

Observability policies (e.g. requestLog) — wraps everything

readonly PROXY: 95 = 95

Proxy header manipulation — just before upstream

readonly RATE_LIMIT: 20 = 20

Rate limiting — after auth

readonly REQUEST_TRANSFORM: 50 = 50

Request header transforms — mid-pipeline

readonly RESPONSE_TRANSFORM: 92 = 92

Response header transforms — after upstream

readonly RETRY: 90 = 90

Retry — wraps upstream fetch

readonly TIMEOUT: 85 = 85

Timeout — wraps upstream call