1.4.0 • Published 1 year ago

node-channelio v1.4.0

Weekly downloads
4
License
MIT
Repository
github
Last release
1 year ago

node-channelio

version download status status Standard - JavaScript Style Guide

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

1.4.0

1 year ago

1.3.0

2 years ago

1.2.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago