node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


Vtiger API Connection Library for Node.js Applications


Node-vtiger, written in CoffeeScript, is a wrapper of Vtiger REST API in Node.js.
I use it for a robot (node) which is doing automated tasks.


  npm install node-vtiger


Show how to use the module.
The test is tranparent, it creates a lead, update, query, and delete it.
The test use step module for serial execution.

    npm install step
    test/main.js url username accesskey
    test/main.js admin vHgFdsrFrdRdfR


VTiger webservice API:

    vtws = require('node-vtiger')
    VT_URL = ''
    VT_USER = 'admin'
    VT_ACCESSKEY = 'rFtfsdRfTgUggY' # accesskey is in your vtiger user preferences
    LEVEL = 'debug' # level of logging (error||warning||warn||info||debug||trace)
                    # The log in the module are at the level trace

    client = new vtws(VT_URL, VT_USER, VT_ACCESSKEY, 'debug')
    client.doQuery(query, callback)
    client.doDescribe(module, callback)
    client.doRetrieve(id, callback)
    client.doUpdate(valuemap, callback)
    client.doCreate(valuemap, callback)
    client.doSync(modifiedTime, module, callback)

Example with Step, the very useful control-flow node library:

    Step   = require 'step'
    client = new vtws(VT_URL, VT_USER, VT_ACCESSKEY, 'warning')

        login = ->
            return client.doLogin this
        doQuery = (err, result) ->
            query = "SELECT * FROM Leads WHERE lead_no='LEA12345'"
            client.doQuery query, this
        doWhatYouWant = (err, result) ->
            console.log JSON.stringify result



Public Domain & copyleft:
The software is provided "as is", without warranty of any kind.