Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Latest commit

ย 

History

History
58 lines (42 loc) ยท 1.84 KB

File metadata and controls

58 lines (42 loc) ยท 1.84 KB

CoolSMS SDK for Node.js(Server Side Only)

You can send text messages(SMS, LMS, MMS), Kakao friendtalk(include notification friendtalk) in Korea using this package.

๐Ÿ›‘ This SDK is no longer maintained! Please use the SOLAPI SDK instead.

Installing

To use the SDK, simply use npm package manager CLI. Type the following into a terminal window.

npm

npm install --save coolsms-node-sdk

yarn

yarn add coolsms-node-sdk

Usage

JavaScript

const coolsms = require('coolsms-node-sdk').default;

// apiKey, apiSecret ์„ค์ •
const messageService = new coolsms('ENTER_YOUR_API_KEY', 'ENTER_YOUR_API_SECRET');

// 2๊ฑด ์ด์ƒ์˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐœ์†กํ•  ๋•Œ๋Š” sendMany, ๋‹จ์ผ ๊ฑด ๋ฉ”์‹œ์ง€ ๋ฐœ์†ก์€ sendOne์„ ์ด์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 
messageService.sendMany([
    {
      to: '01000000001',
      from: '01012345678',
      text: 'ํ•œ๊ธ€ 45์ž, ์˜์ž 90์ž ์ดํ•˜ ์ž…๋ ฅ๋˜๋ฉด ์ž๋™์œผ๋กœ SMSํƒ€์ž…์˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋ฐœ์†ก๋ฉ๋‹ˆ๋‹ค.'
    },
    {
      to: '01000000002',
      from: '01012345678',
      text: 'ํ•œ๊ธ€ 45์ž, ์˜์ž 90์ž ์ด์ƒ ์ž…๋ ฅ๋˜๋ฉด ์ž๋™์œผ๋กœ LMSํƒ€์ž…์˜ ๋ฌธ์ž๋ฉ”์‹œ์ง€๊ฐ€ ๋ฐœ์†ก๋ฉ๋‹ˆ๋‹ค. 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    }
    // 1๋งŒ๊ฑด๊นŒ์ง€ ์ถ”๊ฐ€ ๊ฐ€๋Šฅ
  ]).then(res => console.log(res))
  .catch(err => console.error(err));

Opening Issues

If you encounter a bug with the CoolSMS SDK for Javascript we would like to hear about it. Search the existing issues and try to make sure your problem doesnโ€™t already exist before opening a new issue. Itโ€™s helpful if you include the version of the SDK, Node.js or browser environment and OS youโ€™re using. Please include a stack trace and reduced repro case when appropriate, too.

License

Licensed under the MIT License.