Skip to content

Repository files navigation

React GitHub Login

NPMCircleCI

React component for GitHub login.

Usage

importReactfrom'react';importReactDOMfrom'react-dom';importGitHubLoginfrom'react-github-login';constonSuccess=response=>console.log(response);constonFailure=response=>console.error(response);ReactDOM.render(<GitHubLoginclientId="ac56fad434a3a3c1561e"onSuccess={onSuccess}onFailure={onFailure}/>,document.getElementById('example'));

Props

clientId

{string}required

Client ID for GitHub OAuth application.

redirectUri

{string}

Registered redirect URI for GitHub OAuth application.

scope

{string}

Scope for GitHub OAuth application. Defaults to user:email.

className

{string}

CSS class for the login button.

buttonText

{string}

Text content for the login button.

onRequest

{function}

Callback for every request.

onSuccess

{function}

Callback for successful login. An object will be passed as an argument to the callback, e.g. { "code": "..." }.

onFailure

{function}

Callback for errors raised during login.

Development

$ npm start

Webpack development server starts at http://localhost:8080, loading example/index.html.

About

:octocat: A React Component for GitHub Login

Topics

Resources

Stars

93 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages