Tutorial: Node.js

Quick Start Node.js

  1. Download [[service]] SDK for Node.js

    npm install webcom
  2. Next, in your app code, import [[service]] SDK to use it

    var Webcom = require('webcom');
  3. API is similar to the web SDK. Watch out some examples to read and write data [[snippet]]:

    var myRef = new Webcom('<your-webcom-app>');
    // Read data
    myRef.on('child_added', function(snap){
     console.info(snap.val());
    });
    // Write data
    myRef.set({foo: 'bar'});
  4. If you have a company proxy, you just have to setup usual environment variables HTTPS_PROXY and HTTP_PROXY (their lowercase counterpart also works). For example:

    export HTTPS_PROXY="my-proxy.my-company.com:8080"