Akord docs
  • Introduction
    • 👋About Akord
    • 🌇Akord–Arweave Sunsetting FAQs
    • Page
  • API & DEV TOOLS
    • 🕺Simple API upload
    • 🤓Learn
      • Akord protocol
        • Tags
        • Vault
          • Fields
          • Functions
            • vault:init
            • vault:update
            • vault:archive
            • vault:restore
        • Membership
          • Fields
          • Functions
            • membership:invite
            • membership:accept
            • membership:reject
            • membership:revoke
            • membership:change-role
            • membership:update
        • Node
          • Fields
          • Functions
            • node:create
            • node:update
            • node:move
            • node:revoke
            • node:restore
            • node:delete
      • Publishing a website
        • Troubleshooting website publishing
      • Technical Litepaper
      • End-to-end encryption
      • Bundling
    • 🏗️Build
      • REST API
        • Authentication
        • Rate limits
        • Timeouts
        • Webhooks
        • Examples
          • Simple uploads
          • Multipart uploads
      • SDK – AkordJS
        • Usage
        • Modules
          • Auth
          • Vault
          • Membership
          • Folder
          • Stack (file)
          • Manifest
          • Note
          • Memo (message)
          • Batch
        • Examples
      • CLI
        • Quick start
        • Login
        • Vaults
        • Files and stacks
        • Memos / messages
        • Folders
        • Memberships
      • Arweave Gateway – AKRD
  • App
    • 💻Product guides
      • Signing up
        • Akord Wallet
        • Recovery phrase explained
      • Akord Vaults
        • Vault types explained
        • Creating a vault
        • Vault info
      • File management
        • Uploading files
        • File info
        • Sort/filter, folders & batch actions
        • File versioning
      • Add manifest
      • Sharing files
      • Media gallery
      • Invites
      • Messaging
      • Notes
      • Timeline
      • Storage
        • Monitoring usage
        • Top ups
        • Blockchain transactions
      • Account
        • Reveal recovery phrase
        • Change password
        • Account deletion
Powered by GitBook
On this page

Was this helpful?

  1. API & DEV TOOLS
  2. Build
  3. SDK – AkordJS
  4. Modules

Vault

create(name, options)

  • name (string, required) - new vault name

  • options (VaultCreateOptions, optional) - public/private, terms of access, etc.

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

example
// create a private vault
const { vaultId, membershipId } = await akord.vault.create("my first private vault");

// create a public vault with terms of access
const { vaultId, membershipId } = await akord.vault.create(
  "my first public vault",
  { public: true, termsOfAccess: "terms of access here - if the vault is intended for professional or legal use, you can add terms of access and they must be digitally signed before accessing the vault" }
);

rename(vaultId, name)

  • vaultId (string, required)

  • name (string, required) - new vault name

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

example
const { transactionId } = await akord.vault.rename(vaultId, "updated name");

archive(vaultId)

  • vaultId (string, required)

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

example
const { transactionId } = await akord.vault.archive(vaultId);

restore(vaultId)

  • vaultId (string, required)

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

example
const { transactionId } = await akord.vault.restore(vaultId);

delete(vaultId)

  • vaultId (string, required)

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

example
const { transactionId } = await akord.vault.delete(vaultId);

get(vaultId, options)

  • vaultId (string, required)

  • returns Promise<Vault> - Promise with the vault object

example
const vault = await akord.vault.get(vaultId);

listAll(options)

  • returns Promise<Array<Vault>> - Promise with currently authenticated user vaults

example
const vaults = await akord.vault.listAll();

list(listOptions)

  • returns Promise<{ items, nextToken }> - Promise with paginated user vaults

example
// retrieve first 100 user vaults
const { items } = await akord.vault.list();

// retrieve first 20 user vaults
const { items } = await akord.vault.list({ limit: 20 });

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

Last updated 1 year ago

Was this helpful?

options (, optional)

options (, optional)

options (, optional)

🏗️
VaultGetOptions
ListOptions
ListOptions