Code Monkey home page Code Monkey logo

google-facebook-signin-react's Introduction

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

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

google-facebook-signin-react's People

Contributors

cuongdevjs avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sexyoung

google-facebook-signin-react's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.