ActionsConfig
ActionsConfig<
TUser> =object
Defined in: packages/actions/src/types.ts:78
Configuration for the createActions factory.
Provides a getContext callback that resolves the per-request
ActionContext (database, user, grants) for every action invocation.
Example
Section titled “Example”const config: ActionsConfig<AppUser> = { getContext: async ({ request }) => { const ctx = await requireAuthContext(request); const db = createCfDb(env.DB, ctx); return { db, user: ctx.user, grants: ctx.grants }; },};Type Parameters
Section titled “Type Parameters”TUser
The shape of the authenticated user object.
Properties
Section titled “Properties”getContext()
Section titled “getContext()”getContext: (
args) =>Promise<ActionContext<TUser>>
Defined in: packages/actions/src/types.ts:80
Resolves the per-request action context from the route handler arguments.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionContext<TUser>>