About • Features • Example of use • Contributing • Contributors • Author • License
React Social Authenticate provide hooks to make easy implement login with social networks like Facebook and Linkedin in your react app.
- React hook for login with:
- Facebook.
- Google.
- Linkedin.
- [] Twitter.
- [] Spotify.
- [] Microsoft.
import { useFacebookLogin } from 'react-social-authenticate';
interface IExampleLogin {
token: string,
user: {
name: string,
id: string,
email: string,
roles: [
{
name: string,
id: number
}
]
}
};
export const MyComponent = () => {
const facebook = useFacebookLogin<IExampleLogin>({
appId: `YOUR_FACEBOOK_APP_ID`,
language: 'pt-BR',
version: 8.0,
internalAuthenticateURL: 'http://your.backend.app.address/path-to-authenticate-in-your-app',
});
return (
<>
<h1 className="title"> Facebook </h1>
<div className="content">
Usuário:
<p>
{facebook?.userInfos && <img src={facebook?.userInfos?.picture?.data?.url} alt={`${facebook?.userInfos?.name} profile picture`} />}
</p>
</div>
<footer className="footer">
<button className="btn btn-success" onClick={facebook?.logIn}> login </button>
<button className="btn btn-danger" onClick={facebook?.logOut}> logout </button>
</footer>
</>
);
};
Thank you for being interested on making this package better. I encourage everyone to help improving this project with some new features, bug fixes and performance issues, transalting the docs for other languages. Please take a little bit of your time to read our guides, so this process can be faster and easier.
Victor Costa |
- Fork the project.
- Create a new branch with your changes:
git checkout -b feature/my-feature
- Save your changes and create a commit message telling you what you did:
git commit -m" feature: My new feature "
- Submit your changes:
git push origin my-feature
If you have any questions check this guide on how to contribute
Victor Costa
This project is under the license MIT.
Made with love by Victor Costa 👋🏽 Get in Touch!