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, "winston@gmail.com", "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
const { membershipId } = await akord.membership.inviteNewUser(vaultId, "winston@gmail.com", "VIEWER");

accept(membershipId)

  • membershipId (string, required)

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

example
const { transactionId } = await akord.membership.accept(membershipId);

confirm(membershipId)

  • membershipId (string, required)

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

example
const { transactionId } = await akord.membership.confirm(membershipId);

reject(membershipId)

Reject pending invitation:

  • membershipId (string, required)

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

example
const { transactionId } = await akord.membership.reject(membershipId);

leave(membershipId)

Reject already accepted invitation:

  • membershipId (string, required)

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

example
const { transactionId } = await akord.membership.leave(membershipId);

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
const { transactionId } = await akord.membership.revoke(membershipId);

changeRole(membershipId, role)

  • membershipId (string, required)

  • role (RoleType, required) - CONTRIBUTOR or VIEWER

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

example
const { transactionId } = await akord.membership.changeRole(membershipId, "CONTRIBUTOR");

inviteResend(membershipId)

Resend email invitation:

  • membershipId (string, required)

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

example
const { transactionId } = await akord.membership.inviteResend(membershipId);

get(membershipId, options)

  • membershipId (string, required)

  • options (GetOptions, optional)

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

example
const membership = await akord.membership.get(membershipId);

listAll(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

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

example
const memberships = await akord.membership.listAll(vaultId);

list(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

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

example
// retrieve first 100 memberships for the vault
const { items } = await akord.membership.list(vaultId);

// retrieve first 20 memberships for the vault
const { items } = await akord.membership.list(vaultId, { limit: 20 });

// iterate through all memberships
let token = null;
let memberships = [];
do {
  const { items, nextToken } = await akord.membership.list(vaultId, { nextToken: token });
  memberships = memberships.concat(items);
  token = nextToken;
} while (token);

Last updated