Skip to content

etouraille/react-google-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugin to enable google login with the new google api

Install

npm install --save @etouraille/react-google-login

Usage

  import { Login } from '@etouraille/react-google-login'
  


  return (
    <div>
      <Login 
          client_id={client_id} 
          onSuccess={onSuccess} 
          onFailure={onFailure}
      />
    </div>
  )

personalize button

  import { Login } from '@etouraille/react-google-login'
  

  
  return (
    <div>
      <Login 
          content={(login) => <button onClick={login}>My button</button>}
          client_id={client_id} 
          onSuccess={onSuccess}
          onFailure={onFailure}
      >
      </Login>
    </div>
  )

unlog button

  
  import { UnlogGoogle } from '@etouraille/react-google-login'
  

  
  return (
    <div>
      <UnlogGoogle 
          content={( logout) => <button onClick={logout}>Logout</button>} 
          client_id={client_id} 
          onSuccess={onSuccess}
          onFailure={onFailure}
      >
      </UnlogGoogle>
    </div>
  )

Releases

Sponsor this project

Packages

Used by

Contributors

Languages