This message will self-destruct in five seconds.
Babel is an open source chat widget and API built on the PubNub Data Streams Network. Babel lets you send self-destructing messages and helps facilitate public key exchanges.
Author: Larry Wu
Build your chat to use encrypted, self-destructing messages by simply:
It’s as simple as that to get started! For additional details to build this app, check out our five-part blog series.
Babel uses 1024-bit RSA encryption to secure every message that it sends. You can get an object of all users and their respective keys using the
listUsers() call or get your own Cryptico RSAkey with
The basic building blocks to sending and receiving Babel messages are:
| ||This sends the message string to the recipient provided. The ttl specifies the number of seconds the message will be available before it self-destructs.|
| ||This call returns all messages that haven’t self-destructed yet.|
| ||This allows you to specify a callback that should be called when you receive a message.|
PubNub Presence allows you to detect when users enter or leave your app. With Babel, you can find all users currently connected to your chat using the
listUsers() call. The callback within
onPresence(callback) will be called whenever a user joins or leaves. For a more detailed overview of the Babel API, check out the README on GitHub.