Authentication
Object
Both auth()
and getAuth()
return an Authentication
object. This JavaScript object contains important information like session data, your user's ID, as well as their active organization ID.
Properties
Name | Description |
---|---|
actor | Holds identifier for the user that is impersonating the current user. |
debug | Used to help debug issues when using Clerk in development. |
getToken | A function that returns a promise that resolves to the current user's session token; can also be used to retrieve a custom JWT template. |
orgId | The current user's currently active organization ID. |
orgRole | The current user's currently active organization role. |
orgSlug | The current user's currently active organization slug. |
sessionClaim | The current user's session claim. |
sessionId | The current user's session ID. |
userId | The current user's unique identifier. |
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' } }