https://github.com/cuongdevjs/google-facebook-signin-react
social login react.js (facebook, google)
https://github.com/cuongdevjs/google-facebook-signin-react
button facebook-login google-login react reactjs signin sso sso-login
Last synced: 9 months ago
JSON representation
social login react.js (facebook, google)
- Host: GitHub
- URL: https://github.com/cuongdevjs/google-facebook-signin-react
- Owner: cuongdevjs
- License: mit
- Created: 2019-11-27T09:10:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-08-13T11:36:26.000Z (10 months ago)
- Last Synced: 2025-08-13T13:25:44.502Z (10 months ago)
- Topics: button, facebook-login, google-login, react, reactjs, signin, sso, sso-login
- Language: TypeScript
- Homepage: https://socialsso.netlify.com
- Size: 3.51 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 86
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# google-facebook-signin-react
[](https://badge.fury.io/js/google-facebook-signin-react) [](https://standardjs.com)
#
> Social Single SignOn React.JS: (Google & Facebook) (Needed additional other social platform)
#

#
## Install
```
npm install --save google-facebook-signin-react
```
#### [Link Web: https://socialsso.netlify.com](https://socialsso.netlify.com)
#### [Link Demo](https://codesandbox.io/s/google-facebook-signin-sso-reactjs-fum4f)
#### [NPM](https://www.npmjs.com/package/google-facebook-signin-react)
#### [Github](https://github.com/CuongStf/google-facebook-signin-react)
## Contribute
Create pull request. Thanks ( needed additional github, instagram, twitter)
## Usage
```tsx
import React, { Component } from "react";
import { FacebookSignIn, GoogleSignIn } from "sso-login-react";
export default class App extends Component {
success(res) {
return new Promise((resolve, reject) => {
console.log(res);
resolve();
});
}
error(err) {
console.log(err);
}
render() {
return (
Facebook
Google
);
}
}
```
## Props
#
> ### Google Button
> [More detail: Google Developer](https://developers.google.com)
>
#
| Prop | Type | Default | Description |
| :--------- | :-------: | :-----: | :----------- |
| onResolve | `promise function (required)` | `-` | Response when logged |
| onReject | `function (required)` | `-` | Return rrror |
| client_id | `string (require)` | `-` | id application |
| className | `string (optional)` | `-` | class for button |
| cookie_policy | `string (optional)` | `single_host_origin` | |
| scope | `string (optional)` | `email profile` | |
| fetch_basic_profile | `boolean (optional)` | `true` | get profile information |
| hosted_domain | `string (optional)` |`-` | |
| openid_realm | `string (optional)` | `-` | |
| ux_mode | `string (optional)` | `popup` | Text display when start touch |
| redirect_uri | `string (optional)` | `/` | only mobile |
| prompt | `string (optional)` | `select_account` | "consent", "select_account", "none" |
| response_type | `string (optional)` | `permission` | "id_token", "permission", "code" |
| login_hint | `string (optional)` | `true` | |
| discoveryDocs | `string (optional)` | `https://www.googleapis.com/discovery/v1/apis/drive/v3/rest` | request permision |
| access_type | `string (optional)` | `online` | "online , "offline|
| isDisabled | `boolean (optional)` | `true` | |
#
> ### Facebook Button
> [More detail: Facebook Developer](https://developers.facebook.com)
#
| Prop | Type | Default | Description |
| :--------- | :-------: | :-----: | :----------- |
| onResolve | `promise function (required)` | `-` | Response when logged |
| onReject | `function (required)` | `-` | Return rrror |
| appId | `string (require)` | `-` | id application |
| className | `string (optional)` | `-` | class for button |
| scope | `string (optional)` | `"email, public_profile"` | separate by comma symbol |
| redirect_uri | `string (optional)` | `/` | only mobile |
| state | `string (optional)` | `facebookdirect` | |
| response_type | `string (optional)` | `code` | |
| auth_type | `string (optional)` | `-` | |
| return_scopes | `boolean (optional)` | `true` | return list scope in response |
| enable_profile_selector | `boolean (optional)` | `true` | |
| profile_selector_id | `boolean (optional)` | `true` | |
| language | `string (optional)` | `vi_VN` | |
| isDisabled | `boolean (optional)` | `true` | |
| fieldsProfile | `string (optional)` | `name, email, birthday` | info field profile in response |
| xfbml | `boolean (optional)` | `true` | enabled embedded iframe xml facebook |
| version | `string (optional)` | `v5.0` | |
| cookie | `boolean (optional)` | `true` | enabled cookie send facebook |
## License
MIT © [CuongStf](https://github.com/CuongStf)