Skip to content

Instantly share code, notes, and snippets.

@hmmhmmhm
Created September 11, 2020 02:36
Show Gist options
  • Select an option

  • Save hmmhmmhm/455c03d2d004d5810a43950108fecbc8 to your computer and use it in GitHub Desktop.

Select an option

Save hmmhmmhm/455c03d2d004d5810a43950108fecbc8 to your computer and use it in GitHub Desktop.
솔라피 SOLAPI 타입스크립트 typescript 😊
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,
})
}
@hmmhmmhm

Copy link
Copy Markdown
Author

솔라피(solapi) 를 타입스크립트에서 사용할 때
@types 정보가 없어 고민할 분들을 위해 기록을 남겨둡니다. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment