{"id":22440033,"url":"https://github.com/holochain-open-dev/y-holochain","last_synced_at":"2025-08-01T17:31:08.900Z","repository":{"id":182892036,"uuid":"669299140","full_name":"holochain-open-dev/y-holochain","owner":"holochain-open-dev","description":"Holochain provider for Yjs -- build real time p2p shared editor apps","archived":false,"fork":false,"pushed_at":"2023-08-09T00:36:28.000Z","size":1362,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-10T01:42:11.087Z","etag":null,"topics":["collaboration","crdt","holochain","p2p","peer-to-peer","yjs","yjs-provider"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holochain-open-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-21T21:17:38.000Z","updated_at":"2024-04-09T22:12:59.000Z","dependencies_parsed_at":"2023-08-09T02:14:42.565Z","dependency_job_id":"d05bbfbc-6418-4177-a674-1212afacef28","html_url":"https://github.com/holochain-open-dev/y-holochain","commit_stats":null,"previous_names":["mattyg/y-holochain","holochain-open-dev/y-holochain"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holochain-open-dev%2Fy-holochain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holochain-open-dev%2Fy-holochain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holochain-open-dev%2Fy-holochain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holochain-open-dev%2Fy-holochain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holochain-open-dev","download_url":"https://codeload.github.com/holochain-open-dev/y-holochain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228393468,"owners_count":17912865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaboration","crdt","holochain","p2p","peer-to-peer","yjs","yjs-provider"],"created_at":"2024-12-06T01:16:45.341Z","updated_at":"2024-12-06T01:16:46.030Z","avatar_url":"https://github.com/holochain-open-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# y-holochain\n\n[Holochain](https://holochain.org/) provider for [Yjs](https://github.com/yjs/yjs). Easily build peer-to-peer real-time collaboration software using Holochain.\n\nYjs already offers bindings for many popular rich text editors including [Quill](https://quilljs.com/), [ProseMirror](https://prosemirror.net/) and [TipTap](https://tiptap.dev/examples/default).\n\n## Usage\n\n1. Setup the zomes in your DNA\n    1. hc scaffold zome yjs\n    1. run `cargo add -p yjs hc_zome_yjs_coordinator`\n    1. run `cargo add -p yjs_integrity hc_zome_yjs_integrity`\n    1. Replace the integrity zome's `lib.rs` (its path may be similar to dnas/my-dna/zomes/integrity/yjs/src/lib.rs) and replace its contents with: `extern crate hc_zome_yjs_integrity;`\n    1. Replace the coordinator zome's `lib.rs` (its path may be similar to dnas/my-dna/zomes/coordinator/yjs/src/lib.rs) and replace its contents with: `extern crate hc_zome_yjs_coordinator;`\n\n1. Setup the Yjs provider in your front-end\n\n```js\nimport { HolochainProvider } from 'y-holochain'\nimport { onMounted, onUnmounted } from 'vue';\n\nlet provider: HolochainProvider | undefined;\nasync setupYjsProvider() {\n  // Create a document where this Yjs data will be stored\n  const record = await client.callZome({\n    zome_name: 'yjs',\n    fn_name: 'create_document',\n    payload: {\n      title: 'My Cool Document'\n    }\n  });\n  const documentActionHash = record.signed_action.hashed.hash;\n\n  // Setup Yjs Doc \u0026 HolochainProvider\n  const ydoc = new Y.Doc();\n  provider = new HolochainProvider(\n    ydoc,               // Yjs Y.Doc\n    client,             // Holochain client\n    \"demo\",             // RoleName of cell with 'yjs' zome\n    \"yjs\",              // ZomeName of 'yjs' coordinator zome\n    documentActionHash  // ActionHash of the document\n  );  \n\n  // Setup Yjs Editor Bindings of your choice\n  const quill = new Quill(\"#my-editor-container\");\n  new QuillBinding(ydoc.getText('quill'), editor);\n}\n\nonMounted(() =\u003e {\n  setupYjsProvider();\n});\n\n// Call destroy() when provider no longer in use\nonUnmounted(() =\u003e {\n  if(provider) {\n    provider.destroy()\n  }\n});\n```\n\nYJS has bindings for many popular text \u0026 rich-text editors. See https://docs.yjs.dev/ecosystem/editor-bindings for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholochain-open-dev%2Fy-holochain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholochain-open-dev%2Fy-holochain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholochain-open-dev%2Fy-holochain/lists"}