npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vex-chat/libvex

v5.0.0

Published

Library for communicating with xchat server.

Downloads

1,435

Readme

@vex-chat/libvex

npm CI Released License Types Type Coverage Node Bundle OpenSSF Scorecard Socket

Reference TypeScript client for the Vex encrypted chat platform. Builds against the wire protocol defined in @vex-chat/types and the cryptographic primitives in @vex-chat/crypto. Use it to build a chat client, a bot, or any application that needs to talk to a spire server.

Documentation

What's in the box

The client implements an X3DH-style handshake (X25519 DH + KDF), XSalsa20-Poly1305 (xSecretbox) for payloads, and HMAC over mail objects for integrity on the wire. Message payloads are intended to be end-to-end encrypted; the server still sees ciphertext, routing metadata, timing, and who talks to whom, and controls key-bundle distribution—so a malicious or compromised Spire can mount impersonation unless users verify sessions out-of-band.

  • End-to-end encrypted messaging with X3DH key agreement — sessions, prekeys, and one-time keys handled internally.
  • Tree-shakable subpath exports for platform-specific code: ./preset/node, ./preset/test, ./storage/node, ./storage/sqlite, ./storage/schema, ./keystore/node, ./keystore/memory. Browser bundles never pull in better-sqlite3 or other native modules.
  • Pluggable storage backend via Kysely so node consumers can use SQLite and browser/tauri/expo consumers can wire their own.
  • Pluggable key store so secrets can live in memory (tests), the OS keychain (./keystore/node), or wherever the embedding app keeps them.
  • WebSocket transport for live message delivery with automatic reconnection and HTTP fallback for the REST API.

Install

npm install @vex-chat/libvex

@vex-chat/types, @vex-chat/crypto, axios, kysely, winston, and zod are required runtime dependencies and install automatically.

better-sqlite3 is an optional peer dependency — install it explicitly only if you plan to use the SQLite storage backend on Node:

npm install @vex-chat/libvex better-sqlite3

Browser, Tauri, and Expo consumers should leave better-sqlite3 out and supply their own storage adapter via ./storage/schema.

Quickstart

import { Client } from "@vex-chat/libvex";

// Generate or load a long-lived secret key — store it in the OS keychain.
const secretKey = Client.generateSecretKey();

const client = await Client.create(secretKey);

// First-time devices must register before logging in.
await client.register(Client.randomUsername());
await client.login();

client.on("authed", async () => {
    const me = await client.users.me();
    await client.messages.send(me.userID, "Hello world!");
});

client.on("message", (message) => {
    console.log("message:", message);
});

Platform presets

libvex ships per-platform "presets" that wire together the appropriate storage and keystore:

// Node — sqlite storage + OS keychain
import {
    Client,
    makeStorage,
    BootstrapConfig,
} from "@vex-chat/libvex/preset/node";

// Tests / ephemeral — in-memory storage + memory keystore
import {
    Client,
    makeStorage,
    BootstrapConfig,
} from "@vex-chat/libvex/preset/test";

For a custom platform (browser, tauri, expo), import Client from @vex-chat/libvex directly and supply your own Storage (implementing the schema in @vex-chat/libvex/storage/schema) and KeyStore to Client.create.

Development

npm run build           # tsc -p tsconfig.build.json
npm run lint            # eslint
npm run lint:fix        # eslint --fix
npm run format          # prettier --write
npm run format:check
npm test                # vitest unit suite (browser-safe, no spire required)
npm run test:e2e        # vitest node + browser e2e — needs a running spire
npm run lint:pkg        # publint --strict
npm run lint:types      # @arethetypeswrong/cli
npm run lint:api        # api-extractor — regenerates api/libvex.api.md
npx type-coverage       # type-coverage (≥95%)
npm run license:check   # license allowlist gate
npm run docs            # typedoc — writes ./docs

The unit suite (npm test) runs browser-safe and offline. The e2e suite (npm run test:e2e) spins up a real spire server in a separate process — point VEX_API_URL at a running spire if you want to test against a different host.

See AGENTS.md for the release flow (changesets → publish) and the rules for writing changesets.

License

AGPL-3.0-or-later