aliyun-openapi
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

aliyun-openapi

npm build status npm download

Aliyun OpenAPI

Installation

$ npm install aliyun-openapi

Open APIs

  • SMS
  • Email

Usage

SMS

import { AliyunClient, AliyunSmsOpenAPI } from 'aliyun-openapi'

const client = new AliyunClient({
  accessKeyId: 'your_access_key_id',
  accessKeySecret: 'your_access_key_secret',
  version: '2017-05-25',
  endpoint: 'dysmsapi.aliyuncs.com',
})
const openapi = new AliyunSmsOpenAPI(client)

await openapi.send('13812345678', 'TestSigner', 'SMS_12345678', { code: '123456' })

Email

import { AliyunClient, AliyunEmailOpenAPI } from 'aliyun-openapi'

const client = new AliyunClient({
  accessKeyId: 'your_access_key_id',
  accessKeySecret: 'your_access_key_secret',
  version: '2015-11-23',
  endpoint: 'dm.aliyuncs.com',
})
const openapi = new AliyunEmailOpenAPI(client)

await openapi.send('noreply@test.com', 'alice@test.com', 'Verification Code', `<h2>Verification code: 123456<h2>`)

TODO

  • Monorepo
  • Documentation

Readme

Keywords

Package Sidebar

Install

npm i aliyun-openapi

Weekly Downloads

1

Version

0.1.9

License

MIT

Unpacked Size

36.7 kB

Total Files

19

Last publish

Collaborators

  • xuxucode