Skip to content

getUserById

getUserById(userId): Promise<UserResponse>

Get user by ID helper function to get a user by their ID from Astro Studio’s Database.

Parameters

userId: string

The ID of the user to get. You can get this from Astro.locals.dbUser.id when StudioCMS Auth middleware is used.

Returns

Promise<UserResponse>

The user data.

Defined in

packages/studiocms_core/src/helpers/contentHelper.ts:167