# @snazzah/davey

> DAVE protocol implementation

Latest version **0.1.12** (published 2026-06-22) · MIT license · 1.5M weekly downloads

## Install

```sh
npm install @snazzah/davey
pnpm add @snazzah/davey
yarn add @snazzah/davey
bun add @snazzah/davey
```

## Health

**Score 80/100 (A)** — status: active.

Positive: high downloads; has types; no vulnerabilities; has provenance; high quality score.

Warnings: no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2026-06-22 |
| First published | 2025-03-21 |
| Weekly downloads | 1.5M |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 0 |
| Unpacked size | 37.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 75 |
| Author | Snazzah |
| Maintainers | snazzah |
| Keywords | discord, e2ee, mls, napi-rs, NAPI, N-API, Rust, node-addon, node-addon-api |

## Links

- npm: https://www.npmjs.com/package/@snazzah/davey
- Repository: https://github.com/Snazzah/davey
- Homepage: https://github.com/Snazzah/davey#readme
- Issues: https://github.com/Snazzah/davey/issues
- Funding: https://github.com/sponsors/Snazzah
- npm.io page: https://npm.io/package/@snazzah/davey

## Alternatives

- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads
- [@lowdefy/block-dev-e2e](https://npm.io/package/@lowdefy/block-dev-e2e.md) — 582 weekly downloads

## Recent versions

- 0.1.12 (latest) — 2026-06-22
- 0.1.11 — 2026-03-29
- 0.1.10 — 2026-03-02
- 0.1.9 — 2025-12-19
- 0.1.8 — 2025-11-17
- 0.1.7 — 2025-09-24
- 0.1.6 — 2025-06-10
- 0.1.5 — 2025-06-05
- 0.1.4 — 2025-06-01
- 0.1.3 — 2025-05-27
- 0.1.2 — 2025-04-04
- 0.1.1 — 2025-03-22
- 0.1.0 — 2025-03-21

## README

# Davey!

[![NPM version](https://img.shields.io/npm/v/@snazzah/davey?maxAge=3600)](https://www.npmjs.com/package/@snazzah/davey) [![install size](https://packagephobia.com/badge?p=@snazzah/davey)](https://packagephobia.com/result?p=@snazzah/davey) [![NPM downloads](https://img.shields.io/npm/dt/@snazzah/davey?maxAge=3600)](https://www.npmjs.com/package/@snazzah/davey) [![discord chat](https://img.shields.io/discord/311027228177727508?logo=discord&logoColor=white&color=5865F2)](https://snaz.in/discord)

A [Discord Audio & Video End-to-End Encryption (DAVE) Protocol](https://daveprotocol.com/) implementation using [OpenMLS](https://openmls.tech/) built with [NAPI-RS](https://napi.rs/).

> Proper documentation does not exist yet, but you can [read the usage document](https://github.com/Snazzah/davey/blob/master/docs/USAGE.md) and review the [type definitions](https://github.com/Snazzah/davey/blob/master/index.d.ts) for available methods.

```ts
import { DAVESession, ProposalsOperationType, MediaType, Codec } from '@snazzah/davey';

const session = new DAVESession(
  1, // dave version
  '158049329150427136', // user id
  '927310423890473011', // channel id
);

// Set the external sender of the session from opcode 25
session.setExternalSender(externalSenderBuffer);

// Get the key package buffer to send to Discord
session.getSerializedKeyPackage();

// Process a proposals
session.processProposals(
  ProposalsOperationType.APPEND, // the type of proposals operation
  proposalsBuffer, // proposals or proposal refs buffer
  recognizedUserIds, // an array of user IDs in the session, optional but recommended
);

// Process a commit
session.processCommit(commitBuffer);

// Process a welcome
session.processWelcome(welcomeBuffer);

// The current voice privacy code of the session, updated after a commit/welcome
session.voicePrivacyCode; // a 30 digit string or an empty string for not started sessions

// Encrypt/decrypt voice packets
if (session.ready) {
  // Encrypt packets with a specified media type and codec, use this before transport encryption
  session.encrypt(MediaType.AUDIO, Codec.OPUS, packet);
  // Really only opus is supported right now so just use the shorthand method
  session.encryptOpus(packet);
  // Decrypt a packet from a user, use this after transport decryption
  session.decrypt(userId, MediaType.AUDIO, incomingPacket);
}
```

#### References

- [daveprotocol.com](https://daveprotocol.com/)
- [discord/libdave](https://github.com/discord/libdave)
- [Discord Dev Docs - Voice - E2EE](https://discord.com/developers/docs/topics/voice-connections#endtoend-encryption-dave-protocol)
- [NAPI-RS](https://napi.rs/docs/introduction/getting-started)
- [OpenMLS Book](https://book.openmls.tech/introduction.html)
- [Voice Model - High Level Summary - DPP](https://dpp.dev/voice-model.html)

---
_Source: https://npm.io/package/@snazzah/davey · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
