withEntitlement
function withEntitlement<C, Ctx>(handler, options): (request, context) => Promise<Response>;Defined in: src/adapters/next.ts:67
Wrap an App Router route handler with an entitlement guard. The handler’s
second argument is Next’s route context ({ params }) plus entitlement.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
C extends AnyCatalog |
- |
Ctx extends object |
object |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handler |
(request, context) => Response | Promise<Response> |
options |
WithEntitlementOptions<C> |
Returns
Section titled “Returns”(request, context) => Promise<Response>