🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@elementaio/vox-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elementaio/vox-sdk

Framework-agnostic client SDK for Vox — self-owned identity, end-to-end sign-then-seal crypto, relay transport, message ops, calls, and media. Ships no storage engine and no UI; you inject those.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@elementaio/vox-sdk

The framework-agnostic client SDK for Vox — a self-hosted, end-to-end-encrypted messenger where the relay is a post office, not an archive.

This package is everything a client needs to speak the Vox protocol: self-owned identity, sign-then-seal E2E crypto, the relay transport + all message operations (text, edit/delete/react/reply, receipts, typing), voice/video call signaling, and encrypted media. It ships no storage engine and no UI — you inject those — so the same core runs a web app, a desktop/mobile app, or a headless bot.

Published on npm as @elementaio/vox-sdk (ESM + type declarations, built with tsup). Also a workspace package (packages/sdk) that the in-repo web app consumes via a @elementaio/vox-sdk alias to its TypeScript source. npm i @elementaio/vox-sdk.

What you inject

PortWhat it isBrowser example
Storedurable message/contact/media history (the source of truth lives on the device)IndexedDB
KVStoresmall key-value for the encrypted account vault + device idlocalStorage
relay URLssocketUrl (ws) + httpBase (http)derived from the page origin
ClientEventsUI callbacks (onMessage, onPresence, onCallState, …)React state setters

The SDK never imports a database, a UI framework, or a hardcoded server address.

Quick start

import {
  createIdentity, Vault, Client,
  type Identity, type Store, type ClientEvents,
} from "@elementaio/vox-sdk";

// 1. Identity (self-owned keypair; 12-word backup). Persist it under a passphrase.
const id: Identity = createIdentity();
const vault = new Vault(localStorage);      // any KVStore
await vault.persist(id, "correct horse battery staple");

// 2. Supply a Store (durable history). Implement over IndexedDB / SQLite / memory.
const store: Store = myStore;

// 3. Connect. Events drive your UI.
const events: ClientEvents = { onMessage: render, /* …the rest… */ } as ClientEvents;
const client = new Client({
  socketUrl: "wss://relay.example.com/socket",
  httpBase:  "https://relay.example.com",
  identity: id,
  store,
  events,
  deviceId: vault.deviceId(),
});
client.connect(await loadContacts());
await client.sendText(recipientPubkeyHex, "Hello over Vox 👋");

Surface

  • IdentitycreateIdentity, restoreIdentity, sign, authParams, Vault.
  • Cryptoseal, open, deriveEncryptionKey (+ SealedEnvelope, OpenedMessage).
  • ClientClient (text, media, edit/delete/react, receipts, typing, presence, voice/video calls) + ClientConfig, ClientEvents.
  • MediaencryptAndUpload, downloadAndDecrypt.
  • Discovery / onboardinginviteToken, parseInvite, enroll.
  • ProtocolPROTOCOL_VERSION, inboxTopic, EVENTS, SOCKET_PATH.
  • Model & portsStore, KVStore, StoredMessage, StoredContact, MediaRef, Body, PresenceInfo, CallState.

Dependencies

Audited primitives only: @noble/curves (Ed25519 + X25519), @noble/ciphers (XChaCha20-Poly1305), @noble/hashes, @scure/bip39. Transport uses phoenix (peer dependency). Calls use the platform's WebRTC (RTCPeerConnection) when present — absent in Node, so a headless bot simply doesn't place calls; messaging works everywhere.

Keywords

vox

FAQs

Package last updated on 03 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts