{"id":13696648,"url":"https://github.com/yjs/y-indexeddb","last_synced_at":"2025-05-16T11:05:01.727Z","repository":{"id":41309070,"uuid":"45758941","full_name":"yjs/y-indexeddb","owner":"yjs","description":"IndexedDB database adapter for Yjs","archived":false,"fork":false,"pushed_at":"2025-02-12T19:12:13.000Z","size":283,"stargazers_count":232,"open_issues_count":8,"forks_count":34,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-08T16:01:56.325Z","etag":null,"topics":["offline-first","yjs"],"latest_commit_sha":null,"homepage":"https://docs.yjs.dev/ecosystem/database-provider/y-indexeddb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjs.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"dmonad","patreon":null,"open_collective":"y-collective","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-11-07T23:21:34.000Z","updated_at":"2025-04-26T16:26:49.000Z","dependencies_parsed_at":"2025-04-27T18:00:50.541Z","dependency_job_id":"9225617c-0e18-4a68-9e74-cab3c5223c55","html_url":"https://github.com/yjs/y-indexeddb","commit_stats":{"total_commits":97,"total_committers":8,"mean_commits":12.125,"dds":0.4639175257731959,"last_synced_commit":"6084e843e59a11b0e29414d305929f77eeedc7f0"},"previous_names":["y-js/y-indexeddb"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjs%2Fy-indexeddb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjs%2Fy-indexeddb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjs%2Fy-indexeddb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjs%2Fy-indexeddb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjs","download_url":"https://codeload.github.com/yjs/y-indexeddb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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":["offline-first","yjs"],"created_at":"2024-08-02T18:00:44.123Z","updated_at":"2025-05-16T11:04:56.715Z","avatar_url":"https://github.com/yjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dmonad","https://opencollective.com/y-collective"],"categories":["Technologies","JavaScript"],"sub_categories":[],"readme":"# y-indexeddb\n\n\u003e IndexedDB database provider for Yjs. [Documentation](https://docs.yjs.dev/ecosystem/database-provider/y-indexeddb)\n\nUse the IndexedDB database adapter to store your shared data persistently in\nthe browser. The next time you join the session, your changes will still be\nthere.\n\n* Minimizes the amount of data exchanged between server and client\n* Makes offline editing possible\n\n## Getting Started\n\nYou find the complete documentation published online: [API documentation](https://docs.yjs.dev/ecosystem/database-provider/y-indexeddb).\n\n```sh\nnpm i --save y-indexeddb\n```\n\n```js\nconst provider = new IndexeddbPersistence(docName, ydoc)\n\nprovider.on('synced', () =\u003e {\n  console.log('content from the database is loaded')\n})\n```\n\n## API\n\n\u003cdl\u003e\n  \u003cb\u003e\u003ccode\u003eprovider = new IndexeddbPersistence(docName: string, ydoc: Y.Doc)\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nCreate a y-indexeddb persistence provider. Specify docName as a unique string\nthat identifies this document. In most cases, you want to use the same identifier\nthat is used as the room-name in the connection provider.\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.on('synced', function(idbPersistence: IndexeddbPersistence))\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nThe \"synced\" event is fired when the connection to the database has been established\nand all available content has been loaded. The event is also fired if no content\nis found for the given doc name.\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.set(key: any, value: any): Promise\u0026lt;any\u0026gt;\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nSet a custom property on the provider instance. You can use this to store relevant\nmeta-information for the persisted document. However, the content will not be\nsynced with other peers.\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.get(key: any): Promise\u0026gt;any\u0026lt;\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nRetrieve a stored value.\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.del(key: any): Promise\u0026gt;undefined\u0026lt;\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nDelete a stored value.\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.destroy(): Promise\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nClose the connection to the database and stop syncing the document. This method is\nautomatically called when the Yjs document is destroyed (e.g. ydoc.destroy()).\n  \u003c/dd\u003e\n  \u003cb\u003e\u003ccode\u003eprovider.clearData(): Promise\u003c/code\u003e\u003c/b\u003e\n  \u003cdd\u003e\nDestroy this database and remove the stored document and all related meta-information\nfrom the database.\n  \u003c/dd\u003e\n\u003c/dl\u003e\n\n## License\n\nYjs is licensed under the [MIT License](./LICENSE).\n\n\u003ckevin.jahns@protonmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjs%2Fy-indexeddb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjs%2Fy-indexeddb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjs%2Fy-indexeddb/lists"}