
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
Official Node.js lib for Tago
$ npm install tago --save
.insert(JSON, /CALLBACK/);
var Tago = require('tago');
var my_device_token = 'add your device token here';
var my_device = new Tago('device', my_device_token);
var data_to_insert = {
'variable' : 'temperature',
'location' : {'lat': 42.2974279, 'lng': -85.628292},
'time' : '2014-01-20 03:43:59',
'unit' : 'C',
'value' : 63
};
my_device.insert(data_to_insert); // Without callback
// or
my_device.insert(data_to_insert, function (err) { // With callback
if (err) {
return console.log(err);
}
console.log('Data added');
});
.find(JSON, /CALLBACK/);
// You can check documentation to see all options you can use in query.
my_device.find({'query': 'last_value'}, function (err, result) {
if (err) {
return console.log(err);
}
console.log(result); // Array with data
});
//or
my_device.find({'query': 'last_value'}, "details=true", function (err, result) {
if (err) {
return console.log(err);
}
console.log(result); // Array with data
});
.delete(/ID/, /CALLBACK/);
my_device.delete('Data_ID'); // Without callback
// or
my_device.delete(); // Without callback and ID (We will delete last record)
// or
my_device.delete('Data_ID', function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.update(/ID/, JSON, /CALLBACK/);
var object_to_update = {
'value': 32
};
my_device.update('Data_ID', object_to_update); // Without callback
// or
my_device.update(object_to_update); // Without callback and ID (We will update last record)
// or
my_device.update('Data_ID', object_to_update, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.get_params(/CALLBACK/);
my_device.get_params(function (err, result) {
if (err) {
return console.error(err);
}
console.log(result); // result is array of parameters
});
.mark_param('key_name', /CALLBACK/);
my_device.mark_param('ip_address');
//or
my_device.mark_param('ip_address', function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.delete('variable', /BUCKET_ID/, /VAR_NAME/, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var bucket_id = 'add your bucket ID here';
var var_name = 'variable name';
var my_account = new Tago('account', my_account_token);
my_account.delete('variable', bucket_id, var_name, device_id); // Without callback
// or
my_account.delete('variable', bucket_id, var_name, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.create('device', JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var device_model = {
'name' : 'Tago Test',
'description': 'A simple device for test',
'bucket' : '56bd2591ce6f9fe007edaf8a'
'active' : true,
'public' : true
};
my_account.create('device', device_model); // Without callback
// or
my_account.create('device', device_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.info('device', ID, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var device_id = 'add your device ID here';
var my_account = new Tago('account', my_account_token);
my_account.info('device', device_id); // Without callback
// or
my_account.info('device', device_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.delete('device', /ID/, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var device_id = 'add your device ID here';
var my_account = new Tago('account', my_account_token);
my_account.delete('device', device_id); // Without callback
// or
my_account.delete('device', device_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.create('bucket', JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var bucket_model = {
'name' : 'Tago Test',
'description': 'A simple bucket for test',
'public' : true,
};
my_account.create('bucket', bucket_model); // Without callback
// or
my_account.create('bucket', bucket_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.info('bucket', ID, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var bucket_id = 'add your bucket ID here';
var my_account = new Tago('account', my_account_token);
my_account.info('bucket', bucket_id); // Without callback
// or
my_account.info('bucket', bucket_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.delete('bucket', /ID/, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var bucket_id = 'add your bucket ID here';
var my_account = new Tago('account', my_account_token);
my_account.delete('bucket', bucket_id); // Without callback
// or
my_account.delete('bucket', bucket_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.create('analyze', JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var analyze_model = {
'name' : 'Tago Test',
'description': 'A simple analyze for test',
'url' : '',
'interval' : null,
'variables' : [{'key':'variable', 'value':"test"}]
};
my_account.create('analyze', analyze_model); // Without callback
// or
my_account.create('analyze', analyze_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.info('analyze', ID, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var analyze_id = 'add your analyze ID here';
var my_account = new Tago('account', my_account_token);
my_account.info('analyze', analyze_id); // Without callback
// or
my_account.info('analyze', analyze_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.edit('analyze', ID, JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var analyze_id = "add the analyze ID here"
var analyze_model = {
'name' : 'Tago Test',
'description': 'A simple analyze for test',
'url' : '',
'interval' : null,
'variables' : [{'key':'variable', 'value':"test"}]
};
my_account.edit('analyze', analyze_id, analyze_model); // Without callback
// or
my_account.edit('analyze', analyze_id, analyze_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.delete('analyze', /ID/, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var analyze_id = 'add your analyze ID here';
var my_account = new Tago('account', my_account_token);
my_account.delete('analyze', analyze_id); // Without callback
// or
my_account.delete('analyze', analyze_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.create('action', JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var action_model = {
'name' : 'Tago Test',
'description': 'A simple action for test',
"when_set_bucket" : "bucket id reference",
"when_set_origin" : "device id origin",
"when_set_variable" : "variable_test",
"when_set_condition" : true,
"when_set_value" : "=",
"when_reset_bucket" :"bucked id reference",
"when_reset_origin" :"device id reference",
"when_reset_variable" :"variable_test",
"when_reset_condition":false,
"when_reset_value" :"=",
"type" : "script",
"script" : "analyze reference id"
"active" : true,
};
my_account.create('action', action_model); // Without callback
// or
my_account.create('action', action_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.info('action', ID, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var action_id = 'add your action ID here';
var my_account = new Tago('account', my_account_token);
my_account.info('action', action_id); // Without callback
// or
my_account.info('action', action_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.edit('action', ID, JSON, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var my_account = new Tago('account', my_account_token);
var action_id = "add the action ID here";
var action_model = {
'name' : 'Tago Test',
'description': 'A simple action for test',
"when_set_bucket" : "bucket id reference",
"when_set_origin" : "device id origin",
"when_set_variable" : "variable_test",
"when_set_condition" : true,
"when_set_value" : "=",
"when_reset_bucket" :"bucked id reference",
"when_reset_origin" :"device id reference",
"when_reset_variable" :"variable_test",
"when_reset_condition":false,
"when_reset_value" :"=",
"type" : "script",
"script" : "analyze reference id"
"active" : true,
};
my_account.edit('action', action_id, action_model); // Without callback
// or
my_account.edit('action', action_id, action_model, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.delete('action', /ID/, /CALLBACK/);
var Tago = require('tago');
var my_account_token = 'add your account token here';
var action_id = 'add your action ID here';
var my_account = new Tago('account', my_account_token);
my_account.delete('action', action_id); // Without callback
// or
my_account.delete('action', action_id, function (err, result) {
if (err) {
return console.error(err);
}
console.log(result);
});
.listening(CALLBACK);
When new data arrives into Tago.io for you, it will be sent it to your device if you configure for this in the ‘Action’ (Left Menu in Admin). For this purpose, you need to create a new action and select the option ‘Send to Device’. All devices using the token associated with the bucket will receive the data.
my_device.listening(function (data_from_tago) {
console.log(data_from_tago);
});
// If you wanna add listening to connect, you can access socket instance direct using 'mydevice.socket.on', see example below:
my_device.socket.on('connect', function () {
console.log('Connected at Tago.io!');
});
my_device.socket.on('disconnect', function () {
console.log('Disconnected at Tago.io!');
});
Tago lib client for Node.js is released under the Apache-2.0 License.
FAQs
TagoIO SDK for Node.js - Deprecated - Support until 2030-07-20
The npm package tago receives a total of 4 weekly downloads. As such, tago popularity was classified as not popular.
We found that tago demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.