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
  • Interfaces
  • OrganizationProfileInfoWithId
  • OrganizationProfileInfo
  • ProfileInfo
  • Methods
  • constructor(user, endpoint)
  • async info(id)
  • async organization(id)
  • async organizationSearch(search, amount, offset)
  1. Reference
  2. Identity JavaScript SDK
  3. The Base Package
  4. Profile

ProfileApi

PreviousUserReferenceNextCache

Last updated 3 years ago

This class implements .

You need the scope to access this API.

This is a JavaScript implementation of the .

For ease of use we recommend using the object for interaction instead.

Interfaces

OrganizationProfileInfoWithId

interface OrganizationProfileInfoWithId implements OrganizationProfileInfo {
    id: number
}

OrganizationProfileInfo

interface OrganizationProfileInfo {
    name: string,
    address?: string,
    city?: string,
    country?: string,
    state?: string,
    website?: string,
    verified?: boolean,
    uniqueId?: string,
    zipCode?: string
}

ProfileInfo

interface ProfileInfo {
    firstName?: string,
    lastName?: string,
    country?: { 
        alpha2: string,
        name: string
    },
    email?: {
        value: string,
        confirmed: boolean
    },
    kycVerified?: boolean,
    state?: string,
    profilePicture?: string
}

Methods

constructor(user, endpoint)

Create a Profile API object.

  • endpoint should be the Vulos Identity endpoint.

const profileApi = new ProfileApi(user, endpoint)

async info(id)

Get an user's public profile by the user's ID.

const userProfile = await profileApi.info(userId)

async organization(id)

Get an organization's public profile by the organization's ID.

const organizationProfile = await profileApi.organization(organizationId)

async organizationSearch(search, amount, offset)

Search for an organization by name using a string.

  • search is the string we are searching with in the organization's name;

  • amount is the maximal amount of elements that can be returned (absolute maximal is 100, default is 10), this argument is optional;

  • offset is the amount of organizations that will get skipped in the result (default is 0), this argument is optional;

const [bestMatch] = await profileApi.organizationSearch('Example')

// ... or

let pageIndex = 0
const organizationsPerPage = 5

const nextPage = async () => {
    const organizations = await profileApi.organizationSearch(
        'Example',
         organizationsPerPage,
         organizationsPerPage * pageIndex)
     pageIndex++
     return organizations
 }
 
let currentPage

while(currentPage = await nextPage()) {
    // do something with the current page
}

user should be an instance of the object.

The result implements the interface.

This method's response has the profile:info prefix.

The result implements the interface.

This method's response has the profile:organization prefix.

The result implements the interface.

This method's response has the profile:organization:search prefix.

User
ProfileInfo
OrganizationProfileInfo
OrganizationProfileInfoWithId
BaseApi
Profile API
User
cache
cache
cache
profile:read