RequireEntitlementOptions
Defined in: src/adapters/guard.ts:20
Options shared by every framework’s requireEntitlement guard.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Ctx |
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
amount? |
FromContext<Ctx, number> |
Units to check / consume. Default 1. |
src/adapters/guard.ts:27 |
consume? |
boolean |
true → consume the amount atomically (a refusal never counts); default false → check only. |
src/adapters/guard.ts:32 |
customer |
(ctx) => | string | Promise<string | null | undefined> | null | undefined |
The customer (your user / org / workspace id) for this request. Return null / undefined / "" when there is none → 401. |
src/adapters/guard.ts:25 |
idempotencyKey? |
(ctx) => string | null | undefined |
Idempotency key for consume (e.g. from an idempotency-key header). |
src/adapters/guard.ts:34 |
onDenied? |
(result, ctx) => Response | Promise<Response> |
Build the denial response yourself (e.g. an HTML upsell page). Default: denialResponse. | src/adapters/guard.ts:39 |