1.0.2 • Published 3 years ago

react-social-authenticate v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

About

React Social Authenticate provide hooks to make easy implement login with social networks like Facebook and Linkedin in your react app.


Features

  • React hook for login with:
    • Facebook.
    • Google.
    • Linkedin.
    • [] Twitter.
    • [] Spotify.
    • [] Microsoft.

Example of use

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>
		</>
	);
};

Contributing

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.

Contributors

How to contribute

  1. Fork the project.
  2. Create a new branch with your changes: git checkout -b feature/my-feature
  3. Save your changes and create a commit message telling you what you did: git commit -m" feature: My new feature "
  4. Submit your changes: git push origin my-feature

    If you have any questions check this guide on how to contribute


Author

Twitter Badge Linkedin Badge Gmail Badge


License

This project is under the license MIT.

Made with love by Victor Costa 👋🏽 Get in Touch!


Versions of README

Portuguese | English