Adds the ability to upload images in a ChatEngine Chat via UploadCare service
Check out the UploadCare Setup Instructions
- 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.uploadevents on your channel
ChatEngine.global.on('$uploadcare.upload', (payload) => {
console.log(payload.data.cdnUrl);
});- If you need help, have a general question a feature request or to file a bug, contact [email protected]