Skip to content

gi-nx


gi-nx / getUserClaimsJwt

ts
function getUserClaimsJwt(projectIds?: string[]): Promise<string>;

Fetches a signed JWT (RS256) encoding the current user's claims. The JWT's decoded payload has the shape:

ts
{
  exp: number;
  user_id: number;
  user_name: string;
  user_email: string;
  workspaces: { workspace_id: number; workspace_name: string; access_level: string; workspace_type: string }[];
  teams: { team_id: number; team_name: string; access_level: string }[];
  projects: { project_id: string; project_name: string; access_level: string }[];
}

Parameters

ParameterTypeDescription
projectIds?string[]The project IDs to include in the projects claim. Defaults to the active project.

Returns

Promise<string>

A promise that resolves with the encoded JWT string.