GAuth SDK 사용법 - Node.js
‣
담당자 - 변찬우#5345
단 하나의 계정으로
📚 Description
GAuth
를 더 편하게 이용할 수 있도록 node 버전으로 만들어진 라이브러리입니다.
해당 SDK는 Frontend보다는 Backend에 중점을 둔 라이브러리입니다.
⚡ Requirements
- axios
🛠️ Installation
// npm
> npm i @msg-team/gauth-node
// yarn
> yarn add @msg-team/gauth-node
🙋 How to use
code 발급
import Gauth from '@msg-team/gauth-node'
const result = await Gauth.issueCode({
email: '[email protected]',
password: '1234'
})
// { code: string }
console.log(result)
token 발급
import Gauth from '@msg-team/gauth-node'
const result = await Gauth.issueToken({
code: 'string',
clientId: 'string',
redirectUri: 'string',
clientSecret: 'string',
})
// { accessToken: string, refreshToken: string }
console.log(result)
token 재발급
import Gauth from '@msg-team/gauth-node'
const result = await Gauth.reissueToken({
refreshToken: 'string',
})
// { accessToken: string, refreshToken: string }
console.log(result)
유저 정보 가져오기
import Gauth from '@msg-team/gauth-node'
const result = await Gauth.getUser({
accessToken: 'string',
})
// { accessToken: string, refreshToken: string }
console.log(result)