@b1nd/openapi
v1.3.1
Published
A npm package for easy use of DodamDodam OAuth
Downloads
70
Readme
Dodam-OpenAPI
A npm package for easy use of DodamDodam OAuth
Installing
Use npm
$ npm install @b1nd/openapi
Use yarn
$ yarn add @b1nd/openapi
How to use
create module
import { AuthClient } from '@b1nd/openapi';
const clientId: string = "clientId";
const clientSecret: string = "clientSecret";
const authClient = new AuthClient({clientId, clientSecret});
Login
const code: string = "code";
const token = await authClient.login(code);
Get token
const code: string = "code";
const token = await authClient.getToken(code);
Refresh token
const refreshToken: string = "refresh_token";
const token = await authClient.refreshToken(refreshToken);
Get user
const token: string = "access_token";
const user = await authClient.getUser(token);