Authentication Object
Name | Type | Description |
---|---|---|
userId | string | The ID of the active user, or null when signed out. In data-loaders, this is often the only piece of information needed to securely retrieve the data associated with a request. |
sessionId | string | The ID of the active session, or null when signed out. This is primarily used in audit logs to enable device-level granularity instead of user-level. |
actor | string | If user impersonation is being used, this field will contain information about the impersonator. |
getToken({ template?: string; }) | string | Retrieves a signed JWT that is structured according to the corresponding JWT template in your dashboard. If no template parameter is provided, a default Clerk session JWT is returned. |
orgId | string | A unique identifier for this organization. |
orgRole | string | The role that the user will have in the organization. Valid values are |
claims | object | All claims for the JWT associated with the current user |
Example
{sessionId: 'sess_2GaMqUCB3Sc1WNAkWuNzsnYVVEy',userId: 'user_2F2u1wtUyUlxKgFkKqtJNtpJJWj',orgId: null,getToken: [AsyncFunction (anonymous)],claims: {azp: 'http://localhost:3000',exp: 1666622607,iat: 1666622547,iss: 'https://clerk.quiet.muskox-85.lcl.dev',nbf: 1666622537,sid: 'sess_2GaMqUCB3Sc1WNAkWuNzsnYVVEy',sub: 'user_2F2u1wtUyUlxKgFkKqtJNtpJJWj'}}