https://github.com/beevelop/uniqush.js
Simple Node.js API abstraction for Uniqush
https://github.com/beevelop/uniqush.js
Last synced: 12 months ago
JSON representation
Simple Node.js API abstraction for Uniqush
- Host: GitHub
- URL: https://github.com/beevelop/uniqush.js
- Owner: beevelop
- Created: 2016-03-02T15:50:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T01:44:23.000Z (over 3 years ago)
- Last Synced: 2025-01-31T08:07:28.405Z (about 1 year ago)
- Language: JavaScript
- Size: 537 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/uniqush.js)
[](https://codeclimate.com/github/beevelop/uniqush.js)
[](https://gemnasium.com/beevelop/uniqush.js)
[](http://standardjs.com/)

[](https://beevelop.com)
# Uniqush.js ([API-Docs](https://htmlpreview.github.io/?https://github.com/beevelop/uniqush.js/blob/master/docs/uniqush.js/0.0.1/Uniqush.html))
> Simple Node.js API abstraction for Uniqush
## Example
```js
'use strict'
const uniq = require('uniqush.js')('http://uniqush.beevelop.com')
uniq.version
.then(console.log)
// Add GCM via addpsp
.then(() => {
return uniq.addGCM('unicorn', 'MagicProjectId', '[**yourGCMapikey**]')
})
.then(console.log)
// Subscribe user "dom.cobb" to GCM PSP
.then(() => {
return uniq.subscribeGCM('unicorn', 'dom.cobb', '[**yourDeviceRegId**]')
})
.then(console.log)
// Push to "dom.cobb" via service "unicorn" (the GCM PSP)
.then(() => {
return uniq.push('unicorn', 'dom.cobb', {
title: 'Oh yeah',
message: 'Did you know that unicorns are awesome?'
})
})
.then(console.log)
// Unsubscribe "dom.cobb" from "unicorn" (the GCM PSP)
.then(() => {
return uniq.unsubscribeGCM('unicorn', 'dom.cobb', '[**yourDeviceRegId**]')
})
.then(console.log)
// Remove "unicorn", the GCM PSP
.then(() => {
return uniq.rmGCM('unicorn', 'MagicProjectId', '[**yourGCMapikey**]')
})
.then(console.log)
// Aaaannnnd time for a coffe break
.then(() => {
console.log('Done.')
})
```