Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@4a/alisms

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@4a/alisms

阿里云SMS

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Alisms

阿里云短信验证码发送和验证

Install

npm i @4a/alisms

Usage

const AliSMS = require('@4a/alisms')
const AliSMSConfig = {
    AccessKeyId: "your AccessKeyId",
    AccessKeySecret: "your AccessKeySecret",
    RegionId: 'your RegionId',
    SignName: 'your SignName',
    TemplateCode: 'your TemplateCode'
}

const Redis = require('ioredis')
const redis = new Redis()

const alisms = new AliSMS({ ...AliSMSConfig, redis })


// 创建一个短信验证码
// 模拟发送,测试环境使用该api
alisms.create(telephone)


// 创建一个短信验证码
// 真实发送,生产环境使用该api
alisms.publish(telephone)


// 验证短信验证码是否合法
alisms.verify(telephone, code)

Example

npm test

Keywords

FAQs

Package last updated on 31 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc