Skip to content

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.

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 };
},
};

TUser

The shape of the authenticated user object.

getContext: (args) => Promise<ActionContext<TUser>>

Defined in: packages/actions/src/types.ts:80

Resolves the per-request action context from the route handler arguments.

RequestArgs

Promise<ActionContext<TUser>>