cafe24-get-auth-code
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

cafe24-get-auth-code

npm github

cafe24 api의 auth code를 가져오는 기능을 제공합니다.

Installation

npm install cafe24-get-auth-code puppeteer@24

CLI Usage

Usage:
  cafe24-get-auth-code \
    --mall-id <mall-id> \
    --password <password> \
    --client-id <client-id> \
    --scope <scope> \
    [...options]

  Options:
    - [Required] `--mall-id`: cafe24 mall id (Environment variable: `CAFE24_MALL_ID`)
    - [Required] `--password`: cafe24 password (Environment variable: `CAFE24_PASSWORD`)
    - [Required] `--client-id`: cafe24 client id (from [cafe24 developer console](https://developers.cafe24.com/))
                                (Environment variable: `CAFE24_CLIENT_ID`)
    - [Required] `--scope`: comma seperated cafe24 api scopes (Environment variable: `CAFE24_SCOPE`)
    - [Optional] `--redirect-uri`: redirect uri (default: `https://cafe24.com`)
                                  (Environment variable: `CAFE24_AUTH_REDIRECT_URI`)
    - [Optional] `--state`: state (default: randomly generated)
                            (Environment variable: `CAFE24_AUTH_STATE`)
    - [Optional] `--debug`: Enable debug mode
    - [Optionap] `--env-file`: Load environment variables from a file. (default: `.env`)

API Usage

import { getAuthCode } from 'cafe24-get-auth-code';

const result = await getAuthCode({
  mallId: 'mall-id',
  password: 'password',
  clientId: 'client-id',
  scope: 'scope1,scope2',
  redirectUri: 'https://cafe24.com',
  state: 'state'
})

if (result.error) {
  console.error(result.error);
} else {
  const { code, state } = result;
  console.log(`Retrieved auth code: ${code}`);
  console.log(`State: ${state}`);
}

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i cafe24-get-auth-code

Weekly Downloads

8

Version

1.1.3

License

MIT

Unpacked Size

23.6 kB

Total Files

11

Last publish

Collaborators

  • joseph1191