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.

RuntimeUse it forQuickstart
WebBrowser-based applicationsQuickstart: Web
Node.jsServer-side applicationsQuickstart: Node.js
ReactBrowser-based React applications using hooks and componentsQuickstart: React
React NativeMobile app developmentQuickstart: 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​

Was this page useful?

Last updated on