Skip to content

glukaszewski/sheetgo-react-google-one-tap-sign-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

React - Google One Tap Login

Sheetgo forking of React wrapper for google one tap authentication by Muhammad Salman Tariq

Install

npm install react-google-one-tap-login

OR

yarn add react-google-one-tap-login

How to use

As a Hook

import { useGoogleOneTapLogin } from 'react-google-one-tap-login';

useGoogleOneTapLogin({
    onError: error => console.log(error),
    onSuccess: response => console.log(response),
    googleAccountConfigs: {
      client_id: // Your google client id here !!!
    },
  });

As a Component

import React from 'react';
import ReactDOM from 'react-dom';
import GoogleOneTapLogin from 'react-google-one-tap-login';

ReactDOM.render(
  <GoogleOneTapLogin onError={(error) => console.log(error} onSuccess={(response) => console.log(response} googleAccountConfigs={{ client_id: // Your google client id here !!! }} />,
  document.getElementById('root')
);

Props

Name Type Required Description
disabled boolean false Disable the login prompt
onError callback false onError : Error
onSuccess callback false onSuccess : GoogleEndpointResponse (See below)
googleAccountConfigs object true Google One Tap JS API Reference

*client_id is required in googleAccountConfigs

Google EndPoint Response

More details

Name Type
iss string
sup string
azp string
aud string
iat string
exp string
name string
email string
local string
picture string
given_name string
family_name string
email_verified string

About

Sheetgo forking of React wrapper for google one tap authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published