JavaScript Chat SDK
This SDK offers a set of handy methods to create your own feature-rich chat or add a chat to your existing application.
It's written in TypeScript and relies on the existing JavaScript SDK and various PubNub APIs with twists:
- Tailored specifically to the chat use case by offering easy-to-use methods that let you do exactly what you want, like
startTyping()
(a message) orjoin()
(a channel). - Meant to be easy & intuitive to use as it focuses on features you would most likely build in your chat app, not PubNub APIs and all the technicalities behind them.
- Offers new chat options like quotes, mentions, channel references, threads, anti-spam configuration, or read receipts, to name just a few, that let you build a full-fledged app quickly.
- Flexible because it doesn't impose any specific platform or framework and you can use it to create both client-side and server-side chat apps. You can create web, mobile, or desktop apps in any JavaScript-based framework, like React, React Native, Vue.js, Angular, Electron, Svelte, Nest, or Express.
- UI-agnostic, letting you create your own UX or integrate with any open-source UI framework, like Chat UI Kit (React), or Gifted Chat (React Native).
Go to the Learn section to find out more about:
- Chat SDK architecture
- Access control (authentication & authorization)
- Chat SDK entities (building blocks of the Chat SDK - find out what properties they have and which methods they expose)
- Glossary
Get started
Assuming you have read the Learn section and understand the idea behind the Chat SDK's architecture, you can move to the Build section and start creating your own chat.
Follow these steps:
-
Create a PubNub account in Admin Portal and a sample app. You'll need the publish and subscribe keys from your app's keyset to start building a chat and even to run the Getting Started app we prepared for you.
Sign up
Don't feel like leaving this page to sign up?
-
Read the Sample chat document and try running a Getting Started app to see what a sample app can look like.
-
Once you have checked what Chat SDK has to offer, start building your own chat app:
a. Initialize Chat SDK and configure it for the features you want to implement.
b. Create channels, users, messages, and all other chat features.
Sample apps
Test our sample apps:
- Fully-featured, interactive chat demo written with the PubNub Chat SDK in TypeScript (web and mobile).
- Direct chat (React) that you can run by following steps in the Getting Started guide.
- Group chat (React Native) that you can find on our
js-chat
repo.