{"id":13535815,"url":"https://github.com/phanan/vue-google-signin-button","last_synced_at":"2025-10-26T16:12:28.178Z","repository":{"id":13992322,"uuid":"75591343","full_name":"phanan/vue-google-signin-button","owner":"phanan","description":"🔐 A simple Vue plugin to include a Google sign-in button into your web app.","archived":false,"fork":false,"pushed_at":"2022-12-06T19:47:17.000Z","size":396,"stargazers_count":292,"open_issues_count":25,"forks_count":48,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T12:30:35.206Z","etag":null,"topics":["javascript","vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phanan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["phanan"]}},"created_at":"2016-12-05T05:19:28.000Z","updated_at":"2024-02-25T11:31:37.000Z","dependencies_parsed_at":"2023-01-11T20:21:36.412Z","dependency_job_id":null,"html_url":"https://github.com/phanan/vue-google-signin-button","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-google-signin-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-google-signin-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-google-signin-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-google-signin-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phanan","download_url":"https://codeload.github.com/phanan/vue-google-signin-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166169,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","vue"],"created_at":"2024-08-01T09:00:28.426Z","updated_at":"2025-10-26T16:12:23.117Z","avatar_url":"https://github.com/phanan.png","language":"JavaScript","funding_links":["https://github.com/sponsors/phanan"],"categories":["Utilities [🔝](#readme)","UI组件","Components \u0026 Libraries","Utilities","JavaScript"],"sub_categories":["Utilities","State Management"],"readme":"# vue-google-signin-button\n\n\u003e A simple [Vue](https://vuejs.org) plugin to include a [Google sign-in button](https://developers.google.com/identity/sign-in/web/sign-in) into your web app.\n\n\u003cimg src=\"https://github.com/phanan/vue-google-signin-button/raw/master/screenshot.png\" width=\"677\" alt=\"Screenshot\"\u003e\n\n## Install\n\nThis plugin can be installed as a module\n\n``` bash\n$ npm install vue-google-signin-button\n```\n\nor, if you're not in a modular environment, just include it as a `\u003cscript\u003e`.\n\n## Usage\n\n\u003e Important: `https://apis.google.com/js/api:client.js` must be included as a `\u003cscript\u003e` in your web app, as this plugin depends on it.\n\nStep 1: `import` and `use` the plugin if you're in a modular environment (you don't need this step otherwise, as the plugin will register itself).\n\n``` js\nimport GSignInButton from 'vue-google-signin-button'\nVue.use(GSignInButton)\n```\n\nStep 2: Now you have a `g-signin-button` global component, ready for use. It's best to demonstrate the usage with an example:\n\n``` html\n\u003ctemplate\u003e\n  \u003cg-signin-button\n    :params=\"googleSignInParams\"\n    @success=\"onSignInSuccess\"\n    @error=\"onSignInError\"\u003e\n    Sign in with Google\n  \u003c/g-signin-button\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nexport default {\n  data () {\n    return {\n      /**\n       * The Auth2 parameters, as seen on\n       * https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams.\n       * As the very least, a valid client_id must present.\n       * @type {Object}\n       */\n      googleSignInParams: {\n        clientId: 'YOUR_APP_CLIENT_ID.apps.googleusercontent.com'\n      }\n    }\n  },\n  methods: {\n    onSignInSuccess (googleUser) {\n      // `googleUser` is the GoogleUser object that represents the just-signed-in user.\n      // See https://developers.google.com/identity/sign-in/web/reference#users\n      const profile = googleUser.getBasicProfile() // etc etc\n    },\n    onSignInError (error) {\n      // `error` contains any error occurred.\n      console.log('OH NOES', error)\n    }\n  }\n}\n\u003c/script\u003e\n\n\u003cstyle\u003e\n.g-signin-button {\n  /* This is where you control how the button looks. Be creative! */\n  display: inline-block;\n  padding: 4px 8px;\n  border-radius: 3px;\n  background-color: #3c82f7;\n  color: #fff;\n  box-shadow: 0 3px 0 #0f69ff;\n}\n\u003c/style\u003e\n```\n\nThat's it!\n\n\u003e Looking for the [Facebook counterpart](https://github.com/phanan/vue-facebook-signin-button)?\n\n## License\n\nMIT © [Phan An](http://phanan.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanan%2Fvue-google-signin-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphanan%2Fvue-google-signin-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanan%2Fvue-google-signin-button/lists"}