1.0.0 • Published 7 years ago

ali-sms-sdk v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

ali-sms-sdk

build status

Nodejs SDK for Aliyun SMS service

Install

npm install ali-sms-sdk

Usage

const sms = require("ali-sms-sdk");
const accessKeyID     = process.env.ALI_SMS_ACCESSKEYID;
const accessKeySecret = process.env.ALI_SMS_ACCESSKEYSECRET;

const config = {
  accessKeyID       : accessKeyID,
  accessKeySecret   : accessKeySecret,
  paramString       : {code: '123456'},
  recNum            : ['1891234567'],
  signName          : 'alibaba',
  templateCode      : 'SMS_28100008',
};
sms(config, (err, body) => {
  console.log(err, body);
});

Config

paramtypedescription
accessKeyIDstringaccess key id, get from aliyun
accessKeySecretstringaccess key secret, get from aliyun
paramStringobjectali sms param which you have defined on aliyun sms dashboard
recNumarrayphone numbers of users
signNamestringali sms param, get from aliyun sms dashboard
templateCodestringali sms param, get from aliyun sms dashboard

Debug

DEBUG=sms npm start