The older PubNub React SDK v.1.3.1 has been deprecated. The SDK documentation for the older version can be found here.
Get Code: Source
Get Code: NPM
To use the PubNub React Framework, you need:
- React 16.8 or above
Getting Started with React
To get started right away, do the following:
- Set up your React project. For a quick single-page app, create-react-app is a good starting point:
- Replace the contents of your app file with the following:
- Sign in to the PubNub Dashboard to get your Publish and Subscribe keys. Add your keys in place of
mySubscribeKeyin your app file:
- In your project, run the following command:
You should now see the chat UI in your browser:
Getting Started with React Native
You need to have a React Native development environment set up using the guides in React Native documentation (React Native CLI Quickstart tab).
- Clone parent repository and enter the
- Install dependencies
- Run the emulator!