2.1.1 • Published 4 years ago

@dejay/electron-google-oauth2 v2.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

DeJayDev/electron-google-oauth2

Library that helps with Google OAuth authentication for your Electron app.

Install

// npm
$ npm install --save DeJayDev/electron-google-oauth2
// yarn
$ yarn add DeJayDev/electron-google-oauth2

Usage

import ElectronGoogleOAuth2 from 'electron-google-oauth2';

app.on('ready', () => {
  const myApiOauth = new ElectronGoogleOAuth2(
    'CLIENT_ID',
    'CLIENT_SECRET',
    ['https://www.googleapis.com/auth/drive.metadata.readonly']
  );

  myApiOauth.openAuthWindowAndGetTokens()
    .then(token => {
      // use your token.access_token
    });
});

License

MIT