1.0.3 • Published 4 years ago

firebase-oauth-lite v1.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

firebase-oauth-lite

Lightweight Firebase OAuth Library

Getting Started

Prerequisites

Firebase authentication providers must be set using firebase console.

Installing

npm install firebase-oauth-lite

Using

Initialize

import Auth from 'firebase-oauth-lite';

const firebaseConfig = {
    apiKey: "<API_KEY>",
    redirectURL: '<REDIRECT_URL>',
    providers: ['google.com', 'facebook.com', 'twitter.com', 'github.com']
};

const FirebaseAuth = new Auth(firebaseConfig);

export default FirebaseAuth;

Sign-in

FirebaseAuth.signInWithProvider('google.com');

Handle OAuth Redirects

FirebaseAuth.handlePostSignInRedirect();

Listen to auth state changes

this.unregisterAuthListener = FirebaseAuth.addListener((user) => {
    ...
});

Sign-out

FirebaseAuth.signOut();

Versioning

For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago