chat-engine-uploadcare
v0.0.8
Published
Adds the ability to upload images in a ChatEngine Chat via [UploadCare](https://uploadcare.com/) service
Downloads
6
Maintainers
Keywords
Readme
Uploadcare Plugin for Chat Engine
Adds the ability to upload images in a ChatEngine Chat via UploadCare service
Check out the UploadCare Setup Instructions
Quick Start
- Have a ChatEngine server running already, instantiate a client and connect it
const ChatEngine = ChatEngineCore.create({
publishKey: 'pub-key-here',
subscribeKey: 'sub-key-here'
});
ChatEngine.connect('Username');
ChatEngine.on('$.ready', () => { ... });
- Attach this plugin to the channel you want, in this case global
ChatEngine.global.plugin(ChatEngineCore.plugin['chat-engine-uploadcare']());
- Bind UploadCare to a UI element
const widget = uploadcare.Widget('[role=uploadcare-uploader]');
ChatEngine.global.uploadcare.bind(widget);
- Listen for the
$uploadcare.upload
events on your channel
ChatEngine.global.on('$uploadcare.upload', (payload) => {
console.log(payload.data.cdnUrl);
});