Since I didn't find a simple JS libs to add PMs to my app which I could easily change and extend I started creating my own and actually found it very useful, and made it more re-usable and configurable.
I am going to publish a new BunnyJS component soon - Bunny Messenger, which will allow to add private message system to any app easily. Just focus on business and your app, add some styles you need and that's all.
Here is current short How To draft
Till now I only used WebSockets for such tasks (with Socket.io or ws). It works...
If you want something more ... peer-to-peer - you can use WebRTC. But I have no experience with this technologie.
Amit Patel
Engineer
If you are google services fan, checkout Google's Firebase Cloud Messaging platform.