0.0.8 • Published 8 years ago

chat-engine-uploadcare v0.0.8

Weekly downloads
21
License
-
Repository
-
Last release
8 years ago

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

  1. 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', () => { ... });
  1. Attach this plugin to the channel you want, in this case global
ChatEngine.global.plugin(ChatEngineCore.plugin['chat-engine-uploadcare']());
  1. Bind UploadCare to a UI element
const widget = uploadcare.Widget('[role=uploadcare-uploader]');
ChatEngine.global.uploadcare.bind(widget);
  1. Listen for the $uploadcare.upload events on your channel
ChatEngine.global.on('$uploadcare.upload', (payload) => {
    console.log(payload.data.cdnUrl);
});
0.0.8

8 years ago

0.0.7

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago