Skip to content

circles-00/github-oauth-ts

Repository files navigation

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)

About

Github OAuth Client with basic functionalities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published