{"_id":"@afterrealism/dendri-y","_rev":"3-b7705e439dbe64871237959892f18976","name":"@afterrealism/dendri-y","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@afterrealism/dendri-y","version":"0.1.0","keywords":["yjs","crdt","dendri","webrtc","p2p","collaboration"],"license":"MIT","_id":"@afterrealism/dendri-y@0.1.0","maintainers":[{"name":"afterrealism","email":"contact@afterrealism.com"}],"homepage":"https://dendri.dev","bugs":{"url":"https://github.com/afterrealism/dendri-packages/issues"},"dist":{"shasum":"9a42ee16a4efb61162962a53c500046c4c6f9047","tarball":"https://registry.npmjs.org/@afterrealism/dendri-y/-/dendri-y-0.1.0.tgz","fileCount":9,"integrity":"sha512-ttbrpMablG+ADvDEPDue6/TBseoYL1118rxH3RCtMw5IoM3lgubresRJhY+2hc0fwBov8asUAupBP5UjB6ZJ9Q==","signatures":[{"sig":"MEYCIQC0rm4XF+ZPVFu9iwrDUDYBqPISjfL0c7XxQosATBfx+AIhANX6IxA9krmYR8WaSj4H7n606JidSzEfEvVjZT5ZARty","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34551},"main":"./dist/dendri-y.cjs","type":"module","types":"./dist/dendri-y.d.ts","module":"./dist/dendri-y.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/dendri-y.d.ts","default":"./dist/dendri-y.js"},"require":{"types":"./dist/dendri-y.d.cts","default":"./dist/dendri-y.cjs"}}},"gitHead":"4deaac882a801b2e59f9eb7b46edd17a25447c5e","scripts":{"build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","build:watch":"tsup --watch","prepublishOnly":"npm run build"},"_npmUser":{"name":"afterrealism","email":"contact@afterrealism.com"},"repository":{"url":"git+https://github.com/afterrealism/dendri-packages.git","type":"git","directory":"dendri-y"},"_npmVersion":"10.9.4","description":"Yjs CRDT provider on top of Dendri P2P rooms","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1","devDependencies":{"yjs":"^13.6.30","tsup":"^8.0.0","typescript":"^5.7.0","y-protocols":"^1.0.7"},"peerDependencies":{"yjs":"^13.6.0","y-protocols":"^1.0.0","@afterrealism/dendri-client":"^2.3.7"},"_npmOperationalInternal":{"tmp":"tmp/dendri-y_0.1.0_1777706616855_0.022973568233540798","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@afterrealism/dendri-y","version":"0.1.1","type":"module","packageManager":"pnpm@10.30.1","description":"Yjs CRDT provider on top of Dendri P2P rooms","keywords":["yjs","crdt","dendri","webrtc","p2p","collaboration"],"homepage":"https://dendri.dev","bugs":{"url":"https://github.com/afterrealism/dendri-packages/issues"},"repository":{"type":"git","url":"git+https://github.com/afterrealism/dendri-packages.git","directory":"dendri-y"},"license":"Apache-2.0","main":"./dist/dendri-y.cjs","module":"./dist/dendri-y.js","types":"./dist/dendri-y.d.ts","exports":{".":{"import":{"types":"./dist/dendri-y.d.ts","default":"./dist/dendri-y.js"},"require":{"types":"./dist/dendri-y.d.cts","default":"./dist/dendri-y.cjs"}}},"sideEffects":false,"publishConfig":{"access":"public"},"engines":{"node":">=18"},"scripts":{"build":"tsup","build:watch":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build","clean":"rm -rf dist"},"peerDependencies":{"y-protocols":"^1.0.0","yjs":"^13.6.0","@afterrealism/dendri-client":"^2.3.7"},"devDependencies":{"@afterrealism/dendri-client":"file:../dendri-client","tsup":"^8.0.0","typescript":"^5.7.0","vitest":"^3.1.1","y-protocols":"^1.0.7","yjs":"^13.6.30"},"_id":"@afterrealism/dendri-y@0.1.1","gitHead":"6f853e0372168d77c3337851537e82b8aae9d6fb","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-Cq7t6cMJT6CadYmkverOF9zl7sYqJSFX1iBIKxqrTOCTHZQ1ZcJsiUI38jFlX70if6af8qgZyErHWYb+ABTsRA==","shasum":"d69a4b80b9f504e151f2f0b5cf46800a1b8edbd9","tarball":"https://registry.npmjs.org/@afterrealism/dendri-y/-/dendri-y-0.1.1.tgz","fileCount":9,"unpackedSize":44429,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDQBF1L0qBKurbzc7H9HEDfmr0toGutxIt5P58YcK8YWgIgO6bt98k04jOpd5PSjitjityc/TWDusWPbeZlSi1xgJk="}]},"_npmUser":{"name":"afterrealism","email":"contact@afterrealism.com"},"directories":{},"maintainers":[{"name":"afterrealism","email":"contact@afterrealism.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dendri-y_0.1.1_1782989469198_0.1162852690474574"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T07:23:36.730Z","modified":"2026-07-02T10:51:09.449Z","0.1.0":"2026-05-02T07:23:37.000Z","0.1.1":"2026-07-02T10:51:09.327Z"},"bugs":{"url":"https://github.com/afterrealism/dendri-packages/issues"},"license":"Apache-2.0","homepage":"https://dendri.dev","keywords":["yjs","crdt","dendri","webrtc","p2p","collaboration"],"repository":{"type":"git","url":"git+https://github.com/afterrealism/dendri-packages.git","directory":"dendri-y"},"description":"Yjs CRDT provider on top of Dendri P2P rooms","maintainers":[{"name":"afterrealism","email":"contact@afterrealism.com"}],"readme":"# @afterrealism/dendri-y\n\nMinimal [Yjs](https://github.com/yjs/yjs) provider on top of a\n[Dendri](https://dendri.dev) P2P room. Bridges a `Y.Doc` (and optionally an\n`Awareness` instance) over Dendri's reserved `__yjs` topic.\n\n## Install\n\n```bash\nnpm install @afterrealism/dendri-client @afterrealism/dendri-y yjs y-protocols\n```\n\n`@afterrealism/dendri-client`, `yjs`, and `y-protocols` are peer dependencies —\nbring your own to avoid dual instances breaking CRDT identity.\n\n## Usage\n\n```ts\nimport { createDendriStore } from \"@afterrealism/dendri-client\";\nimport { DendriYjsProvider } from \"@afterrealism/dendri-y\";\nimport * as Y from \"yjs\";\nimport { Awareness } from \"y-protocols/awareness\";\n\nconst room = createDendriStore({\n\thost: \"signal.example.com\",\n\tport: 443,\n\tsecure: true,\n\tpath: \"/\",\n});\n\nconst doc = new Y.Doc();\nconst awareness = new Awareness(doc);\nconst provider = new DendriYjsProvider({ room, doc, awareness });\n\nroom.join(\"my-room\");\n\n// ...later, during app cleanup\nprovider.destroy();\nroom.destroy();\ndoc.destroy();\n```\n\nThe provider only depends on a small `DendriRoomLike` surface, so React, Vue,\nSvelte, and vanilla apps can use it with their normal UI reactivity.\n\n## Wire Format\n\nReserved topic: `__yjs`. Each frame is a single header byte followed by raw\nYjs bytes:\n\n| Byte | Type        | Payload                                     |\n| ---- | ----------- | ------------------------------------------- |\n| 0    | `SyncStep1` | `Y.encodeStateVector(doc)`                  |\n| 1    | `SyncStep2` | `Y.encodeStateAsUpdate(doc, remoteVector)`  |\n| 2    | `Update`    | Incremental update from `doc.on('update')`  |\n| 3    | `Awareness` | `encodeAwarenessUpdate(awareness, ids)`     |\n\nOn peer-join the new peer sends `SyncStep1`, the remote responds with\n`SyncStep2`, and both sides stream `Update` frames thereafter. Yjs updates are\nidempotent and commutative, so no delivery guarantees beyond Dendri's defaults\nare required.\n\n## Requires\n\n- Dendri client `>= 2.3.7` (for `room.broadcastBinary()`)\n- `yjs ^13.6.0`\n- `y-protocols ^1.0.0`\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}