Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.07 KB

README.md

File metadata and controls

63 lines (48 loc) · 1.07 KB

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