Skip to content

Easily add image uploads to chatrooms using UploadCare online service.

License

Notifications You must be signed in to change notification settings

nishith-pubnub/chat-engine-uploadcare

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
});

About

Easily add image uploads to chatrooms using UploadCare online service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 73.7%
  • HTML 26.3%