Created
September 11, 2020 02:36
-
-
Save hmmhmmhm/455c03d2d004d5810a43950108fecbc8 to your computer and use it in GitHub Desktop.
솔라피 SOLAPI 타입스크립트 typescript 😊
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { config, Group } from 'solapi' | |
| config.init({ | |
| apiKey: process.env.SMS_API_KEY, | |
| apiSecret: process.env.SMS_SECRET_KEY, | |
| }) | |
| export interface ISendSMSParam { | |
| /** | |
| * 문자 내용 | |
| */ | |
| text: string | |
| /** | |
| * 수신번호 (받는이) | |
| */ | |
| to: string | |
| } | |
| export const sendSMS = async (params: ISendSMSParam) => { | |
| return await Group.sendSimpleMessage({ | |
| ...params, | |
| type: 'SMS', | |
| from: process.env.FROM_SMS_PHONE_NUMBER, | |
| }) | |
| } | |
| export interface ISendLMSParam { | |
| /** | |
| * 문자 제목 | |
| */ | |
| subject: string | |
| /** | |
| * 문자 내용 | |
| */ | |
| text: string | |
| /** | |
| * 수신번호 (받는이) | |
| */ | |
| to: string | |
| } | |
| export const sendLMS = async (params: ISendLMSParam) => { | |
| return await Group.sendSimpleMessage({ | |
| ...params, | |
| type: 'LMS', | |
| from: process.env.FROM_SMS_PHONE_NUMBER, | |
| }) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
솔라피(solapi) 를 타입스크립트에서 사용할 때
@types 정보가 없어 고민할 분들을 위해 기록을 남겨둡니다. 😊