@vaultdrop/sdk

VaultDrop SDK for browsers — Web Crypto AES-GCM and API client for React, Vue, Angular, and other frontend frameworks
1,147
Install
npm install @vaultdrop/sdk
Latest Version:1.0.6
License:MIT
Last Updated:Mar 30, 2026
Links: npm
Maintainer: vaultdrop

@vaultdrop/sdk

Browser SDK for VaultDrop: AES-256-GCM (same format as the web app) and fetch helpers for creating secure links. Use it from React, Vue, Angular, or any app bundled with Vite, Webpack, or similar.

Plaintext and keys stay in the browser; the API only receives ciphertext.

Requirements

  • A secure context (typically HTTPS, or localhost in dev) so crypto.subtle is available.
  • fetch (standard in modern browsers).

Install

npm install @vaultdrop/sdk

Usage

Build FileInput values from <input type="file">, File.arrayBuffer(), or Uint8Array / ArrayBuffer.

import { VaultDropClient } from "@vaultdrop/sdk";

const client = new VaultDropClient({
  apiKey: import.meta.env.VITE_VAULTDROP_API_KEY,
  workspaceId: 'ws-[WORKSPACE-ID]', // workspace id string, e.g. "ws-1234567890"
});

const { url, expiresAt } = await client.createSecureLink({
  text: "Secret message",
  expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
});
// `url` is the full share link; `expiresAt` matches the expiry you requested.

Attachments from a file input:

async function onFileSelected(file: File) {
  const data = new Uint8Array(await file.arrayBuffer());
  await client.createSecureLink({
    text: "See attachment",
    files: [{ name: file.name, mimeType: file.type || "application/octet-stream", data }],
    expiresAt: new Date(Date.now() + 86_400_000),
  });
}

API keys in the browser

A token embedded in frontend code can be extracted. For public sites, prefer a backend you control that holds the token and talks to VaultDrop. Client-side keys are mainly for internal or trusted tools.

CORS

If the API lives on another origin, that API must allow your app’s origin and headers such as Authorization and X-Workspace-Id for the vault-link and upload endpoints.

License

MIT

Related Packages

@agnostico/browser-solidity-compiler

Solidity compiler that works in the browser

1,548 18
waelio-utils

Helper Utils often used in websites

8,166 1
portfolio-github-integration

Browser-native library to fetch GitHub repositories and custom metadata for dyna...

1,360
@abarchibody/storage

Storage is plugin that help to store data in the local storage, or retrieve data

935
@frostsw/frostjs

A lightweight JS for basic DOM manipulation and more.

739

Version History

Version Released License
1.0.6 MIT
1.0.5 MIT
1.0.4 MIT
1.0.3 MIT
1.0.2 MIT