2.0.1 • Published 1 year ago

@sse-auth/github v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

SSE Auth React Github Login

NPM Downloads NPM Downloads npm version

React component for GitHub login.

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import GitHubLogin from '@sse-auth/github';

const onSuccess = response => console.log(response)
const onFailure = response => console.error(response)

ReactDOM.render(
    <GitHubLogin clientId="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.

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago