Vulos Documentation
  • Identity
    • Welcome to the Vulos Identity Documentation!
    • Quick Start
    • Organizations
    • Scopes and Claims
  • Reference
    • Identity JavaScript SDK
      • The Base Package
        • KYC
          • KycStatus
          • KycInstance
          • KycDetails
          • KycApi
        • Profile
          • UserReference
          • ProfileApi
        • Cache
        • Authentication
          • Application
          • BaseAuth
          • User
          • UserInfo
          • BaseApi
        • Organizations
          • Organization
          • OrganizationMembership
            • OrganizationMembershipWithMetadata
          • OrganizationRole
          • OrganizationApi
      • The Backend Auth Package
        • CodeVerifier
        • BackendAuth
      • The Frontend Auth Package
        • IFrameRefresh
        • StateVerifier
        • FrontendAuth
    • Organization API
      • Organizations
      • Memberships
        • Roles
    • Profile API
    • KYC API
Powered by GitBook
On this page
  • Members
  • response : any
  • Methods
  • constructor(response)
  • id()
  • sub()
  • firstName()
  • lastName()
  • birthDate()
  • nationalId()
  • trustLevel()
  • isEmailVerified()
  • isKycVerified()
  • address()
  • email()
  • hasRole(role)
  • isInOrganizationWithName(name)
  • isInOrganizationWithId(id)
  • wallets()
  • picture()
  1. Reference
  2. Identity JavaScript SDK
  3. The Base Package
  4. Authentication

UserInfo

PreviousUserNextBaseApi

Last updated 3 years ago

Members

response : any

The response that this object was created with.

Methods

constructor(response)

Create an object that contains user information

const response = await fetch(/* arguments to fetch the OpenID userinfo endpoint */)
        .then(data => data.json())
const userInfo = new UserInfo(response)

// ... or

const userInfo = user.info()

This probably shouldn't get called directly, use instead.

See for more information.

id()

Get an unique identifier about the user.

const identifier = userInfo.id()

sub()

Get an unique identifier about the user.

const identifier = userInfo.sub()

firstName()

Get the user's first name.

const firstName = userInfo.firstName()

lastName()

Get the user's last name.

const lastName = userInfo.lastName()

birthDate()

Get the user's birth date.

const birthDate = userInfo.birthDate()
// birthDate is a JavaScript Date object

nationalId()

Get the user's unique national identifier (for example their SSN in the US).

const nationalId = userInfo.nationalId()

trustLevel()

Get the user's Vulos Identity trust level.

  • 1 indicates that the user has done no KYC verification but has provided basic details.

  • 2 indicates that the user has successfully KYC verification.

  • Anything other than that indicates that the user has done some action to reduce or increase their trust level that hasn't been specified in this document.

if (userInfo.trustLevel() >= 2) {
    // allow the user to preform some action limited
    // to users that have confirmed their identity
}

isEmailVerified()

Get the user's email verification status.

if (userInfo.isEmailVerified()) {
    // allow the user to use that email for some action
}

isKycVerified()

Get the user's KYC verification status.

if (userInfo.isKycVerified()) {
    // allow the user to do some action that requires
    // KYC verification or a confirmed identity
}

address()

Get the user's address.

const addressObj = userInfo.address()

email()

Get the user's email address.

const email = userInfo.email()

hasRole(role)

Check if the user has a specific role in the associated organization to the application.

if (userInfo.hasRole('SuperAdmin')) {
    // allow the user to have elevated access
}

isInOrganizationWithName(name)

Check if the user is in a specific organization by name.

if (userInfo.isInOrganizationWithName('My Organization')) {
    // the user is in an organization with name 'My Organization'
}

isInOrganizationWithId(id)

Check if the user is in a specific organization by id.

const organizationId = 100;
if (userInfo.isInOrganizationWithId(organizationId)) {
    // the user is in the organization with ID 100
}

wallets()

Get the user's Ethereum wallet addresses.

for (const walletAddress of userInfo.wallets()) {
    // do something with the wallet address
}

picture()

Get the user's profile picture.

const profilePictureUrl = userInfo.picture()

See for more information.

This is the same as , it exists for readability.

This function requires the scope.

This is the same as , it exists for readability.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

This function requires the scope.

It is recommended to use instead.

You can obtain the organization ID using the or by checking the URL of the organization's page on the Vulos Identity dashboard.

This function requires the scope.

This function requires the scope.

This function requires the scope.

BaseAuth
Organization API
sub()
id()
isInOrganizationWithId()
User
User.info()
OpenID userinfo endpoint
openid
openid
profile
profile
profile
private
public
email
public
address
email
organization:roles
organization:read
organization:read
wallet
profile