Skip to content

gi-nx


gi-nx / getUserClaimsJwt

ts
function getUserClaimsJwt(this: RpcCallContext, 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;
  app: { app_id: number; app_name: 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
thisRpcCallContext-
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.