google-login-gsi

1.0.0 • Public • Published

Google Login GSI

npm NPM

Use Google Identity Services with your Javascript App easily

Installation

  • With NPM
npm i --save google-login-gsi

How to use

Import library

import * as gAuth from "@types/google-login-gsi";

// or

const gAuth = require('google-login-gsi');

SignIn

const response = await gAuth.signIn({
  client_id: YOUR_GOOGLE_CLIENT_ID,
  scope: "profile email" // You can update your scope here
});

Check user is logged in

const isLoggedIn = await gAuth.isLoggedIn(); // Return boolean

Get logged in user information

const user = await gAuth.getUserInfo(); // Return an object

Sign out

gAuth.signOut();

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i google-login-gsi

      Weekly Downloads

      31

      Version

      1.0.0

      License

      ISC

      Unpacked Size

      4.3 kB

      Total Files

      4

      Last publish

      Collaborators

      • phamlehoan