Skip to content

ActionContext

ActionContext<TUser> = object

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

Context provided to every action’s OperationsFn.

Created by the getContext callback in ActionsConfig and passed alongside the database instance and parsed input to each action.

const ctx: ActionContext<{ id: string; role: string }> = {
db,
user: { id: "u_1", role: "author" },
grants: [{ action: "manage", subject: "all" }],
};

TUser

The shape of the authenticated user object.

db: Db

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

The Drizzle database instance from @cfast/db.


grants: Grant[]

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

The user’s permission grants, used for permission checking.


user: TUser

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

The authenticated user for the current request.