Skip to content

ShahabKhalid/ReactGoogleOAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reactjs-google-oauth

NPM Packages that allow google oauth with or without a button.

Getting Started

Install the module with: npm install reactjs-google-oauth

API

The library enables google oauth in two different ways.

GoogleOAuth


onSignIn(accessToken, profile) {
  // Code goes here
}

const CLIENT_ID = "YOUR_CLIENT_ID";
const SCOPE_LIST = ['https://www.googleapis.com/auth/drive','profile'];
<GoogleOAuth
  clientId={CLIENT_ID}
  scope={SCOPE_LIST}
  onSignIn={this.onSignIn.bind(this)}
 />

GoogleSignIn


onSignIn(accessToken, profile) {
  // Code goes here
}

const CLIENT_ID = "YOUR_CLIENT_ID";
const SCOPE_LIST = 'https://www.googleapis.com/auth/drive';
<GoogleSignIn
  clientId={CLIENT_ID}
  scope={SCOPE_LIST}
  onSignIn={this.onSignIn.bind(this)}
 />

GoogleSignOut


onSignOut() {
  // Code goes here
}

const CLIENT_ID = "YOUR_CLIENT_ID";
<GoogleSignOut
  clientId={CLIENT_ID}
  onSignOut={this.onSignOut.bind(this)}
 />

License

Copyright (c) 2018 Shahab Khalid Licensed under the ISC license.

About

NPM Packages that allow google oauth with or without a button.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published