{"id":37905049,"url":"https://github.com/qcloudsms/qcloudsms_js","last_synced_at":"2026-01-16T17:09:38.730Z","repository":{"id":44164332,"uuid":"112283991","full_name":"qcloudsms/qcloudsms_js","owner":"qcloudsms","description":"qcloudsms Node.js SDK","archived":false,"fork":false,"pushed_at":"2019-10-28T09:04:54.000Z","size":412,"stargazers_count":77,"open_issues_count":5,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-21T22:57:23.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qcloudsms.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}},"created_at":"2017-11-28T04:04:21.000Z","updated_at":"2025-04-01T08:28:37.000Z","dependencies_parsed_at":"2022-07-19T12:54:35.625Z","dependency_job_id":null,"html_url":"https://github.com/qcloudsms/qcloudsms_js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/qcloudsms/qcloudsms_js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcloudsms%2Fqcloudsms_js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcloudsms%2Fqcloudsms_js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcloudsms%2Fqcloudsms_js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcloudsms%2Fqcloudsms_js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qcloudsms","download_url":"https://codeload.github.com/qcloudsms/qcloudsms_js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcloudsms%2Fqcloudsms_js/sbom","scorecard":{"id":752972,"data":{"date":"2025-08-11","repo":{"name":"github.com/qcloudsms/qcloudsms_js","commit":"0096cd280d80fe81d7275f8b465d1aa9729b4d4e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T20:50:36.912Z","repository_id":44164332,"created_at":"2025-08-22T20:50:36.912Z","updated_at":"2025-08-22T20:50:36.912Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-16T17:09:36.632Z","updated_at":"2026-01-16T17:09:38.724Z","avatar_url":"https://github.com/qcloudsms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"腾讯云短信 Node.js SDK\n===\n\n## 腾讯短信服务\n\n目前`腾讯云短信`为客户提供`国内短信`、`国内语音`和`海外短信`三大服务，腾讯云短信SDK支持以下操作：\n\n### 国内短信\n\n国内短信支持操作：\n\n- 指定模板单发短信\n- 指定模板群发短信\n- 拉取短信回执和短信回复状态\n\n\u003e `Note` 短信拉取功能需要联系腾讯云短信技术支持(QQ:3012203387)开通权限，量大客户可以使用此功能批量拉取，其他客户不建议使用。\n\n### 海外短信\n\n海外短信支持操作：\n\n- 指定模板单发短信\n- 指定模板群发短信\n- 拉取短信回执和短信回复状态\n\n\u003e `Note` 海外短信和国内短信使用同一接口，只需替换相应的国家码与手机号码，每次请求群发接口手机号码需全部为国内或者海外手机号码。\n\n### 语音通知\n\n语音通知支持操作：\n\n- 发送语音验证码\n- 发送语音通知\n- 上传语音文件\n- 按语音文件fid发送语音通知\n- 指定模板发送语音通知类\n\n## 开发\n\n### 准备\n\n在开始开发云短信应用之前，需要准备如下信息:\n\n- [x] 获取SDK AppID和AppKey\n\n云短信应用SDK `AppID`和`AppKey`可在[短信控制台](https://console.cloud.tencent.com/sms)的应用信息里获取，如您尚未添加应用，请到[短信控制台](https://console.cloud.tencent.com/sms)中添加应用。\n\n- [x] 申请签名\n\n一个完整的短信由短信`签名`和短信正文内容两部分组成，短信`签名`须申请和审核，`签名`可在[短信控制台](https://console.cloud.tencent.com/sms)的相应服务模块`内容配置`中进行申请。\n\n- [x] 申请模板\n\n同样短信或语音正文内容`模板`须申请和审核，`模板`可在[短信控制台](https://console.cloud.tencent.com/sms)的相应服务模块`内容配置`中进行申请。\n\n## 安装\n\n### npm\n\nqcloudsms_js采用npm进行安装，要使用qcloudsms功能，只需要执行:\n\n```shell\nnpm install qcloudsms_js\n```\n\n### 手动\n\n1. 手动下载或clone最新版本qcloudsms_js代码\n2. 把qcloudsms_js把代码放入项目目录\n3. 然后在项目里require qcloudsms_js, 如: `var moduleName = require(\"path/to/qcloudsms_js\")`\n\n## 用法\n\n### 文档\n\n若您对接口存在疑问，可以查阅:\n\n* [API开发指南](https://cloud.tencent.com/document/product/382/5808)\n* [SDK文档](https://qcloudsms.github.io/qcloudsms_js/)\n* [错误码](https://cloud.tencent.com/document/product/382/3771)\n\n### 示例\n\n- **准备必要参数和实例化QcloudSms**\n\n```javascript\nvar QcloudSms = require(\"qcloudsms_js\");\n\n// 短信应用SDK AppID\nvar appid = 1400009099;  // SDK AppID是1400开头\n\n// 短信应用SDK AppKey\nvar appkey = \"9ff91d87c2cd7cd0ea762f141975d1df37481d48700d70ac37470aefc60f9bad\";\n\n// 需要发送短信的手机号码\nvar phoneNumbers = [\"21212313123\", \"12345678902\", \"12345678903\"];\n\n// 短信模板ID，需要在短信应用中申请\nvar templateId = 7839;  // NOTE: 这里的模板ID`7839`只是一个示例，真实的模板ID需要在短信控制台中申请\n\n// 签名\nvar smsSign = \"腾讯云\";  // NOTE: 这里的签名只是示例，请使用真实的已申请的签名, 签名参数使用的是`签名内容`，而不是`签名ID`\n\n// 实例化QcloudSms\nvar qcloudsms = QcloudSms(appid, appkey);\n\n// 设置请求回调处理, 这里只是演示，用户需要自定义相应处理回调\nfunction callback(err, res, resData) {\n    if (err) {\n        console.log(\"err: \", err);\n    } else {\n        console.log(\"request data: \", res.req);\n        console.log(\"response data: \", resData);\n    }\n}\n```\n\n- **指定模板ID单发短信**\n\n```javascript\nvar ssender = qcloudsms.SmsSingleSender();\nvar params = [\"5678\"];\nssender.sendWithParam(86, phoneNumbers[0], templateId,\n  params, smsSign, \"\", \"\", callback);  // 签名参数不能为空串\n```\n\n\u003e `Note` 无论单发/群发短信还是指定模板ID单发/群发短信都需要从控制台中申请模板并且模板已经审核通过，才可能下发成功，否则返回失败。\n\n- **指定模板ID群发**\n\n```javascript\nvar msender = qcloudsms.SmsMultiSender();\nvar params = [\"5678\"];\nmsender.sendWithParam(\"86\", phoneNumbers, templateId,\n  params, smsSign, \"\", \"\", callback);  // 签名参数不能为空串\n```\n\n\u003e `Note` 群发一次请求最多支持200个号码，如有对号码数量有特殊需求请联系腾讯云短信技术支持(QQ:3012203387)。\n\n- **发送语音验证码**\n\n```javascript\nvar cvsender = qcloudsms.CodeVoiceSender();\ncvsender.send(\"86\", phoneNumbers[0], \"1234\", 2, \"\", callback);\n```\n\n\u003e `Note` 语音验证码发送只需提供验证码数字，例如当msg=“5678”时，您收到的语音通知为“您的语音验证码是5678”，如需自定义内容，可以使用语音通知。\n\n- **发送语音通知**\n\n```javascript\nvar pvsender = qcloudsms.PromptVoiceSender();\npvsender.send(\"86\", phoneNumbers[0], 2, \"5678\", 2, \"\", callback);\n```\n\n- **拉取短信回执以及回复**\n\n```javascript\nvar maxNum = 10;  // 单次拉取最大量\nvar spuller = qcloudsms.SmsStatusPuller();\n// 拉取短信回执\nspuller.pullCallback(maxNum, callback);\n// 拉取回复\nspuller.pullReply(maxNum, callback);\n```\n\n\u003e `Note` 短信拉取功能需要联系腾讯云短信技术支持(QQ:3012203387)，量大客户可以使用此功能批量拉取，其他客户不建议使用。\n\n- **拉取单个手机短信状态**\n\n```javascript\nvar beginTime = 1511125600;  // 开始时间(unix timestamp)\nvar endTime = 1511841600;    // 结束时间(unix timestamp)\nvar maxNum = 10;             // 单次拉取最大量\nvar mspuller = qcloudsms.SmsMobileStatusPuller();\n// 拉取短信回执\nmspuller.pullCallback(\"86\", phoneNumbers[0], beginTime, endTime, maxNum, callback);\n// 拉取回复\nmspuller.pullReply(\"86\", phoneNumbers[0], beginTime, endTime, maxNum, callback);\n```\n\n\u003e `Note` 短信拉取功能需要联系腾讯云短信技术支持(QQ:3012203387)，量大客户可以使用此功能批量拉取，其他客户不建议使用。\n\n- **发送海外短信**\n\n海外短信与国内短信发送类似, 发送海外短信只需替换相应国家码。\n\n\n- **上传语音文件**\n\n```javascript\nvar fs = require(\"fs\");\n\n// Note: 语音文件大小上传限制400K字节\nvar filePath = \"/home/pf/data/download/scripts/voice/4162.mp3\";\nvar fileContent = fs.readFileSync(filePath);\nvar uploader = qcloudsms.VoiceFileUploader();\n// 上传成功后，callback里会返回语音文件的fid\nuploader.upload(fileContent, \"mp3\", callback);\n```\n\n\u003e `Note` '语音文件上传'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通\n\n- **按语音文件fid发送语音通知**\n\n```javascript\n// Note：这里fid来自`上传语音文件`接口返回的响应，要按语音\n//    文件fid发送语音通知，需要先上传语音文件获取fid\nvar fid = \"c799d10a43ec109f02f2288ca3c85b79e7700c98.mp3\";\nvar fvsender = qcloudsms.FileVoiceSender();\nfvsender.send(\"86\", phoneNumbers[0], fid, 2, \"\", callback);\n```\n\n\u003e `Note` 按'语音文件fid发送语音通知'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通\n\n- **指定模板发送语音通知**\n\n```javascript\nvar templateId = 12345;\nvar params = [\"5678\"];\nvar tvsender = qcloudsms.TtsVoiceSender();\ntvsender.send(\"86\", phoneNumbers[0], templateId, params, 2, \"\", callback);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqcloudsms%2Fqcloudsms_js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqcloudsms%2Fqcloudsms_js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqcloudsms%2Fqcloudsms_js/lists"}