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.
Example
Section titled “Example”const ctx: ActionContext<{ id: string; role: string }> = { db, user: { id: "u_1", role: "author" }, grants: [{ action: "manage", subject: "all" }],};Type Parameters
Section titled “Type Parameters”TUser
The shape of the authenticated user object.
Properties
Section titled “Properties”db:
Db
Defined in: packages/actions/src/types.ts:37
The Drizzle database instance from @cfast/db.
grants
Section titled “grants”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.