0.0.6 • Published 2 years ago

unisms v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

UniSMS Node.js SDK

UniSMS - 高可用聚合短信服务平台官方 Node.js SDK.

文档

查看完整产品介绍与 API 文档请访问 UniSMS Documentation.

安装

Uni Node.js SDK 使用 npm 托管,可从公共 npm 仓库 中获得。

在项目中添加 unisms 作为依赖:

npm i unisms

或使用 Yarn:

yarn add unisms

使用示例

以下示例展示如何使用 Uni Node.js SDK 快速调用服务。

发送短信

import UniSMS from 'unisms'

// 初始化
const client = new UniSMS({
  accessKeyId: 'your access key id',
  accessKeySecret: 'your access key secret',
})

// 发送短信
client.send({
  to: 'your phone number',
  signature: 'UniSMS',
  templateId: 'login_tmpl',
  templateData: {
    code: 8888,
  },
})
  .then(ret => {
    console.info('Result:', ret)
  })
  .catch(e => {
    console.error(e)
  })

相关参考

其他语言 SDK

0.0.6

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago