Choose your runtime for the PubNub JavaScript SDK
The PubNub JavaScript SDK adds PubNub real-time messaging to browser, server, and mobile applications. PubNub concepts and API usage are the same on every runtime. This page explains where the runtimes differ and which quickstart to follow.
How the runtimes differ
There is one quickstart for each runtime. Lifecycle management and UI updates differ between runtimes. The PubNub API calls do not.
| Runtime | Use it for | Quickstart |
|---|---|---|
| Web | Browser-based applications | Quickstart: Web |
| Node.js | Server-side applications | Quickstart: Node.js |
| React | Browser-based React applications using hooks and components | Quickstart: React |
| React Native | Mobile app development | Quickstart: React Native |
The SDK also works in frameworks such as Angular and Vue. Follow the quickstart for the runtime your framework builds on.
JavaScript and TypeScript
You can use JavaScript or TypeScript on every runtime. The only difference is how you import PubNub, which depends on your module format. To install the SDK, set up TypeScript, or pick between ES Modules and CommonJS, refer to Set up your JavaScript environment.
Next steps
- Quickstart: Web. Send your first message in the browser.
- Quickstart: Node.js. Send your first message from a server.
- Set up your JavaScript environment. Install the SDK and set up TypeScript before you start a quickstart.
- API reference. Look up a method.