
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
!http://chattycrow.com/crow3logo.png!
h1. ChattyCrow - Node JS library
This library makes easier to call ChattyCrow API (http://chattycrow.com/).
h2. Installation
npm install chattycrow
h2. Usage
var chattycrow = require('chattycrow').createClient('token', 'default_channel');
h3. Optional parameters
Every sender and contacts methods header:
send(payload, callback, contacts, options);
h3. Email notification - TODO
Not yet implemented!
h3. IOS Push notification
// Callback function function pushResponse(res, body, err) { if (err) { console.log(err.message); } if (res) { console.log(res); } if (body) { console.log(body); } } // Send push chattycrow.sendIos({ payload: { 'hello' }}, pushResponse, [ 'contacts', 'contact2' ], {channel: 'other', token: 'not_default'})
h3. Android Push notification
// Send message chattycrow.sendAndroid({ payload: { data : { key1 : 'hello' }}, pushResponse, [ 'new_ios_id1', 'contact2' ], {channel: 'other', token: 'not_default'})
h3. Skype notification
// Send request chattycrow.sendSkype('Skype message', pushResponse, [ 'skype', 'skype2' ])
h3. Jabber notification
// Send request chattycrow.sendJabber('Jabber message', pushResponse)
h3. SMS notification (only Czech Republic yet)
// Sms notification chattycrow.sendJabber('SMS message', pushResponse, [ '+420 123 456 789' ])
h2. Working with contacts via API
It's actually very usable, you can automatically add or remove contacts in your application after user was registered.
h3. Contact list
function contactList(res, body, err) { if (err) { console.log(err.message); } if (res) { console.log(res); } if (body) { console.log(body.contacts); } } // Get contacts chattycrow.getContacts(contactList, { channel: 'other than default' })
h3. Add contact
function contactAddResult(res, body, err) { if (err) { console.log(err.message); } if (res) { console.log(res); } if (body) { console.log('Status: ' + body.status); console.log('Message: ' + body.msg); console.log('Stats: ' + body.stats.success + '/' + body.stats.exists + '/' + body.stats.failed); } } // Add contacts chattycrow.addContacts(['test1', 'test2'], contactAddResult, { channel: 'other than default' })
h3. Remove contact
function contactRemoveResult(res, body, err) { if (err) { console.log(err.message); } if (res) { console.log(res); } if (body) { console.log('Status: ' + body.status); console.log('Message: ' + body.msg); console.log('Stats: ' + body.stats.success + '/' + body.stats.failed); } } // Add contacts chattycrow.removeContacts(['test1', 'test2'], contactRemoveResult, { channel: 'other than default' });
FAQs
Chatty Crow client library to call Chatty Crow API.
The npm package chattycrow receives a total of 1 weekly downloads. As such, chattycrow popularity was classified as not popular.
We found that chattycrow 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.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.