{"_id":"@dengxifeng/davey","name":"@dengxifeng/davey","dist-tags":{"latest":"0.1.9"},"versions":{"0.1.9":{"name":"@dengxifeng/davey","version":"0.1.9","description":"DAVE protocol implementation","main":"index.js","types":"index.d.ts","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/Snazzah/davey.git"},"license":"MIT","author":{"name":"Snazzah","email":"me@snazzah.com","url":"https://snazzah.com/"},"funding":{"url":"https://github.com/sponsors/Snazzah"},"keywords":["discord","e2ee","mls","napi-rs","NAPI","N-API","Rust","node-addon","node-addon-api"],"napi":{"binaryName":"davey","targets":["x86_64-apple-darwin","aarch64-apple-darwin","x86_64-unknown-linux-gnu","x86_64-pc-windows-msvc","x86_64-unknown-linux-musl","aarch64-unknown-linux-gnu","i686-pc-windows-msvc","armv7-unknown-linux-gnueabihf","aarch64-linux-android","x86_64-unknown-freebsd","aarch64-unknown-linux-musl","aarch64-pc-windows-msvc","armv7-linux-androideabi","riscv64gc-unknown-linux-gnu","wasm32-wasi-preview1-threads"]},"engines":{"node":">= 10"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"devDependencies":{"@emnapi/core":"^1.3.1","@emnapi/runtime":"^1.3.1","@napi-rs/cli":"^3.1.5","@napi-rs/wasm-runtime":"^0.2.7","@noble/hashes":"1.5.0","@oxc-node/core":"^0.0.20","@taplo/cli":"^0.7.0","@types/node":"^22.13.5","@tybys/wasm-util":"^0.9.0","ava":"^6.2.0","base64-js":"1.5.1","emnapi":"^1.3.1","mitata":"^1.0.34","npm-run-all2":"^7.0.2","oxlint":"^0.15.12","prettier":"^3.5.2","typescript":"^5.7.3"},"ava":{"extensions":{"ts":"module"},"files":["test/**/*"],"timeout":"2m","workerThreads":false,"environmentVariables":{"TS_NODE_PROJECT":"./tsconfig.json"},"nodeArguments":["--import","@oxc-node/core/register"]},"prettier":{"printWidth":120,"semi":true,"trailingComma":"all","singleQuote":true,"arrowParens":"always"},"optionalDependencies":{"@snazzah/davey-darwin-x64":"0.1.9","@snazzah/davey-darwin-arm64":"0.1.9","@snazzah/davey-linux-x64-gnu":"0.1.9","@snazzah/davey-win32-x64-msvc":"0.1.9","@snazzah/davey-linux-x64-musl":"0.1.9","@snazzah/davey-linux-arm64-gnu":"0.1.9","@snazzah/davey-win32-ia32-msvc":"0.1.9","@snazzah/davey-linux-arm-gnueabihf":"0.1.9","@snazzah/davey-android-arm64":"0.1.9","@snazzah/davey-freebsd-x64":"0.1.9","@snazzah/davey-linux-arm64-musl":"0.1.9","@snazzah/davey-win32-arm64-msvc":"0.1.9","@snazzah/davey-android-arm-eabi":"0.1.9","@dengxifeng/davey-linux-riscv64-gnu":"0.1.9","@snazzah/davey-wasm32-wasi":"0.1.9"},"scripts":{"artifacts":"napi artifacts","bench":"node --import @oxc-node/core/register --expose-gc benchmark/bench.ts","build":"napi build --platform --release","build:debug":"napi build --platform","format":"run-p format:prettier format:rs format:toml","changelog":"node --import @oxc-node/core/register scripts/changelog.mts","format:prettier":"prettier . -w","format:toml":"taplo format","format:rs":"cargo fmt","lint":"oxlint","test":"ava","version":"napi version"},"_id":"@dengxifeng/davey@0.1.9","bugs":{"url":"https://github.com/Snazzah/davey/issues"},"homepage":"https://github.com/Snazzah/davey#readme","_integrity":"sha512-UbsNqiKmGCEjQZjsaRd6lFRQg4u9e/jtirC+mRbtrr18d5ZwmE8HnCx7/ByhwL5XY/kfVpjJ7j9V+o/c8JK7GA==","_resolved":"/tmp/d1801d55f1d524441fc44ea8bc16c44a/dengxifeng-davey-0.1.9.tgz","_from":"file:dengxifeng-davey-0.1.9.tgz","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-UbsNqiKmGCEjQZjsaRd6lFRQg4u9e/jtirC+mRbtrr18d5ZwmE8HnCx7/ByhwL5XY/kfVpjJ7j9V+o/c8JK7GA==","shasum":"64d05c1a4c6a8c8c34656a52d954adb443cf6b50","tarball":"https://registry.npmjs.org/@dengxifeng/davey/-/davey-0.1.9.tgz","fileCount":5,"unpackedSize":38498,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHDx6r0prD5HS3KlkQEEAnI8ciq6GmjOuTmpaGy3NSimAiEAyV+zx4cTzt3yfdhAYsdCNKUDqL8TB7A8PnavpGAn5Ao="}]},"_npmUser":{"name":"dengxifeng","email":"deng.xifeng@163.com"},"directories":{},"maintainers":[{"name":"dengxifeng","email":"deng.xifeng@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/davey_0.1.9_1773308451640_0.6925646142045663"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-12T09:40:51.504Z","0.1.9":"2026-03-12T09:40:51.798Z","modified":"2026-03-12T09:40:52.033Z"},"maintainers":[{"name":"dengxifeng","email":"deng.xifeng@163.com"}],"description":"DAVE protocol implementation","homepage":"https://github.com/Snazzah/davey#readme","keywords":["discord","e2ee","mls","napi-rs","NAPI","N-API","Rust","node-addon","node-addon-api"],"repository":{"type":"git","url":"git+https://github.com/Snazzah/davey.git"},"author":{"name":"Snazzah","email":"me@snazzah.com","url":"https://snazzah.com/"},"bugs":{"url":"https://github.com/Snazzah/davey/issues"},"license":"MIT","readme":"# Davey!\n\n[![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)\n\nA [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/).\n\n> 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.\n\n```ts\nimport { DAVESession, ProposalsOperationType, MediaType, Codec } from '@snazzah/davey';\n\nconst session = new DAVESession(\n  1, // dave version\n  '158049329150427136', // user id\n  '927310423890473011', // channel id\n);\n\n// Set the external sender of the session from opcode 25\nsession.setExternalSender(externalSenderBuffer);\n\n// Get the key package buffer to send to Discord\nsession.getSerializedKeyPackage();\n\n// Process a proposals\nsession.processProposals(\n  ProposalsOperationType.APPEND, // the type of proposals operation\n  proposalsBuffer, // proposals or proposal refs buffer\n  recognizedUserIds, // an array of user IDs in the session, optional but recommended\n);\n\n// Process a commit\nsession.processCommit(commitBuffer);\n\n// Process a welcome\nsession.processWelcome(welcomeBuffer);\n\n// The current voice privacy code of the session, updated after a commit/welcome\nsession.voicePrivacyCode; // a 30 digit string or an empty string for not started sessions\n\n// Encrypt/decrypt voice packets\nif (session.ready) {\n  // Encrypt packets with a specified media type and codec, use this before transport encryption\n  session.encrypt(MediaType.AUDIO, Codec.OPUS, packet);\n  // Really only opus is supported right now so just use the shorthand method\n  session.encryptOpus(packet);\n  // Decrypt a packet from a user, use this after transport decryption\n  session.decrypt(userId, MediaType.AUDIO, incomingPacket);\n}\n```\n\n#### References\n\n- [daveprotocol.com](https://daveprotocol.com/)\n- [discord/libdave](https://github.com/discord/libdave)\n- [Discord Dev Docs - Voice - E2EE](https://discord.com/developers/docs/topics/voice-connections#endtoend-encryption-dave-protocol)\n- [NAPI-RS](https://napi.rs/docs/introduction/getting-started)\n- [OpenMLS Book](https://book.openmls.tech/introduction.html)\n- [Voice Model - High Level Summary - DPP](https://dpp.dev/voice-model.html)\n","readmeFilename":"README.md","_rev":"1-e1ea45129e8216cbbfde31aa50abc949"}