1.0.2 • Published 2 years ago

github-oauth-ts v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Typescript component

Usage

Import the module

import GithubOauthClient from 'github-oauth-ts'

Instantiate the OAuth Client

const client = new GithubOauthClient({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  redirectUri: 'YOUR_REDIRECT_URI',
})

API

Get AccessToken

Note that you must have the authCode beforehand. You're gonna usually have this code by your front-end application

  const accessToken = await client.getAccessToken(authCode)

Get User Info

const userInfo = await client.getUserInfo(accessToken)
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago