Membership

The vault owner can manage access to their vault by creating and maintaining memberships.

New members can be assigned one of two roles:

  • Contributor: can publish new documents, assets, etc to the vault.

  • Viewer: can access the vault, view contents and download only.

invite(vaultId, email, role)

Invite user with an Akord account:

  • vaultId (string, required)

  • email (string, required) - invitee's email

  • role (RoleType, required) - CONTRIBUTOR or VIEWER

  • options (MembershipCreateOptions, optional) - invitation email message, etc.

  • returns Promise<{ membershipId, transactionId }> - Promise with new membership id & corresponding transaction id

example
const { membershipId } = await akord.membership.invite(vaultId, "[email protected]", "VIEWER");

inviteNewUser(vaultId, email, role)

Invite user without an Akord account:

  • vaultId (string, required)

  • email (string, required) - invitee's email

  • role (RoleType, required) - CONTRIBUTOR or VIEWER

  • options (MembershipCreateOptions, optional) - invitation email message, etc.

  • returns Promise<{ transactionId }> - Promise with new membership id & corresponding transaction id

example

accept(membershipId)

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

confirm(membershipId)

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

reject(membershipId)

Reject pending invitation:

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

leave(membershipId)

Reject already accepted invitation:

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

revoke(membershipId)

Revoke a membership, also update each valid membership with new rotated keys:

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

changeRole(membershipId, role)

  • membershipId (string, required)

  • role (RoleType, required) - CONTRIBUTOR or VIEWER

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

inviteResend(membershipId)

Resend email invitation:

  • membershipId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example

get(membershipId, options)

  • membershipId (string, required)

  • options (GetOptions, optional)

  • returns Promise<Membership> - Promise with the membership object

example

listAll(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<Array<Membership>> - Promise with all memberships within given vault

example

list(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<{ items, nextToken }> - Promise with paginated memberships within given vault

example

Last updated

Was this helpful?