JSPM

bizmsg-alimtalk

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q55627F
  • License MIT

Bizmsg's AlimTalk Send Service Module in Nodejs

Package Exports

  • bizmsg-alimtalk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bizmsg-alimtalk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bizmsg-alimtalk

Installing

Using npm:

$ npm i bizmsg-alimtalk

Using yarn:

$ yarn add bizmsg-alimtalk

Usage

Production

  • typescript

    import bizmsg from 'bizmsg-alimtalk';
    
    const bootstrap = async () => {
      bizmsg.init('YOUR_USER_ID', 'YOUR_PROFILE_KEY');
    };
    bootstrap();
    
    (async () => {
      try {
        const response = bizmsg.sendMessage({
          msg: '[카카오뮤직] 회원가입 안내\n홍길동님, 카카오뮤직 회원이 되신 것을 환영합니다.\n\n▶신규 가입 회원 혜택\n1개월 무료 스트리밍 서비스 제공\n카카오톡 이모티콘 증정',
          phn: '821012345678',
          tmplId: 'alimtalktest_001',
        });
        console.log(response.data);
      } catch (error) {
        console.log(error.response.body);
      }
    })();
  • common.js

    const bizmsg = require('bizmsg-alimtalk');
    
    const bootstrap = async () => {
      bizmsg.init('YOUR_USER_ID', 'YOUR_PROFILE_KEY');
    };
    bootstrap();
    
    (async () => {
      try {
        const response = bizmsg.sendMessage({
          msg: '[카카오뮤직] 회원가입 안내\n홍길동님, 카카오뮤직 회원이 되신 것을 환영합니다.\n\n▶신규 가입 회원 혜택\n1개월 무료 스트리밍 서비스 제공\n카카오톡 이모티콘 증정',
          phn: '821012345678',
          tmplId: 'alimtalktest_001',
        });
        console.log(response.data);
      } catch (error) {
        console.log(error.response.body);
      }
    })();

Test

  • typescript

    import bizmsg from 'bizmsg-alimtalk';
    
    const bootstrap = async () => {
      bizmsg.init('PREPAY_USER', '89823b83f2182b1e229c2e95e21cf5e6301eed98', { dev: true });
      bizmsg.getTestToken({ phoneNumber: '821012345678' });
      bizmsg.confirmTestToken({ phoneNumber: '821012345678', token: '123456' });
    };
    bootstrap();
    
    (async () => {
      try {
        bizmsg.confirmTestTemplate({ templateCode: 'alimtalktest_001' }); // optional
    
        const response = await bizmsg.sendMessage({
          msg: '[카카오뮤직] 회원가입 안내\n홍길동님, 카카오뮤직 회원이 되신 것을 환영합니다.\n\n▶신규 가입 회원 혜택\n1개월 무료 스트리밍 서비스 제공\n카카오톡 이모티콘 증정',
          phn: '821012345678',
          tmplId: 'alimtalktest_001',
        });
        console.log(response.data);
    
        bizmsg.cancelTestTemplate({ templateCode: 'alimtalktest_001' }); // optional
      } catch (error) {
        console.log(error);
      }
    })();
  • common.js

    const bizmsg = require('bizmsg-alimtalk');
    
    const bootstrap = async () => {
      bizmsg.init('PREPAY_USER', '89823b83f2182b1e229c2e95e21cf5e6301eed98', { dev: true });
      bizmsg.getTestToken({ phoneNumber: '821012345678' });
      bizmsg.confirmTestToken({ phoneNumber: '821012345678', token: '123456' });
    };
    bootstrap();
    
    (async () => {
      try {
        bizmsg.confirmTestTemplate({ templateCode: 'alimtalktest_001' }); // optional
    
        const response = await bizmsg.sendMessage({
          msg: '[카카오뮤직] 회원가입 안내\n홍길동님, 카카오뮤직 회원이 되신 것을 환영합니다.\n\n▶신규 가입 회원 혜택\n1개월 무료 스트리밍 서비스 제공\n카카오톡 이모티콘 증정',
          phn: '821012345678',
          tmplId: 'alimtalktest_001',
        });
        console.log(response.data);
    
        bizmsg.cancelTestTemplate({ templateCode: 'alimtalktest_001' }); // optional
      } catch (error) {
        console.log(error);
      }
    })();