Git Product home page Git Product logo

chat-examples-javascript's Introduction

PubNub JavaScript Chat

Build Status

This repository contains sample code from the Chat Resource Center.

Repository structure

Directory Description
examples Sample applications which show how to implement chat functionality using the PubNub SDK.
examples > react Source files for the Animal Forest Chat application. The complete tutorial can be found here.
snippets Verified and tested code snippets used in documentation.
Snippets from chat-resource-center/ are used in the Chat Resource Center.

Animal Forest Chat Application

Requirements

  • Node.js
  • Gulp - required to install project dependencies.

Prerequisites

Sign Up for a PubNub Account

If you don't already have an account, you can create one for free here.

  1. Sign in to your PubNub Admin Dashboard, click Create New App, and give your app a name.

  2. Select your new app, then click its keyset. Copy the Publish and Subscribe keys. You'll need these keys to include in this project.

  3. Scroll down on the Key Options page and enable the Presence and Storage & Playback add-on features.

  4. Click Save Changes, and you're done!

Using your PubNub keys

Add your PubNub keys to the keys file in the config folder:

cd examples/react/
vi src/config/keys.js

The file should look like the following:

module.exports = {
    publishKey: 'YOUR_PUBLISH_KEY',
    subscribeKey: 'YOUR_SUBSCRIBE_KEY'
  };

Building the project

  1. Navigate to the react project directory:
cd examples/react/
npm install
  1. Run the app in development mode:
$ npm start

Open http://localhost:3000 to view it in the browser.

Further Information

For more information about this project, or how to create your own chat app using PubNub, please check out the React tutorial in the Chat Resource Center.

chat-examples-javascript's People

Contributors

parfeon avatar nishith-pubnub avatar qsoftdevelopment avatar elvis-pn avatar messagingmoore avatar elvis-wolcott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.