{"_id":"@leecheuk/react-google-login","_rev":"2-d7075710a7f6063b4775c6b95155082a","name":"@leecheuk/react-google-login","dist-tags":{"latest":"5.4.1"},"versions":{"5.3.2":{"name":"@leecheuk/react-google-login","version":"5.3.2","description":"A Google Login Component for React","main":"dist/google-login.js","scripts":{"start":"webpack-dev-server --config webpack/webpack.config.dev.js","dev":"npm run start","bundle":"webpack --config webpack/webpack.config.prod.js","test":"jest","test:watch":"jest --watch","test:generate-output":"jest --json --outputFile=.jest-test-results.json","lint":"eslint ./src","lint:fix":"eslint ./src --fix","fresh":"rm -rf node_modules dist docs; rm package-lock.json; npm i","storybook":"start-storybook -p 8080","build-storybook":"npm run test:generate-output; build-storybook -c .storybook -o docs","deploy-storybook":"storybook-to-ghpages --out=docs/","release":"release-it --ci --no-git.requireCleanWorkingDir"},"pre-commit":["test","lint"],"repository":{"type":"git","url":"git+https://github.com/leecheuk/react-google-login.git"},"keywords":["react","reactjs","react-component","google-login","google-oAuth2","google-oAuth"],"license":"MIT","bugs":{"url":"https://github.com/leecheuk/react-google-login/issues"},"homepage":"https://github.com/leecheuk/react-google-login","dependencies":{"@types/react":"*","prop-types":"^15.6.0"},"devDependencies":{"@babel/core":"^7.4.3","@babel/plugin-proposal-object-rest-spread":"^7.4.3","@babel/plugin-transform-runtime":"^7.4.3","@babel/preset-env":"^7.4.3","@babel/preset-react":"^7.0.0","@storybook/addon-actions":"^5.2.1","@storybook/addon-jest":"^5.2.1","@storybook/addon-knobs":"^5.2.1","@storybook/addon-links":"^5.2.1","@storybook/addon-notes":"^5.2.1","@storybook/addons":"^5.2.1","@storybook/react":"^5.2.1","@storybook/storybook-deployer":"^2.8.1","autoprefixer":"^9.7.1","babel-core":"7.0.0-bridge.0","babel-jest":"^24.7.1","babel-loader":"^8.0.5","babel-plugin-transform-react-constant-elements":"^6.23.0","babel-plugin-transform-react-inline-elements":"^6.22.0","babel-plugin-transform-react-remove-prop-types":"^0.4.24","enzyme":"^3.9.0","enzyme-adapter-react-16":"^1.11.2","eslint-config-ag":"^2.0.0","husky":"^8.0.1","jest":"^24.7.1","pre-commit":"^1.2.2","react":"^16.0.0","react-dom":"^16.0.0","react-fontawesome":"^1.6.1","react-hot-loader":"^4.8.2","react-test-renderer":"^16.8.6","release-it":"^13.5.5","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^3.3.10","webpack-dev-server":"^3.2.1"},"peerDependencies":{"react":"^16 || ^17 || ^18","react-dom":"^16 || ^17 || ^18"},"types":"./index.d.ts","babel":{"presets":["@babel/preset-env","@babel/preset-react"]},"publishConfig":{"access":"public"},"gitHead":"712ec9f8b19f69c1dfb9a1addb41849d6d00ff4b","_id":"@leecheuk/react-google-login@5.3.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-RePlhq/0ww1ThhSoY1gLiU6+M7u0rAMmS5HZhqjxHbL9y1PBCzDGxevmqFj9hGbAZvKMO9z9fSf6Xb5LQUdvhA==","shasum":"7c65112463c9754c7e9c8055869d7f274f6c7aba","tarball":"https://registry.npmjs.org/@leecheuk/react-google-login/-/react-google-login-5.3.2.tgz","fileCount":38,"unpackedSize":131258,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDceMWhHE48HAtf6In5Muo5ifF95MiFfOt+wdpnafx8zAIhAMtDd1oB0zBOeYb9LCaqSDg4wBdd8JfWDluHgSYKMqUd"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0y59ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/og/+LAaYTTlY8i9d/1jJ80T4PME76uSwpPHk0MG7FoT69faaN9Xa\r\nszFWgXJ9l4IS/g0p2vFDA7NyarXihbJ05ZnvFynBxdp0EyCvShJpC0uF2gy1\r\n7OKSkXn9ApeporTdyxV/I1PqXbHEtGZejYFONFX4a6mSQdeA4ja4IjgHYq5y\r\nG/yKMBQRd9MyO2Cjv7z8OLy0P1x8Oq8w2p05riB03UZf+5bYYz184xf6EWKf\r\nUr3dfxj78Z4PbtLSZ1w3LUX7DVnrNAAfXPSX6AKfaJ+AGUqIcPoiXmNFIhkT\r\nHMUkiWA6MTQO2HryijiTnLBrCOEuvVRXkCQvr1i2wAaCQR8iJmaOVE5oKdaG\r\niA0mBGn09mtBK7aDxbxEoEKQRbXddhdpDaMc9lUGFv1L+ndiIo2gLQnMc3OW\r\niG8GmfCOkygL2nAM6K9smThcqcVms1FactU74Rg1DmuRAMzzPTWCKMZvyKWZ\r\n+kyhLTfaIv3xY5ClGTWVMLPCFN6fz+dTcdHyny5UXjeK5B/u2WMpY+7DF2bz\r\nop/cRKLPkJrtILrzQf+RRm+qIgBXAlRJFHTA+8l9C14cPqZZPZtWmQSStFYZ\r\n/FSRtOo0sBqMvr8fUMt/RNhElYqjsrXlfmqlV3RKnPIYPIxj2mzRUQDcflUC\r\nkMlobYODy3VrEiFgeDx6xyKND0Sc7Mwrz6o=\r\n=O9Fu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"},"directories":{},"maintainers":[{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-google-login_5.3.2_1658007164963_0.7791171279363232"},"_hasShrinkwrap":false},"5.4.0":{"name":"@leecheuk/react-google-login","version":"5.4.0","description":"A Google Login Component for React","main":"dist/google-login.js","scripts":{"start":"webpack-dev-server --config webpack/webpack.config.dev.js","dev":"npm run start","bundle":"webpack --config webpack/webpack.config.prod.js","test":"jest","test:watch":"jest --watch","test:generate-output":"jest --json --outputFile=.jest-test-results.json","lint":"eslint ./src","lint:fix":"eslint ./src --fix","fresh":"rm -rf node_modules dist docs; rm package-lock.json; npm i","storybook":"start-storybook -p 8080","build-storybook":"npm run test:generate-output; build-storybook -c .storybook -o docs"},"pre-commit":["test","lint"],"repository":{"type":"git","url":"git+https://github.com/leecheuk/react-google-login.git"},"keywords":["react","reactjs","react-component","google-login","google-oAuth2","google-oAuth"],"license":"MIT","bugs":{"url":"https://github.com/leecheuk/react-google-login/issues"},"homepage":"https://github.com/leecheuk/react-google-login","dependencies":{"@types/react":"*","prop-types":"^15.6.0"},"devDependencies":{"@babel/core":"^7.4.3","@babel/plugin-proposal-object-rest-spread":"^7.4.3","@babel/plugin-transform-runtime":"^7.4.3","@babel/preset-env":"^7.4.3","@babel/preset-react":"^7.0.0","@storybook/addon-actions":"^5.2.1","@storybook/addon-jest":"^5.2.1","@storybook/addon-knobs":"^5.2.1","@storybook/addon-links":"^5.2.1","@storybook/addon-notes":"^5.2.1","@storybook/addons":"^5.2.1","@storybook/react":"^5.2.1","@storybook/storybook-deployer":"^2.8.1","autoprefixer":"^9.7.1","babel-core":"7.0.0-bridge.0","babel-jest":"^24.7.1","babel-loader":"^8.0.5","babel-plugin-transform-react-constant-elements":"^6.23.0","babel-plugin-transform-react-inline-elements":"^6.22.0","babel-plugin-transform-react-remove-prop-types":"^0.4.24","enzyme":"^3.9.0","enzyme-adapter-react-16":"^1.11.2","eslint-config-ag":"^2.0.0","husky":"^8.0.1","jest":"^24.7.1","pre-commit":"^1.2.2","react":"^16.0.0","react-dom":"^16.0.0","react-fontawesome":"^1.6.1","react-hot-loader":"^4.8.2","react-test-renderer":"^16.8.6","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^3.3.10","webpack-dev-server":"^3.2.1"},"peerDependencies":{"react":"^16 || ^17 || ^18","react-dom":"^16 || ^17 || ^18"},"types":"./index.d.ts","babel":{"presets":["@babel/preset-env","@babel/preset-react"]},"publishConfig":{"access":"public"},"gitHead":"cde4fdc814c3c1a631dab3b077802df8817291a9","_id":"@leecheuk/react-google-login@5.4.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-R7TpoopyGEb8JGaajbwA+huODhISC0WxGmX1XW3qMhZ3act94dlfRhZ2euIKkDmQYwjLz9ffuG3CdB1/xuGCtg==","shasum":"ff8803484ffeb23287a1c84f81cc5d2fa4fa9eb3","tarball":"https://registry.npmjs.org/@leecheuk/react-google-login/-/react-google-login-5.4.0.tgz","fileCount":5,"unpackedSize":38558,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEXER73mqgj84d+x9OkUvEaie1tsCNstOV1HEPdydrZQAiEAhTdEVZTpY6X3F+02opc0esUqSfFVxnWEuX9eVpjR9FM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1HdoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvEg//fl/T3O65sKGtCiv5wyDtvhHg2CNwl7aX+3qCVyEIJFx9XGEI\r\no3+eLI6VYJ11Flzv6y23P+GtrV5N4QwPXJmFKON2q9zLQAMReUhk1hl2BQOv\r\nXe9Frfcmi0eX1ulb6y6uuMwD0CRv2KUg5RUZ8GE9eNDzlUchqtLBwF3lR6ST\r\ncm6OfmCQxAvDv/mXGzMUTXVZG5fwBR2lBA2VQY006fdmVWgUYd0XPDCJVvKI\r\n0SZHDVFnHYPN3TqjJLbbNJqnvxH+IwX2AHzTiWAprSd5U4lCY7MKuR10FaI5\r\n+XS7BojXJuA7tOOIhJ+9DJ25wSQY0Q41SwU6OnOEv4mEkXwcJ4Xd6OfommA2\r\nlE4ceHeF7Dp/lBTYHU2tvWhNTcLnMuO2tOlo1Np5nqNzjFWqTd3T87CnBhB8\r\njg7RvlaRifqW0qmXY6gJveKk7Key7dNLrM2vxvf2I6Zm7UT4nLS2NF0Bg01u\r\nflm1A/p817Sa5OyfvPyexsMdKAytyMQaNsQJYGXEZteEVjoc4YDwZ9Ajx+3v\r\nYOMBnjPsQnotUTaPYzwXtrsvtUYR1y/NFrstND/zjN+7kcQLF1wpn4CrHag8\r\nbVZCxHhBb64AIW7oUc55587By0CJrc6Tfhm4iAUvLCH0TxIlXmys1uV3FhFV\r\nHL/4ySuIO4rn0YIpUtwNQ8fUdJoKGJarQMQ=\r\n=U2k8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"},"directories":{},"maintainers":[{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-google-login_5.4.0_1658091368622_0.215708365940259"},"_hasShrinkwrap":false},"5.4.1":{"name":"@leecheuk/react-google-login","version":"5.4.1","description":"A Google Login Component for React","main":"dist/google-login.js","scripts":{"start":"webpack-dev-server --config webpack/webpack.config.dev.js","dev":"npm run start","bundle":"webpack --config webpack/webpack.config.prod.js","test":"jest","test:watch":"jest --watch","test:generate-output":"jest --json --outputFile=.jest-test-results.json","lint":"eslint ./src","lint:fix":"eslint ./src --fix","fresh":"rm -rf node_modules dist docs; rm package-lock.json; npm i","storybook":"start-storybook -p 8080","build-storybook":"npm run test:generate-output; build-storybook -c .storybook -o docs"},"pre-commit":["test","lint"],"repository":{"type":"git","url":"git+https://github.com/leecheuk/react-google-login.git"},"keywords":["react","reactjs","react-component","google-login","google-oAuth2","google-oAuth"],"license":"MIT","bugs":{"url":"https://github.com/leecheuk/react-google-login/issues"},"homepage":"https://github.com/leecheuk/react-google-login","dependencies":{"@types/react":"*","prop-types":"^15.6.0"},"devDependencies":{"@babel/core":"^7.4.3","@babel/plugin-proposal-object-rest-spread":"^7.4.3","@babel/plugin-transform-runtime":"^7.4.3","@babel/preset-env":"^7.4.3","@babel/preset-react":"^7.0.0","@storybook/addon-actions":"^5.2.1","@storybook/addon-jest":"^5.2.1","@storybook/addon-knobs":"^5.2.1","@storybook/addon-links":"^5.2.1","@storybook/addon-notes":"^5.2.1","@storybook/addons":"^5.2.1","@storybook/react":"^5.2.1","@storybook/storybook-deployer":"^2.8.1","autoprefixer":"^9.7.1","babel-core":"7.0.0-bridge.0","babel-jest":"^24.7.1","babel-loader":"^8.0.5","babel-plugin-transform-react-constant-elements":"^6.23.0","babel-plugin-transform-react-inline-elements":"^6.22.0","babel-plugin-transform-react-remove-prop-types":"^0.4.24","enzyme":"^3.9.0","enzyme-adapter-react-16":"^1.11.2","eslint-config-ag":"^2.0.0","husky":"^8.0.1","jest":"^24.7.1","pre-commit":"^1.2.2","react":"^16.0.0","react-dom":"^16.0.0","react-fontawesome":"^1.6.1","react-hot-loader":"^4.8.2","react-test-renderer":"^16.8.6","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^3.3.10","webpack-dev-server":"^3.2.1"},"peerDependencies":{"react":"^16 || ^17 || ^18","react-dom":"^16 || ^17 || ^18"},"types":"./index.d.ts","babel":{"presets":["@babel/preset-env","@babel/preset-react"]},"publishConfig":{"access":"public"},"gitHead":"5bd062214eb386d269c855892872f79fdf20b517","_id":"@leecheuk/react-google-login@5.4.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-2DtfOW9Ckt3M3RDy+3KAizqT9ts6im0Af0s+PBt9p6aKZEj7xL6P8v1nMcobGrffQnD+JQIyrhKozvuAYsP+Cg==","shasum":"892d81fea2714332d07026f0bc40f322f9104c31","tarball":"https://registry.npmjs.org/@leecheuk/react-google-login/-/react-google-login-5.4.1.tgz","fileCount":5,"unpackedSize":38608,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpNVwwY9tS3TlgKSExcKLnkWmAjFouhfW825GF8Sg86AiEA36g+yVv6oQt4flA8l/D7LfRwEOwMIn3NlwLiy7scqdE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGnY6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqk5hAAj9dqtcTDNYwudU/4k+MmvDDhqd/tbJ4NcOXrr1b9esUSfxo2\r\nitOHQ9BA90vcia9pT/i4J//bjtyhUOYFE8eEnds+zlb937CFezFSANtv1XT0\r\njtCJvwxv32UiqZCFqEu8V2uA/+BmIVGdIevyIMOkJ978+bGVPnSgDYoccSeO\r\nTAIPuwZMmhUgUpH8RNdlhw/3Et0ze31dCZWrOpLui5WC32rBW0lZzoMGBPo8\r\nBqydPtumMH1OMdKGD7DbLlfK5cwtQYX5Ul3tzarBHOWnJJQfCRV0QmdDXUBN\r\nn0skymCU0s5iaM3r5HqAPFLKllwD1v8N5a+tSpuWgmAMmYYhLHfyCE499ZvK\r\nKLLWMMFgEOPnEqaier2HjxrbO6UGaubiG2fWdLMGaYQ8cAuAXY7qHcyVYQtA\r\n21Ce1CYEJLdIoHMPSUl6e/DLtfDiqIZmDEtd+pH08hX9uNOBzDaMThfUouSt\r\ncOUzXEOLcQ0F+TM3THqlpNvf09O5XzUuGY/bMUSy4jrfUHcS7tj74iG4ULbd\r\n4TpOPzRbeQWsb0MXHj280wM8S9msTCBTwZuzUbnldTW4Us6NCXrk8uPGQqed\r\n3VnQSQEgaz3H/lWJQ3t8v2ZAeWnlZHQcTEWUoZRkHIiHjqeDGfAYs1DNLHy5\r\nYJ3+ulxEka+z9vyO5gaPVVil4pmrVaz4SO8=\r\n=7jXX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"},"directories":{},"maintainers":[{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-google-login_5.4.1_1662678585812_0.21648685449075566"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-16T21:32:44.904Z","5.3.2":"2022-07-16T21:32:45.103Z","modified":"2022-09-08T23:09:46.086Z","5.4.0":"2022-07-17T20:56:08.825Z","5.4.1":"2022-09-08T23:09:46.002Z"},"maintainers":[{"name":"leecheuk","email":"dev.cheuk.lee@gmail.com"}],"description":"A Google Login Component for React","homepage":"https://github.com/leecheuk/react-google-login","keywords":["react","reactjs","react-component","google-login","google-oAuth2","google-oAuth"],"repository":{"type":"git","url":"git+https://github.com/leecheuk/react-google-login.git"},"bugs":{"url":"https://github.com/leecheuk/react-google-login/issues"},"license":"MIT","readme":"# React Google Login\n\nA Google OAuth Sign-in / Log-in Component for React. Forked from `anthonyjgrove/react-google-login`.\n\n> :warning: Google is discontinuing Google Sign-In JavaScript Platform Library for web. By default, newly created Client IDs are blocked and if you create IDs before July 29th, 2022, you can set `plugin_name` to use it. Please migrate to **Google Identity Services** before March 31, 2023.\n\nNote: This package uses Google Sign-In JavaScript Platform Library and has added support for `plugin_name`. \n\n## Storybook\n\n[Demo Link](https://leecheuk.github.io/react-google-login/)\n\n## Install\n```\nnpm install @leecheuk/react-google-login\n```\n\n## How to use\n```js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport GoogleLogin from '@leecheuk/react-google-login';\n// or\nimport { GoogleLogin } from '@leecheuk/react-google-login';\n\n\nconst responseGoogle = (response) => {\n  console.log(response);\n}\n\nReactDOM.render(\n  <GoogleLogin\n    clientId=\"658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com\"\n    buttonText=\"Login\"\n    onSuccess={responseGoogle}\n    onFailure={responseGoogle}\n    cookiePolicy={'single_host_origin'}\n  />,\n  document.getElementById('googleButton')\n);\n```\n\n## Google button without styling or custom button\n```js\nReactDOM.render(\n  <GoogleLogin\n    clientId=\"658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com\"\n    render={renderProps => (\n      <button onClick={renderProps.onClick} disabled={renderProps.disabled}>This is my custom Google button</button>\n    )}\n    buttonText=\"Login\"\n    onSuccess={responseGoogle}\n    onFailure={responseGoogle}\n    cookiePolicy={'single_host_origin'}\n  />,\n  document.getElementById('googleButton')\n);\n```\n\n## Stay Logged in\n`isSignedIn={true}` attribute will call `onSuccess` callback on load to keep the user signed in.\n```jsx\n<GoogleLogin\n  clientId=\"658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com\"\n  onSuccess={responseGoogle}\n  isSignedIn={true}\n/>\n```\n\n## Login Hook\n```js\nimport { useGoogleLogin } from '@leecheuk/react-google-login'\n\nconst { signIn, loaded } = useGoogleLogin({\n    onSuccess,\n    onAutoLoadFinished,\n    clientId,\n    cookiePolicy,\n    loginHint,\n    hostedDomain,\n    autoLoad,\n    isSignedIn,\n    fetchBasicProfile,\n    redirectUri,\n    discoveryDocs,\n    onFailure,\n    uxMode,\n    scope,\n    accessType,\n    responseType,\n    jsSrc,\n    onRequest,\n    prompt\n  })\n```\n## Logout Hook\n```js\nimport { useGoogleLogout } from '@leecheuk/react-google-login'\n\nconst { signOut, loaded } = useGoogleLogout({\n    jsSrc,\n    onFailure,\n    clientId,\n    cookiePolicy,\n    loginHint,\n    hostedDomain,\n    fetchBasicProfile,\n    discoveryDocs,\n    uxMode,\n    redirectUri,\n    scope,\n    accessType,\n    onLogoutSuccess\n  })\n```\n## onSuccess callback\n\nIf responseType is not 'code', callback will return the GoogleAuth object.\n\nIf responseType is 'code', callback will return the authorization code that can\nbe used to retrieve a refresh token from the server.\n\nIf you use the hostedDomain param, make sure to validate the id_token (a JSON web token) returned by Google on your backend server:\n 1. In the `responseGoogle(response) {...}` callback function, you should get back a standard JWT located at `response.tokenId` or `res.getAuthResponse().id_token`\n 2. Send this token to your server (preferably as an `Authorization` header)\n 3. Have your server decode the id_token by using a common JWT library such as [jwt-simple](https://github.com/hokaccha/node-jwt-simple) or by sending a GET request to `https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=YOUR_TOKEN_HERE`\n 4. The returned decoded token should have an `hd` key equal to the hosted domain you'd like to restrict to.\n\n\n## Logout\nUse GoogleLogout button to logout the user from google.\n\n```js\n    import { GoogleLogout } from '@leecheuk/react-google-login';\n    <GoogleLogout\n      clientId=\"658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com\"\n      buttonText=\"Logout\"\n      onLogoutSuccess={logout}\n    >\n    </GoogleLogout>\n  ```\n## Login Props\n\n|    params    |   value  |             default value            |   description    |\n|:------------:|:--------:|:------------------------------------:|:----------------:|\n|    clientId  |  string  |               REQUIRED               | You can create a clientID by creating a [new project on Google developers website.](https://developers.google.com/identity/sign-in/web/sign-in) |\n|    jsSrc     |  string  |https://apis.google.com/js/api.js|URL of the Javascript file normally hosted by Google|\n| hostedDomain |  string  |                   -                  |The G Suite domain to which users must belong to sign in|\n|     scope    |  string  |             profile email            |                  |\n| responseType |  string  |              permission              | Can be either space-delimited 'id_token', to retrieve an ID Token + 'permission' (or 'token'), to retrieve an Access Token, or 'code', to retrieve an Authorization Code.\n| accessType   |  string  |              online                  | Can be either 'online' or 'offline'. Use offline with responseType 'code' to retrieve an authorization code for fetching a refresh token  |\n|   onSuccess  | function |               REQUIRED               |                  |\n|   onFailure  | function |               REQUIRED               |                  |\n|   onScriptLoadFailure  | function |         -                  | If defined, will be called when loading the 'google-login' script fails (otherwise onFailure will be called) |\n|   onRequest  | function |                   -                  |                  |\n|   onAutoLoadFinished  | function |                   -         |                  |\n|   buttonText |  string  |             Login with Google        |                  |\n|   className  |  string  |                   -                  |                  |\n|    style     |  object  |                   -                  |                  |\n| disabledStyle|  object  |                   -                  |                  |\n|   loginHint  |  string  |                   -                  |                  |\n|    prompt    |  string  |                   -                  | Can be 'consent' to force google return refresh token.                |\n|     tag      |  string  |                button                |  sets element tag (div, a, span, etc     |\n|     type      |  string  |               button                |sets button type (submit || button)     |\n|   autoLoad   |  boolean |                 false                |                  |\n| fetchBasicProfile | boolean | true                            |                  |\n| disabled | boolean | false                            |                  |\n| discoveryDocs | - | https://developers.google.com/discovery/v1/using |\n| uxMode       |  string  |  popup   | The UX mode to use for the sign-in flow. Valid values are popup and redirect. |\n| theme | string | light | If set to `dark` the button will follow the Google brand guidelines for dark. Otherwise it will default to light (https://developers.google.com/identity/branding-guidelines) |\n| icon | boolean | true | Show (`true`) or hide (`false`) the Google Icon |\n| redirectUri       |  string  |  -   | If using ux_mode='redirect', this parameter allows you to override the default redirect_uri that will be used at the end of the consent flow. The default redirect_uri is the current URL stripped of query parameters and hash fragment. |\n| isSignedIn | boolean | false | If true will return GoogleUser object on load, if user has given your app permission |\n| render       | function | -                                     | Render prop to use a custom element, use renderProps.onClick |\n| pluginName       | string | -                                     | For Client IDs created before July 29th, 2022 to use the Google Platform Library. You can choose any value. [Reference](https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams) |\nGoogle Scopes List: [scopes](https://developers.google.com/identity/protocols/googlescopes)\n\n## Logout Props\n\n|    params    |   value  |             default value            |   description    |\n|:------------:|:--------:|:------------------------------------:|:----------------:|\n|    clientId  |  string  |               REQUIRED               | You can create a clientID by creating a [new project on Google developers website.](https://developers.google.com/identity/sign-in/web/sign-in) |\n|    jsSrc     |  string  | https://apis.google.com/js/api.js | URL of the Javascript file normally hosted by Google |\n| hostedDomain |  string  |                   -                  | The G Suite domain to which users must belong to sign in |\n|     scope    |  string  |             profile email            |                  |\n| accessType   |  string  |              online                  | Can be either 'online' or 'offline'. Use offline with responseType 'code' to retrieve an authorization code for fetching a refresh token |\n|   onLogoutSuccess  | function |               REQUIRED               |                  |\n|   onFailure  | function |               REQUIRED               |                  |\n|   onScriptLoadFailure  | function |         -                  | If defined, will be called when loading the 'google-login' script fails (otherwise onFailure will be called) |\n|   buttonText |  string  |             Logout of Google        |                  |\n|   className  |  string  |                   -                  |                  |\n| disabledStyle|  object  |                   -                  |                  |\n|   loginHint  |  string  |                   -                  |                  |\n|     tag      |  string  |                button                |  sets element tag (div, a, span, etc     |\n|     type      |  string  |               button                |sets button type (submit || button)     |\n| fetchBasicProfile | boolean | true                            |                  |\n| disabled | boolean | false                            |                  |\n| discoveryDocs | - | https://developers.google.com/discovery/v1/using |\n| uxMode       |  string  |  popup   | The UX mode to use for the sign-in flow. Valid values are popup and redirect. |\n| theme | string | light | If set to `dark` the button will follow the Google brand guidelines for dark. Otherwise it will default to light (https://developers.google.com/identity/branding-guidelines) |\n| icon | boolean | true | Show (`true`) or hide (`false`) the Google Icon |\n| redirectUri       |  string  |  -   | If using ux_mode='redirect', this parameter allows you to override the default redirect_uri that will be used at the end of the consent flow. The default redirect_uri is the current URL stripped of query parameters and hash fragment. |\n| isSignedIn | boolean | false | If true will return GoogleUser object on load, if user has given your app permission |\n| render       | function | -                                     | Render prop to use a custom element, use renderProps.onClick |\n| pluginName       | string | -                                     | For Client IDs created before July 29th, 2022 to use the Google Platform Library. You can choose any value. [Reference](https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams) |\nGoogle Scopes List: [scopes](https://developers.google.com/identity/protocols/googlescopes)\n\n## onSuccess callback ( w/ offline false)\n\nonSuccess callback returns a GoogleUser object which provides access\nto all of the GoogleUser methods listed here: https://developers.google.com/identity/sign-in/web/reference#users .\n\nYou can also access the returned values via the following properties on the returned object.\n\n| property name |  value   |             definition               |\n|:-------------:|:--------:|:------------------------------------:|\n|   googleId    |  string  |           Google user ID             |\n|   tokenId     |  string  |              Token Id                |\n|  accessToken  |  string  |            Access Token              |\n|   tokenObj    |  object  |        Token details object          |\n|  profileObj   |  object  |        Profile details object        |\n\n## onSuccess callback ( w/ offline true)\n\n| property name |  value   |             definition               |\n|:-------------:|:--------:|:------------------------------------:|\n|    code       |  object  |           offline token              |\n\nYou can also pass child components such as icons into the button component.\n```js\n  <GoogleLogin\n    clientId={'658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com'}\n    onSuccess={responseGoogle}\n    onFailure={responseGoogle}\n  >\n    <FontAwesome\n      name='google'\n    />\n    <span> Login with Google</span>\n  </GoogleLogin>\n\n```\n\n\n## onFailure callback\n\nonFailure callback is called when either initialization or a signin attempt fails.\n\n| property name |  value   |             definition               |\n|:-------------:|:--------:|:------------------------------------:|\n|   error       |  string  |           Error code                 |\n|   details     |  string  |      Detailed error description      |\n\n\n\nCommon error codes include:\n\n| error code | description |\n|:----------:|:-----------:|\n| `idpiframe_initialization_failed` | initialization of the Google Auth API failed (this will occur if a client doesn't have [third party cookies enabled](https://github.com/google/google-api-javascript-client/issues/260)) |\n| `popup_closed_by_user` | The user closed the popup before finishing the sign in flow.|\n| `access_denied` | The user denied the permission to the scopes required |\n| `immediate_failed` | No user could be automatically selected without prompting the consent flow. |\n\nMore details can be found in the official Google docs:\n * [GoogleAuth.then(onInit, onError)](https://developers.google.com/identity/sign-in/web/reference#googleauththenoninit-onerror)\n * [GoogleAuth.signIn(options)](https://developers.google.com/identity/sign-in/web/reference#googleauthsigninoptions)\n * [GoogleAuth.grantOfflineAccess(options)](https://developers.google.com/identity/sign-in/web/reference#googleauthgrantofflineaccessoptions)\n\n## Dev Server\n```\nnpm run start\n```\nDefault dev server runs at localost:8080 in browser.\nYou can set IP and PORT in webpack.config.dev.js\n\n## Run Tests\n```\nnpm run test:watch\n```\n\n## Production Bundle\n```\nnpm run bundle\n```\n","readmeFilename":"README.md"}