{"id":16817115,"url":"https://github.com/phanan/vue-facebook-signin-button","last_synced_at":"2025-03-17T03:31:43.886Z","repository":{"id":51864039,"uuid":"81925922","full_name":"phanan/vue-facebook-signin-button","owner":"phanan","description":"A simple plugin to include a custom Facebook sign-in button into your web app.","archived":false,"fork":false,"pushed_at":"2022-12-06T15:18:54.000Z","size":167,"stargazers_count":137,"open_issues_count":24,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T17:35:28.342Z","etag":null,"topics":["javascript","plugin","vue"],"latest_commit_sha":null,"homepage":null,"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":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T09:02:16.000Z","updated_at":"2024-08-04T08:27:58.000Z","dependencies_parsed_at":"2023-01-24T02:16:22.550Z","dependency_job_id":null,"html_url":"https://github.com/phanan/vue-facebook-signin-button","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-facebook-signin-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-facebook-signin-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-facebook-signin-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanan%2Fvue-facebook-signin-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phanan","download_url":"https://codeload.github.com/phanan/vue-facebook-signin-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841207,"owners_count":20356443,"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","plugin","vue"],"created_at":"2024-10-13T10:46:14.750Z","updated_at":"2025-03-17T03:31:43.615Z","avatar_url":"https://github.com/phanan.png","language":"JavaScript","funding_links":[],"categories":["Components \u0026 Libraries","Utilities [🔝](#readme)","Utilities"],"sub_categories":["Utilities","State Management"],"readme":"# vue-facebook-signin-button\n\n\u003e A simple [Vue](https://vuejs.org) plugin to include a custom [Facebook sign-in button](https://developers.facebook.com/docs/facebook-login/web) into your web app.\n\n\u003cimg src=\"https://github.com/phanan/vue-facebook-signin-button/raw/master/screenshot.png\" width=\"800\" alt=\"Screenshot\"\u003e\n\n## Install\n\nThis plugin can be installed as a module\n\n``` bash\n$ npm install vue-facebook-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: The Facebook SDK must first be loaded asynchronously for the plugin to work. Something like this will do:\n```js\n  window.fbAsyncInit = function() {\n    FB.init({\n      appId      : '{your-app-id}',\n      cookie     : true,  // enable cookies to allow the server to access the session\n      xfbml      : true,  // parse social plugins on this page\n      version    : 'v2.8' // use graph api version 2.8\n    });\n  };\n  (function(d, s, id) {\n    var js, fjs = d.getElementsByTagName(s)[0];\n    if (d.getElementById(id)) return;\n    js = d.createElement(s); js.id = id;\n    js.src = \"//connect.facebook.net/en_US/sdk.js\";\n    fjs.parentNode.insertBefore(js, fjs);\n  }(document, 'script', 'facebook-jssdk'));\n```\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 FBSignInButton from 'vue-facebook-signin-button'\nVue.use(FBSignInButton)\n```\n\nStep 2: Now you have a `fb-signin-button` global component, ready for use. It's best to demonstrate the usage with an example:\n\n``` html\n\u003ctemplate\u003e\n  \u003cfb-signin-button\n    :params=\"fbSignInParams\"\n    @success=\"onSignInSuccess\"\n    @error=\"onSignInError\"\u003e\n    Sign in with Facebook\n  \u003c/fb-signin-button\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nexport default {\n  data () {\n    return {\n      fbSignInParams: {\n        scope: 'email,user_likes',\n        return_scopes: true\n      }\n    }\n  },\n  methods: {\n    onSignInSuccess (response) {\n      FB.api('/me', dude =\u003e {\n        console.log(`Good to see you, ${dude.name}.`)\n      })\n    },\n    onSignInError (error) {\n      console.log('OH NOES', error)\n    }\n  }\n}\n\u003c/script\u003e\n\n\u003cstyle\u003e\n.fb-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: #4267b2;\n  color: #fff;\n}\n\u003c/style\u003e\n```\n\nThat's it!\n\n\u003e Looking for the [Google counterpart](https://github.com/phanan/vue-google-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-facebook-signin-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphanan%2Fvue-facebook-signin-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanan%2Fvue-facebook-signin-button/lists"}