https://github.com/y-js/y-xmpp
XMPP Connector for Yjs
https://github.com/y-js/y-xmpp
yjs yjs-connector
Last synced: 10 months ago
JSON representation
XMPP Connector for Yjs
- Host: GitHub
- URL: https://github.com/y-js/y-xmpp
- Owner: y-js
- License: mit
- Created: 2015-02-03T17:04:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-07T12:31:56.000Z (about 10 years ago)
- Last Synced: 2025-04-10T21:09:40.336Z (about 1 year ago)
- Topics: yjs, yjs-connector
- Language: JavaScript
- Size: 2.15 MB
- Stars: 6
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# XMPP Connector for [Yjs](https://github.com/y-js/yjs)
XMPP is a very nice choice as a Connector, because it provides already a lot of functionality.
* Can act as a Connector for thousands of users
* Sophisticated Rights Management
* Federated
* Works with nodejs and in the browser
In production, you may want to implement a master instance (in Node.js), that holds the state of your shared data types, even when all users are disconnected. You can find such a server implementation [here](https://github.com/DadaMonad/meme-together/blob/master/server.js). Note: Yjs itself does not depend on a server instance. The server implementation is just another client in the XMPP chat room. Also: Having (a) master client(s) in the chatroom, can reduce traffic significantly.
## Use it!
Retrieve this with bower or npm.
##### NPM
```
npm install y-xmpp --save
```
##### Bower
```
bower install y-xmpp --save
```
### Example
```
Y({
db: {
name: 'memory'
},
connector: {
name: 'xmpp',
room: 'my-xmpp-room'
},
sourceDir: '/bower_components', // location of the y-* modules
share: {
textarea: 'Text' // y.share.textarea is of type Y.Text
}
// types: ['Richtext', 'Array'] // optional list of types you want to import
}).then(function (y) {
// bind the textarea to a shared text element
y.share.textarea.bind(document.getElementById('textfield'))
}
```
## License
Yjs is licensed under the [MIT License](./LICENSE.txt).