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
  • api : OrganizationApi
  • organizationId : number
  • membershipId : string
  • userId : string
  • Methods
  • constructor(api, membership)
  • async addRole(name)
  • async getRoles()
  • async getOrganization()
  • reference()
  • async organizationProfile()
  • async remove()
  1. Reference
  2. Identity JavaScript SDK
  3. The Base Package
  4. Organizations

OrganizationMembership

PreviousOrganizationNextOrganizationMembershipWithMetadata

Last updated 3 years ago

Members

api :

The OrganizationApi that this object was created with.

organizationId : number

The organization id that this membership is associated with.

membershipId : string

The id of this membership.

userId : string

The id of the user that this membership is associated with.

Methods

constructor(api, membership)

Create a new Membership object using the .

const details = await organizationApi.organizationInfo(organizationId)
const [membershipData] = details.memberships
const membership = new OrganizationMembership(organizationApi, membershipData)

async addRole(name)

Add a new role to this membership.

const role = await membership.addRole('Admin')

async getRoles()

Get all the roles associated with this membership.

const roles = await membership.getRoles()

async getOrganization()

Get the organization associated with this membership.

const organization = await membership.getOrganization()

reference()

const ref = membership.reference()

async organizationProfile()

Get this membership's organization profile.

const organizatonProfile = await membership.organizationProfile()

async remove()

Remove this membership from the organization.

The result is a boolean that indicates success.

if (await membership.remove()) {
    // the membership was successfully removed from the organization
}

api must be an instance of ;

membership must implement the interface.

The result is an object or false if it failed.

The result is an array of objects or false if it failed.

The result is an object or false if it failed.

Create a object that is associated with this membership's user.

The result of this function implements the interface.

OrganizationApi
Organization API
OrganizationApi
OrganizationRole
OrganizationRole
Organization
UserReference
OrganizationMembershipReference
OrganizationProfileInfo