Giter Club home page Giter Club logo

node-streaming-socketio's Introduction

node-streaming-socketio

Node demo that streams newly created and updated Account records in Salesforce.com to the browser using socket.io. You can run the demo by opening two browsers:

  1. salesforce CRUD demo with Node - Create a new Account record in this app.
  2. node-streaming-socketio demo - New Account record are streamed to this app and display in the browser using socket.io.

Setup Remote Access in Salesforce.com

Setup a new Remote Access to get your OAuth tokens. If you are unfamiliar with settng this up, see 4:45 of my Salesforce.com Primer for New Developers. For your callback, simply use: http://localhost:3001/oauth/_callback

Create a PushTopic in Salesforce.com

Create a new PushTopic from the Developer Console in your org with the following. This will setup the endpoint for nforce to listen to:

PushTopic pt = new PushTopic();  
pt.apiversion = 24.0;  
pt.name = 'AllAccounts';
pt.description = 'All new account records';  
pt.query = 'SELECT Id, Name FROM Account';  
insert pt;  
System.debug('Created new PushTopic: '+ pt.Id);

You can also set up PushTopics using the Workbench.

Running the Application Locally

git clone https://github.com/jeffdonthemic/node-streaming-socketio.git
cd node-streaming-socketio
npm install

This will clone this repo locally so you simply have to make your config changes and be up and running. Now replace your OAuth tokens and credentials in the config.js file then run the following to start the server:

node app.js

Open your browser to http://localhost:3001 and make a change to an Account record in Salesforce and see it appear on the page.

node-streaming-socketio's People

Contributors

jeffdonthemic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.