Object oriented event emitter based framework for building chat applications in Javascript.
ChatEngine has been deprecated with no plans for additional releases. Support for the ChatEngine SDK will end on July 16, 2021. If you have questions about ChatEngine, please contact us at [email protected]. Please visit our newer chat product, PubNub Chat.
PubNub ChatEngine is an object-oriented event emitter based framework for building chat applications in Javascript. It reduces the time to build chat applications drastically and provides essential components like typing indicators, online presence monitoring and message history out of the box.
The real-time server component is provided by PubNub. ChatEngine is designed to be extensible and includes a plugin framework to make adding new features simple.
For more information on building chat applications with PubNub, see our Chat Resource Center.
You can find the full docs on the documentation website.
To set up ChatEngine on PubNub, one must first set up a PubNub Key. The following steps outlines how to manually set up a PubNub Key to work with ChatEngine client-side SDKs.
If you don't already have an account, you can create one for free here.
The ChatEngine framework and client-side SDKs interact with a REST API service that runs as a PubNub Function.
You'll need to set up the function on your PubNub Account before you can use the SDKs.
Follow the ChatEngine Server Setup Instructions.
Since we'll be installing dependencies, it's helpful to create a new package.json
to keep track of all of the packages we're going to install.
In your project directory, run this command to create a new package. Complete the interactive set up guide and we'll be ready to go.
npm init
That'll create a package.json
in your project directory.
{
"name": "chat-engine-tutorial",
"version": "0.0.1",
"description": "An example PubNub ChatEngine Tutorial",
"main": "index.js",
"author": "Ian Jennings"
}
Alright, now for the part you've probably never done before! Install PubNub ChatEngine by running:
npm install chat-engine@latest --save
Check out the jQuery Kitchen Sink and Angular Kitchen Sink examples to see plugins in action.
create-react-app
.Clone repos (chat-engine and plugins).
All repos should be siblings of one another. This is required for rendering docs properly.
chat-engine
chat-engine-desktop-notifications
chat-engine-emoji
chat-engine-examples
//...
nvm use v6
Run http-server
from my /development
directory which has all chat-engine repos:
cd chat-engine
node server.js
Load http://localhost:8080 in browser and navigate to /chat-engine-examples/jquery/kitchen-sink
Run gulp
to compile, but you should probably run gulp watch
to get consistent changes.
You will need to assign environment variables PUB_KEY_0
and SUB_KEY_0
to your own PubNub keys. Add these variables into your .bashrc
or .zshrc
.
# pubnub chatengine keys
export PUB_KEY_0="YOUR PUBNUB PUBLISH KEY"
export SUB_KEY_0="YOUR PUBNUB SUBSCRIBE KEY"
Then, in the root folder run:
gulp test
npm version patch && git push origin master --tags