Skip to content

AdminUser

AdminUser = object

Defined in: packages/admin/src/types.ts:24

A user representation for the admin panel, decoupled from @cfast/auth.

This is the shape the admin expects from your auth adapter. It includes impersonation state so the admin UI can display banners and restore the real admin session.

const adminUser: AdminUser = {
id: "usr_123",
email: "admin@example.com",
name: "Jane Admin",
avatarUrl: null,
roles: ["admin"],
};

avatarUrl: string | null

Defined in: packages/admin/src/types.ts:32

URL to the user’s avatar image, or null if none is set.


email: string

Defined in: packages/admin/src/types.ts:28

The user’s email address, displayed in the admin sidebar and user views.


id: string

Defined in: packages/admin/src/types.ts:26

Unique user identifier (typically from the user table primary key).


optional isImpersonating: boolean

Defined in: packages/admin/src/types.ts:36

Whether this session is an impersonation session started by another admin.


name: string

Defined in: packages/admin/src/types.ts:30

Display name shown in the admin header and user management views.


optional realUser: object

Defined in: packages/admin/src/types.ts:38

The real admin user behind an impersonation session. Present only when isImpersonating is true.

id: string

name: string


roles: string[]

Defined in: packages/admin/src/types.ts:34

List of role names assigned to this user (e.g., ["admin", "editor"]).