> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/api-integrations/authentication-api/facebook-oauth.md).

# Facebook oAuth

### Install Facebook Auth plugin

&#x20;[How to install a plugin](/plugins/using-plugins/user-authentication-plugins-not-web3/facebook-oauth-plugin.md)

### Example for React app

Please, install the node dependency

```
npm install react-facebook-login --save
```

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

<FacebookLogin
          appId={you_app_id_in_fb}
          autoLoad={true}
          fields="name,email"
          onClick={(d)=>{
            /** **/
          }}
          callback={(d)=>{
           let url = `http://api.directual.com/good/api/v4/auth/`
              let body = { provider: "fb", token: d.accessToken, clientID: you_app_id_in_fb  }
              fetch(url, {
                method: 'POST',
                body: JSON.stringify(req.body),
                headers: {
                  'Content-Type': 'application/json'
                }
              }).then(res2=>{
                res2.json().then(result=>{
                  res.end(JSON.stringify(result))
                }).catch((data)=>{
                  res.end('error')
                })
            
              })
          }} />
```
