Socket
Socket
Sign inDemoInstall

react-fb-auth

Package Overview
Dependencies
20
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-fb-auth

A Component React for Facebook Login


Version published
Maintainers
1
Install size
16.6 kB
Created

Readme

Source

React Facebook Authentication

Component for facebook authentication based on this repository

Example

import React from 'react';
import ReactDOM from 'react-dom';
import FacebookAuth from 'react-fb-auth';

const response = (response) => {
  console.log(response);
}

const fbBtn = ({onClick}) => {
    return <button onClick={onClick}>Login with facebook</button>
}

ReactDOM.render(
  <FacebookAuth
    appId="1032595931187376"
    autoLoad={true}
    fields="name,email,picture"
    component={fbBtn}
    callback={response} />,
  document.getElementById('demo')
);

Component example

import React from 'react';
import FacebookLogin from 'react-facebook-login';

class MyComponent extends React.Component {
  constructor(props) {
      super(props);

      this.response = this.response.bind(this);
  };

  response(response) {
    // Send the token to the server and link the account
    console.log(response);
  };

  render() {
    return (
      <FacebookLogin
        appId="1099597531133376"
        component={({onClick}) => {
            return <button onClick={onClick}>Login with facebook</button>
        }}
        fields="name,email,picture"
        callback={this.response}
      />
    )
  }
}

export default MyComponent;

Parameters

paramsvaluedefault value
appIdstringRequired
scopestringpublic_profile, email, user_birthday
fieldsstringname,email,picture
callbackfunctionresultFacebookLogin
autoLoadbooleanfalse
xfbmlbooleanfalse
reAuthenticatebooleanfalse
btnTextstringThe text of the button
btnClassNamestringClass name for the default button
versionstring2.3
languagestringen_US
componentfunctionThe button used for the auth

Keywords

FAQs

Last updated on 17 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc