react-firebase-connect
v1.0.0
Published
Connect to OAuth2 application with React & Firebase
Downloads
2
Readme
react-firebase-connect
Connect to OAuth2 application with React & Firebase
Install
via npm:
npm install --save react-firebase-connect
via yarn:
yarn add react-firebase-connect
Usage
import React, { Component } from 'react'
import { GithubLogin, initializeApp } from 'react-firebase-connect'
import 'react-firebase-connect/dist/index.css'
// Your firebase tokens
initializeApp({{
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
}})
class App extends Component {
render() {
return (
<GithubLogin
onSuccess={(result) => {
console.log('success:', result)
}}
onFailure={(error) => {
console.log('error:', error)
}}
scopes="repos"
theme="dark"
/>
)
}
}
General
Props
onSuccess: function, Called when the connect succeed
onFailure: function, Called when the connect failed
theme: string, depends on the component it's in, default is "default"
GithubLogin
scopes: string, see Github API documentation
Themes
default:
dark:
FacebookLogin
scopes: string, see Github API documentation
Themes
default:
blue:
Themes
default:
blue:
License
MIT © nowlow