node-channelio
v1.4.0
Published
Node.js module for using the Channel API
Downloads
2
Readme
node-channelio
Node.js module for using the Channel API (https://developers.channel.io/docs/what-is-open-api)
Usage
Require channelio
const ChannelIO = require('node-channelio')
const client = new ChannelIO('accessKey', 'accessSecret')
Users
client.users.get('user_id', (err, data) => {
// ...
const userId = data.user.id
// ...
}
client.users.update('user_id', { profile: profile } (err, data) => {
// ...
}
client.users.delete('user_id', (err) => {
// ...
})
Events
client.users.events.create(userId, 'Purchase', {
name: 'Product Name',
// ...
}, (err, data) => {
// ...
const eventId = data.event.id
})
client.users.events.get(userId, {
limit: 10,
sortOrder: 'desc'
}, (err, data) => {
// ...
const events = data.events
})
client.users.events.delete(userId, eventId, (err) => {
// ...
})
Licence
MIT