Methods

Objects

NodeJS

SDK Installation Guide

How to install the CALLR NodeJS SDK

Summary

    Requirements


    The installation and usage of the nodejs-sdk requires the following:

    Usage


    1. To get started with the callr npm package, first create your project directory then base project files using npm init

    2. npm init initialises the project with package.json, which contains meta data about your project or app, including modules needed for it to run.

      
          // create your project
          $ mkdir myproject
          $ cd myproject
          $ npm init myproject/
          ...
          About to write to /working/myproject:
          {
              "name": "myproject",
              "version": "1.0.0",
              "description": "",
              "main": "index.js",
              "scripts": {
                  "test": "echo \"Error: no test specified\" && exit 1"
              },
              "author": "",
              "license": "ISC"
          }
          Is this ok? (yes)
      
      

    3. Install the package, saving it to your package.json
    4. 
          $ npm install --save callr
          myproject@1.0.0 /working/myproject
          `-- callr@x.0.0
      
          npm WARN myproject@1.0.0 No description
          npm WARN myproject@1.0.0 No repository field.
      
      

    5. require the callr sdk in your project source to begin using.
    6.     var callr = require('callr');
          var api = new callr.api(callr.loginPasswordAuth('login', 'password'));
      
          api.call('system.get_timestamp').success(function(response) {
              // success callback
          }).error(function(error) {
              // error callback
          });
      
      

    Further help