jpush

jpush Node.js sdk

Usage no npm install needed!

<script type="module">
  import jpush from 'https://cdn.skypack.dev/jpush';
</script>

README

JPush Node.js sdk Build Status NPM version

极光推送Node.js 服务端 sdk

v2 or v3

极光推送官网更新了v3 接口

http://docs.jpush.cn/display/dev/Push-API-v3

所以,本sdk 库也同步更新...对于v2 接口用0.1.x 版本 , v3 用0.3.x版本.

Usage

v2

npm install jpush@0.1

v3

npm install jpush

Example

Notification

var JPush = require('jpush');

var jpushClient = JPush.build({appkey: "you app key", masterSecret: "you master secret key"});

var body =  'Hi jpush nodejs sdk!';

jpushClient.pushNotification(body, function (err, result){
   console.log(result);
})

Message

var JPush = require('jpush');

var jpushClient = JPush.build({appkey: "you app key", masterSecret: "you master secret key"});

var body =  'Hi jpush nodejs sdk!';

jpushClient.pushMessage(body, function (err, result) {
   console.log(result);
})

更多例子去看test目录下的单元测试

Api Docs

该在线文档为jpush v2

在线API文档: ** http://blog.gfdsa.net/JPush-Node.js-sdk/ **

支持本项目

如果你觉得这个项目还不错,就请作者喝杯咖啡吧

Bitdeli Badge