{"id":20732367,"url":"https://github.com/jpush/jpush-api-nodejs-client","last_synced_at":"2025-05-15T08:09:05.551Z","repository":{"id":11149392,"uuid":"13517947","full_name":"jpush/jpush-api-nodejs-client","owner":"jpush","description":"JPush's officially supported Node.js client library for accessing JPush APIs.  极光推送官方支持的 Node.js 版本服务器端 SDK。","archived":false,"fork":false,"pushed_at":"2025-03-04T10:19:58.000Z","size":240,"stargazers_count":240,"open_issues_count":9,"forks_count":73,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-11T21:48:50.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.jiguang.cn","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-12T07:27:31.000Z","updated_at":"2025-03-20T07:43:49.000Z","dependencies_parsed_at":"2025-03-21T13:21:00.601Z","dependency_job_id":null,"html_url":"https://github.com/jpush/jpush-api-nodejs-client","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-nodejs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-nodejs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-nodejs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-api-nodejs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpush","download_url":"https://codeload.github.com/jpush/jpush-api-nodejs-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253700655,"owners_count":21949698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T05:19:06.729Z","updated_at":"2025-05-15T08:09:05.478Z","avatar_url":"https://github.com/jpush.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JPush API client library for Node.js\n\n本 SDK 提供 JPush 服务端接口的 Node 封装，与 JPush Rest API 组件通信。使用时引用该模块即可，可参考附带 Demo 学习使用方法。\n\n\u003e Node \u003e= 7.6（async/await 语法支持），若 node 版本小于 7.6 请使用 [legacy 分支的代码](https://github.com/jpush/jpush-api-nodejs-client/tree/legacy)\n\n[REST API 文档](http://docs.jiguang.cn/jpush/server/push/server_overview/)\n\n[NodeJS API 文档](https://github.com/jpush/jpush-api-nodejs-client/blob/master/doc/api.md)\n\n## Install\n```\nnpm install jpush-async\n#or\n{\n    \"dependencies\": {\n        \"jpush-async\": \"*\"\n    }\n}\n```\n\n## Example\n### Quick start\n此 Demo 展示如何使用 Node lib 向所有用户推送通知。\n``` js\nvar JPush = require(\"../lib/JPush/JPushAsync.js\")\nvar client = JPush.buildClient('your appKey', 'your masterSecret')\n\n//easy push\nclient.push().setPlatform(JPush.ALL)\n    .setAudience(JPush.ALL)\n    .setNotification('Hi, JPush', JPush.ios('ios alert', 'happy', 5))\n    .send()\n    .then(function(result) {\n        console.log(result)\n    }).catch(function(err) {\n        console.log(err)\n    })\n```\n\n### Expert mode（高级版）\n\n```js\nclient.push().setPlatform('ios', 'android')\n    .setAudience(JPush.tag('555', '666'), JPush.alias('666,777'))\n    .setNotification('Hi, JPush', JPush.ios('ios alert'), JPush.android('android alert', null, 1))\n    .setMessage('msg content')\n    .setOptions(null, 60)\n    .send()\n    .then(function(result) {\n        console.log(result)\n    }).catch(function(err) {\n        console.log(err)\n    });\n```\n\n关于 Payload 对象的方法，参考[详细 API 文档](https://github.com/jpush/jpush-api-nodejs-client/blob/master/doc/api.md)。\n\n### 关闭 Log\n\n```js\n// 在构建 JPushClient 对象的时候, 指定 isDebug 参数。\nvar client = JPush.buildClient({\n    appKey:'your appKey',\n    masterSecret:'your masterSecret',\n    isDebug:false\n});\n// or\nvar client = JPush.buildClient('your appKey', 'your masterSecret', null, false);\n```\n\n\u003e 目前使用了 debug 模块来控制日志输出，若要查看 JPush 的相关日志信息，请先配置 DEBUG 环境变量 'jpush'。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-api-nodejs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpush%2Fjpush-api-nodejs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-api-nodejs-client/lists"}