{"_id":"@dtelecom/vodozemac-wasm","_rev":"3-badcb6e989e978d2128264852e687c55","name":"@dtelecom/vodozemac-wasm","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@dtelecom/vodozemac-wasm","version":"0.1.0","license":"Apache-2.0","_id":"@dtelecom/vodozemac-wasm@0.1.0","maintainers":[{"name":"fffilimonov","email":"vadim@dtelecom.org"},{"name":"grimstun","email":"00_twangs.fervour@icloud.com"}],"homepage":"https://github.com/dTelecom/vodozemac-wasm#readme","bugs":{"url":"https://github.com/dTelecom/vodozemac-wasm/issues"},"dist":{"shasum":"76b31517c83f0eb98fe61261f403580c01382724","tarball":"https://registry.npmjs.org/@dtelecom/vodozemac-wasm/-/vodozemac-wasm-0.1.0.tgz","fileCount":17,"integrity":"sha512-evF9hUblDdpNAHtUwY4Xl/3sfFkRHLbaGToUqXaSaFrziPj36wQRlL4n1TtTffTMToY6Wfh3FQOsNlOCEwuobg==","signatures":[{"sig":"MEUCIBR//JcH2LtTv05+BdcPWN4qF2pWdCNZdjc4K79jBOy/AiEA5oqVek/mo9HBdw52c05rI2kD+bFmpisXT6iK7rfXxSk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":897602},"type":"module","exports":{".":{"node":{"types":"./pkg-node/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-node/dtelecom_vodozemac_wasm.js"},"browser":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"},"default":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"}}},"gitHead":"677073d9c3b51bcf2a0d7265ece6a051928827f9","scripts":{"build":"npm run build:web && npm run build:node","clean":"rm -rf pkg pkg-web pkg-node target","build:web":"wasm-pack build --target web --release --out-dir pkg-web","build:node":"wasm-pack build --target nodejs --release --out-dir pkg-node"},"_npmUser":{"name":"fffilimonov","email":"vadim@dtelecom.org"},"repository":{"url":"git+https://github.com/dTelecom/vodozemac-wasm.git","type":"git"},"_npmVersion":"10.9.2","description":"Browser/Node WASM bindings for vodozemac (Olm primitives), tailored for non-Matrix chat use.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vodozemac-wasm_0.1.0_1778401006442_0.6186319343345261","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dtelecom/vodozemac-wasm","version":"0.2.0","license":"Apache-2.0","_id":"@dtelecom/vodozemac-wasm@0.2.0","maintainers":[{"name":"fffilimonov","email":"vadim@dtelecom.org"},{"name":"grimstun","email":"00_twangs.fervour@icloud.com"}],"homepage":"https://github.com/dTelecom/vodozemac-wasm#readme","bugs":{"url":"https://github.com/dTelecom/vodozemac-wasm/issues"},"dist":{"shasum":"776cecd440a977cfb81e7e499dccf20980b2a227","tarball":"https://registry.npmjs.org/@dtelecom/vodozemac-wasm/-/vodozemac-wasm-0.2.0.tgz","fileCount":25,"integrity":"sha512-Y7gzKpXwJ2KtOX4/IMxwN5tskZS8RYOAOI89l3cSxS99naznXCp572uR4+zp/Epa56wKepCU3S86Oz4vb7cbYQ==","signatures":[{"sig":"MEYCIQD7q25Nj/lKeJfll7K/+HhLJ/yPRnL3wwvTXB2MVIQPZAIhAL4BX3k/ukuaWpbP4LPy+/j9eVVlFmOyTowF/nqbMAr4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1471476},"type":"module","exports":{".":{"node":{"types":"./pkg-node/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-node/dtelecom_vodozemac_wasm.js"},"browser":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"},"default":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"},"react-native":{"types":"./pkg-rn/index.d.ts","default":"./pkg-rn/index.js"}}},"gitHead":"32880b4e42b2e6d84f1d43cf65e3d23790c8e75f","scripts":{"build":"npm run build:web && npm run build:node && npm run build:rn","clean":"rm -rf pkg pkg-web pkg-node pkg-rn target","build:rn":"node scripts/build-rn.mjs","build:web":"wasm-pack build --target web --release --out-dir pkg-web","build:node":"wasm-pack build --target nodejs --release --out-dir pkg-node"},"_npmUser":{"name":"fffilimonov","email":"vadim@dtelecom.org"},"repository":{"url":"git+https://github.com/dTelecom/vodozemac-wasm.git","type":"git"},"_npmVersion":"10.9.2","description":"Browser/Node/RN WASM bindings for vodozemac (Olm primitives), tailored for non-Matrix chat use.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vodozemac-wasm_0.2.0_1778674650602_0.765563942905644","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dtelecom/vodozemac-wasm","version":"0.3.0","description":"Browser/Node WASM bindings for vodozemac (Olm primitives), tailored for non-Matrix chat use.","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dTelecom/vodozemac-wasm.git"},"type":"module","exports":{".":{"node":{"types":"./pkg-node/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-node/dtelecom_vodozemac_wasm.js"},"browser":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"},"default":{"types":"./pkg-web/dtelecom_vodozemac_wasm.d.ts","default":"./pkg-web/dtelecom_vodozemac_wasm.js"}}},"scripts":{"build:web":"wasm-pack build --target web --release --out-dir pkg-web","build:node":"wasm-pack build --target nodejs --release --out-dir pkg-node","build":"npm run build:web && npm run build:node","clean":"rm -rf pkg pkg-web pkg-node target"},"_id":"@dtelecom/vodozemac-wasm@0.3.0","gitHead":"32880b4e42b2e6d84f1d43cf65e3d23790c8e75f","bugs":{"url":"https://github.com/dTelecom/vodozemac-wasm/issues"},"homepage":"https://github.com/dTelecom/vodozemac-wasm#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-gELGj7KoqID7BLCmI+TqO6tq0/3CSenEPvvFZN8pcgGG+2QH69Rw0lbY1X8PNwRAXiH9LKedcPCcM++QF6LOPw==","shasum":"fbbd185118ec115193318affb0c1bc46bf3d8b42","tarball":"https://registry.npmjs.org/@dtelecom/vodozemac-wasm/-/vodozemac-wasm-0.3.0.tgz","fileCount":19,"unpackedSize":923106,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHodzd7GfKSCTqGdUtziLX3V0kAsveHZzaSmc4ppNYG4AiEAl5e3Fo9pqZO1mjESBWVmUMOX+MADAftFMGmkkK+0X3Y="}]},"_npmUser":{"name":"fffilimonov","email":"vadim@dtelecom.org"},"directories":{},"maintainers":[{"name":"fffilimonov","email":"vadim@dtelecom.org"},{"name":"grimstun","email":"00_twangs.fervour@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vodozemac-wasm_0.3.0_1778745115225_0.3186911894761004"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-10T08:16:46.320Z","modified":"2026-05-14T07:51:55.554Z","0.1.0":"2026-05-10T08:16:46.647Z","0.2.0":"2026-05-13T12:17:30.785Z","0.3.0":"2026-05-14T07:51:55.422Z"},"bugs":{"url":"https://github.com/dTelecom/vodozemac-wasm/issues"},"license":"Apache-2.0","homepage":"https://github.com/dTelecom/vodozemac-wasm#readme","repository":{"type":"git","url":"git+https://github.com/dTelecom/vodozemac-wasm.git"},"description":"Browser/Node WASM bindings for vodozemac (Olm primitives), tailored for non-Matrix chat use.","maintainers":[{"name":"fffilimonov","email":"vadim@dtelecom.org"},{"name":"grimstun","email":"00_twangs.fervour@icloud.com"}],"readme":"# @dtelecom/vodozemac-wasm\n\nBrowser + Node + React Native WASM bindings for [vodozemac](https://github.com/matrix-org/vodozemac), exposing only the Olm primitives needed for non-Matrix 1:1 chat protocols. No Matrix-specific types, no protocol assumptions about user/device id shape.\n\nBuilt from a small Rust crate that wraps `vodozemac` via `wasm-bindgen`. Same wire format as libolm (Olm v1), so existing libolm-pickled state is migration-friendly via the standalone `vodozemac::olm::libolm_compat` path (not exposed in v0.1.0 — add when needed).\n\n## Why\n\n`@matrix-org/olm` (libolm) has been EOL since Oct 2023 with known CVEs. The Matrix-recommended successor (`@matrix-org/matrix-sdk-crypto-wasm`) only exposes the high-level Matrix-protocol `OlmMachine`, not raw Olm primitives. This package fills the gap.\n\n## API surface\n\n```ts\nimport init, { Account, Session, InboundResult } from \"@dtelecom/vodozemac-wasm\";\n// Node loads WASM synchronously at module import — `init()` is a no-op.\n// Browser fetches the .wasm asset on first init().\n// React Native (Hermes V1 / RN 0.84+) decodes the embedded base64 on first init().\n// Same call site in all three; the conditional package exports route to the\n// right loader automatically.\nawait init();\n\nconst a = new Account();\na.identityKeys();                               // { curve25519, ed25519 }\na.generateOneTimeKeys(100);\na.oneTimeKeys();                                // { curve25519: { <id>: <publicKey>, ... } }\na.markKeysAsPublished();\na.generateFallbackKey();\na.fallbackKey();\na.sign(\"message\");                              // base64 Ed25519 sig\nconst pickle: string = a.pickle();\nconst restored = Account.fromPickle(pickle);\n\n// Outbound:\nconst session: Session = a.createOutboundSession(theirIdKey, theirOTK);\nconst { type, body } = session.encrypt(\"hi\");   // type=0 prekey, type=1 normal\n\n// Inbound:\nconst result: InboundResult = a.createInboundSession(theirIdKey, prekeyBody);\nconst session2 = result.takeSession();\nconst plaintext = result.plaintext;\n\n// Persistence:\nconst sp: string = session.pickle();\nconst restored2 = Session.fromPickle(sp);\n```\n\n## Build\n\nRequires Rust 1.85+ (edition 2024) and `wasm-pack`.\n\n```sh\nnpm run build       # all three targets\nnpm run build:web   # browser bundlers (vite, webpack)\nnpm run build:node  # Node test runners\nnpm run build:rn    # React Native (Hermes V1 / RN 0.84+) — derives from pkg-web; no Rust rebuild\n```\n\nOutput:\n- `pkg-web/` — ESM, browser-targeted; calls `init(url)` to load `.wasm` via fetch\n- `pkg-node/` — CommonJS-like, Node-targeted; loads `.wasm` synchronously via `fs`\n- `pkg-rn/` — ESM, React Native-targeted (Hermes V1 / RN 0.84+); WASM bytes are base64-embedded into the JS bundle so Metro doesn't need to ship them as a separate asset. The browser glue is reused with `__wbg_init` and `__wbg_load` stripped (those depend on `import.meta.url` + `fetch` which Metro can't resolve to a real `.wasm` asset). Caller calls the default async `init()` once; subsequent calls are no-ops.\n\nBundle size: ~400 KB raw WASM, ~150 KB gzipped (vs libolm's ~750 KB unoptimized). The RN target adds ~520 KB of base64 string for the WASM bytes — measurable but acceptable for an RN bundle.\n\n## Status\n\nv0.2.0 — adds the React Native target (`pkg-rn/`). Same Olm primitives as v0.1.0, no API or wire-format changes from the consumer's POV. Megolm (group sessions), libolm-pickle migration, and SAS verification still not bound — add when a consumer needs them.\n","readmeFilename":"README.md"}