Skip to content

Latest commit

 

History

History
166 lines (130 loc) · 5.07 KB

README.md

File metadata and controls

166 lines (130 loc) · 5.07 KB

A package to make authentication with social networks using react hooks be simple!

GitHub language count Repository size Follow me on Twitter GitHub last commit License Stargazers

Status: In development

AboutFeaturesExample of useContributingContributorsAuthorLicense

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

Victor Costa Github profile picture
Victor Costa

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

Victor Costa
Victor Costa

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