Sending requests to IFTTT Maker channel with node.js
npm install iftttmaker
Creates an instance of the IFTTTMaker with IFTTT Maker apiKey.
Sends a request with specified event and values value1, value2 and value3 and return Promise. You can also use callback.
Another option with params as object.
Set proxy to connect to.
var apiKey = 'VJWqWLSLX3gfbvhR1bmYfi';
var IFTTTMaker = require('iftttmaker')(apiKey);
IFTTTMaker.send('notify', 'hello', 'world').then(function () {
console.log('Request was sent');
}).catch(function (error) {
console.log('The request could not be sent:', error);
});
var apiKey = 'VJWqWLSLX3gfbvhR1bmYfi';
var IFTTTMaker = require('iftttmaker')(apiKey);
// do you need to connect via proxy?
// IFTTTMaker.setProxy('https://10.0.0.3:1234');
var request = {
event: 'notify',
values: {
value1: 'hello',
value2: 'world'
}
};
IFTTTMaker.send(request, function (error) {
if (error) {
console.log('The request could not be sent:', error);
} else {
console.log('Request was sent');
}
});