{"_id":"@bitrock-it/databiz-login","_rev":"3-47d4b49ce4475456df335378e4ce0b4d","name":"@bitrock-it/databiz-login","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bitrock-it/databiz-login","version":"1.0.0","main":"src/components/databiz.login.js","displayName":"databiz-login","config":{"themeColor":"#e74e0f"},"description":"Web Component to simplify authentication using Google oAuth for Databiz group domains.","repository":{"type":"git","url":"git+ssh://git@github.com/bitrock-frontend/basic-starter-kit.git"},"author":{"name":"Salvatore Laisa","email":"salvatore.laisa@bitrock.it"},"license":"MIT","scripts":{"start":"NODE_ENV=development webpack-serve --config ./webpack.demo.js","build":"NODE_ENV=production webpack","demo":"NODE_ENV=production webpack --config ./webpack.demo.js","deploy":"NODE_ENV=production npm run demo && gh-pages -d dist","test:unit":"NODE_ENV=test ava ./test/index.js --verbose","test":"npm run test:unit"},"devDependencies":{"ava":"0.25.0","css-loader":"1.0.0","cypress":"3.0.2","dotenv-webpack":"1.5.7","esm":"3.0.71","favicons-webpack-plugin":"0.0.9","gh-pages":"1.2.0","html-webpack-plugin":"3.2.0","jsdom":"11.11.0","style-loader":"0.21.0","webpack":"4.16.1","webpack-cli":"3.0.8","webpack-dev-server":"3.1.4","webpack-serve":"2.0.2"},"dependencies":{"lit-html":"0.10.2","normalize.css":"8.0.0","typebase.css":"0.5.0"},"ava":{"require":["esm"]},"gitHead":"a857dd5723f91f9efe7fcc443c5d35a200b5695f","bugs":{"url":"https://github.com/bitrock-frontend/basic-starter-kit/issues"},"homepage":"https://github.com/bitrock-frontend/basic-starter-kit#readme","_id":"@bitrock-it/databiz-login@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"moebiusmania","email":"moebiusmania@gmail.com"},"dist":{"integrity":"sha512-vT4fezq96LkuSdafIw0nMRdF231gz+7QpiMDh9Wf7xaXjHkkut44uvmG1hFbWVnFGUv3GhhiKFeZYtTvnq6EQg==","shasum":"6568c0f6ecb2116ce08fb525c1754246cdbb3695","tarball":"https://registry.npmjs.org/@bitrock-it/databiz-login/-/databiz-login-1.0.0.tgz","fileCount":23,"unpackedSize":294308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbUolCRA9TVsSAnZWagAA5h8P/2o0+pp8zSD2CHH2zYvi\nNgoFBCh7jeSdxmhzx1eZ3hGD4fPyHx/5dua4hnreumseGzbHS7U0JSwusC8+\nWX8ZF0dlNFvFNpp4Cmts31mdgcckKZqTrmZ+boAYGOmIh9+gspByxTvxdkFi\n5pO9L4R9dTFoiQ8S+xERE4gyAfMss9Ub/mlJlKiy+V0iaciqvt0eaYwL0HSl\nc/4aJKjxHrqCwjodFarf+h/VlvvwII1fPiLhKS8v2RQ01MRsDwU06XC9iOPt\nEGkCbUUH8yCXZsFpG+jIKioigBtJK9IpZO/yp1ns5u9xZHLK4Cmri/dlyuUh\nvipipii4u3fLhjOMJOOWfX4G24KtDpISbM8Wvgk9cTUdkti43qDwcFVq9kif\nDnDqnbo9WIrmfj5XMmcE/c+lCkfFi2T7LFNTG0FcLFhkiulm3bm6iAAIdmWT\nq9xayykTHoiUKAfv4iSPBF5D+djEAxRZVXqBTYkZ1tx77BW/IW9nqUR8N3wb\nNhOXzFkbfg+hPbN/IRdAbffeLjCBZ8PcqxytPyjIyGFT+HeQ1UYfu/Y7JLdq\nhozXckC8b1/+m7RbedU94fVoApQAs+PJ3MWqloW85NDlQpf3zTSFExqSphNO\nFXcE099pTsyBhudXS7YqzOw556oxl1R4GwZRtsLJXOXBAoxDJXSn5VmbWGrJ\n/KAl\r\n=IZZN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvkb3QobnnIAb3JswCHjgLmEGIyhYxta1Yrb8feLFlHAIgYSkhyQwUQYYSveh0hPOeAmm+dm1bjy7Y86VbfRbXAiY="}]},"maintainers":[{"name":"moebiusmania","email":"moebiusmania@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/databiz-login_1.0.0_1533889060911_0.8394977490195332"},"_hasShrinkwrap":false,"deprecated":"WARNING: moved to @databiz/login"}},"time":{"created":"2018-08-10T08:17:40.810Z","1.0.0":"2018-08-10T08:17:41.158Z","modified":"2022-04-04T19:13:26.916Z"},"maintainers":[],"description":"Web Component to simplify authentication using Google oAuth for Databiz group domains.","homepage":"https://github.com/bitrock-frontend/basic-starter-kit#readme","repository":{"type":"git","url":"git+ssh://git@github.com/bitrock-frontend/basic-starter-kit.git"},"author":{"name":"Salvatore Laisa","email":"salvatore.laisa@bitrock.it"},"bugs":{"url":"https://github.com/bitrock-frontend/basic-starter-kit/issues"},"license":"MIT","readme":"# @databiz/google-login\n\n[![Build Status](https://travis-ci.org/bitrockteam/databiz-login.svg?branch=master)](https://travis-ci.org/bitrockteam/databiz-login)\n\n> Web Component to simplify authentication using Google oAuth for Databiz group domains.\n\n### How to use\n\nInstall the package from NPM registry\n```bash\n$ npm install @databiz/google-login\n--- or ---\n$ yarn add @databiz/google-login\n```\n\nIf you want to include the compiled version (no build-step neeed), just load the script tag:\n```html\n<script src=\"./node_modules/@bitrock-it/databiz-login/component.js\" async defer></script>\n```\n\nOr if you are working with Webpack and ES modules:\n```javascript\nimport '@bitrock-it/databiz-login';\n```\n\nthen in your markup add\n\n```html\n<databiz-login\n  client-id=\"YOUR-CLIENT-ID\"\n></databiz-login>\n```\n\nthe `client-id` is a required parameter and you can obtain it from the Google Developer console.\n\nThis will render the Google login button, once clicked a popup will be prompted to user to choose an account and confirm.\n\nTo react to the login attempt the component fires two custom events: `signin-success` and `signin-error`.\n\nA quick example:\n\n```javascript\nconst $login = document.querySelector('databiz-login');\n\n$login.addEventListener('signin-success', \n  evt => console.log(evt.detail));\n\n$login.addEventListener('signin-error', \n  evt => console.log(evt.detail));\n```\n\nThe `signin-success` event will return an object inside the detail with the following data:\n\n* `token`: the token_id returned from Google authentication\n* `profile`: the data exposed by the `googleUser.getBasicProfile()` in the SDK.\n\nTo trigger the logout from the current session you must import the `signOut` method from the main package:\n\n```javascript\nimport { signOut } from '@bitrock-it/databiz-login';\n\n// ...some code later...\n\nsignOut().then(() => {\n  // code to execute after the logout is completed\n});\n\n```\n\n### Browser compatibility\nThe component is built following the Custom Elements v1 and EcmaScript 2015 specifications.\n\n| | Chrome | Firefox | Safari | Opera | Edge | IE11 |\n|--|--|--|--|--|--|--|\n| as-is | ☑️ | ☑️ | ☑️ | ☑️ |✖️| ✖️ |\n| CE polyfill | ☑️ | ☑️ | ☑️ | ☑️ | ☑️ | ✖️ |\n\n### Available NPM tasks\nStart the demo page in development mode (live reload)\n```bash\n$ yarn start\n```\n\nCreate a static build in the root folder\n```bash\n$ yarn build\n```\n\n<!-- Run the tests\n```bash\n$ yarn test\n``` -->\n\nRun the build action and deploy to GitHub pages \n```bash\n$ yarn deploy\n```\n\n\n### License\nDeveloped by Bitrock UI Engineering team, released under the [MIT license](LICENSE).\n","readmeFilename":"README.md"}