This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

google-facebook-signin-react
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

google-facebook-signin-react

npm version JavaScript Style Guide

Social Single SignOn React.JS: (Google & Facebook) (Needed additional other social platform)

Image

Install

npm install --save google-facebook-signin-react

Link Web: https://socialsso.netlify.com

Link Demo

NPM

Github

Contribute

Create pull request. Thanks ( needed additional github, instagram, twitter)

Usage

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 (
      <div>
        <FacebookSignIn
          appId={"YOUR_APP_ID"}
          onReject={this.error}
          onResolve={this.success}
        >
          Facebook
        </FacebookSignIn>
        <GoogleSignIn
          client_id={
            "YOUR_CLIENT_ID"
          }
          onReject={this.error}
          onResolve={this.success}
        >
          Google
        </GoogleSignIn>
      </div>
    );
  }
}

Props

Google Button

More detail: Google Developer

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

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

Package Sidebar

Install

npm i google-facebook-signin-react

Weekly Downloads

12

Version

1.2.0

License

MIT

Unpacked Size

127 kB

Total Files

11

Last publish

Collaborators

  • cuongmanhnguyen