Aliyun OpenAPI
$ npm install aliyun-openapi
- 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' })
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('[email protected]', '[email protected]', 'Verification Code', `<h2>Verification code: 123456<h2>`)
- Monorepo
- Documentation