# egg-uni-sms

> tencent qcloud sms plugin for egg

Latest version **1.0.0** (published 2020-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install egg-uni-sms
pnpm add egg-uni-sms
yarn add egg-uni-sms
bun add egg-uni-sms
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-07-20 |
| First published | 2020-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rayosu |
| Maintainers | rayosu |
| Keywords | egg, sms, qcsms, qcloudsms, tencent |

## Links

- npm: https://www.npmjs.com/package/egg-uni-sms
- Repository: https://github.com/rayosu/egg-sms
- Homepage: https://github.com/rayosu/egg-sms#readme
- Issues: https://github.com/rayosu/egg-sms/issues
- npm.io page: https://npm.io/package/egg-uni-sms

## Dependencies (2)

- [qcloudsms_js](https://npm.io/package/qcloudsms_js.md) ^0.1.1
- [@alicloud/sms-sdk](https://npm.io/package/@alicloud/sms-sdk.md) ^1.1.6

## Recent versions

- 1.0.0 (latest) — 2020-07-20

## README

# egg-sms

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-sms.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-sms
[travis-image]: https://img.shields.io/travis/yolopunk/egg-sms.svg?style=flat-square
[travis-url]: https://travis-ci.org/yolopunk/egg-sms
[codecov-image]: https://img.shields.io/codecov/c/github/yolopunk/egg-sms.svg?style=flat-square
[codecov-url]: https://codecov.io/github/yolopunk/egg-sms?branch=master
[david-image]: https://img.shields.io/david/yolopunk/egg-sms.svg?style=flat-square
[david-url]: https://david-dm.org/yolopunk/egg-sms
[snyk-image]: https://snyk.io/test/npm/egg-sms/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-sms
[download-image]: https://img.shields.io/npm/dm/egg-sms.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-sms

<!--
Description here.
-->

## Install

```bash
$ npm i egg-sms --save
```

## Usage

```js
// {app_root}/config/plugin.js
exports.sms = {
  enable: true,
  package: 'egg-sms'
}
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.sms = {
  client: {
    accessKeyId: 'your access key',
    secretAccessKey: 'your access secret'
  }
}
```

see [config/config.default.js](config/config.default.js) for more detail.

## API
detail on ali doc [here](https://help.aliyun.com/document_detail/57458.html)
* sms.sendSMS(params)
* sms.queryDetail(params)
* sms.receiveMsg(params)

## Example
You can acquire sms instance on `app` or `ctx`
```js
  // {app_root}/app/controller/sms.js
  ...
  async send () {
    await this.ctx.sms.sendSMS({
      PhoneNumbers: '1500000000',
      SignName: '云通信产品',
      TemplateCode: 'SMS_000000',
      TemplateParam: '{"code":"12345"}'
    })
  }
  ...
```

## Questions & Suggestions

Please open an issue [here](https://github.com/yolopunk/egg-sms/issues).

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/egg-uni-sms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
