Skip to content

@flarelog/sdk


@flarelog/sdk / PagesFunctionContext

Interface: PagesFunctionContext ​

Defined in: types.ts:379

Cloudflare Pages Function context shape (used in functions/ directory). This is the context object passed to onRequest handlers in Pages Functions. Pages Functions run on the same Workers runtime but have a different API shape.

Properties ​

request ​

request: Request

Defined in: types.ts:381

The incoming Request object


env ​

env: Record<string, unknown>

Defined in: types.ts:383

Environment variables and bindings (KV, D1, R2, etc.)


waitUntil ​

waitUntil: (promise) => void

Defined in: types.ts:385

Wait until a promise resolves before the function ends

Parameters ​

promise ​

Promise<unknown>

Returns ​

void


next? ​

optional next?: () => Promise<Response>

Defined in: types.ts:387

Next function in the middleware chain (if using middleware)

Returns ​

Promise<Response>


data? ​

optional data?: Record<string, unknown>

Defined in: types.ts:389

Data passed between middlewares


params? ​

optional params?: Record<string, string>

Defined in: types.ts:391

Function parameters from dynamic routes

Released under the MIT License.