google-login-gsi

Google Sign-in with Google Identity Service
1,447 2
Install
npm install google-login-gsi
Latest Version:1.0.0
License:ISC
Last Updated:Dec 15, 2022
Links: GitHub  ·  npm
Maintainer: phamlehoan

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();

Related Packages

google-oauth-gsi

A user-friendly API for GIS SDK, using the new **Google Identity Services SDK**...

76,268 34
vue-google-oauth2

Handling Google Auth2 sign-in and sign-out

175,570 180
vue3-google-oauth2

Handling Google sign-in and sign-out for Vue3 applications.

141,765 56
@symbiote-native/auth-session

expo-auth-session ported for SymbioteNative — one framework-agnostic core, built...

607 72
@dark-engine/core

The lightweight and powerful UI rendering engine without dependencies and writte...

30,320 53

Version History

Version Released License
1.0.0 ISC