🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

@typeheim/fire-auth

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typeheim/fire-auth

Firebase authentication library

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

NPM Version Build Status Package License Discord

FireAuth is Firebase auth library based on Rx principles.

Installation

Install package:

yarn add @typeheim/fire-auth
//or
npm -i @typeheim/fire-auth

Setup singleton services:

import { FireAuth, FireAuthSession } from '@typeheim/fire-auth'

const auth = firebase.auth()

FireAuth.setAuthDriver(auth)
FireAuthSession.setAuthDriver(auth)

Alternatively you can create your own singleton services or set up DI in your framework:

import { AuthManager, AuthSession } from '@typeheim/fire-auth'

const auth = firebase.auth()

const Auth = new AuthManager()
const Session = new AuthSession()

Auth.setAuthDriver(auth)
Session.setAuthDriver(auth)

Sample

import { FireAuth, FireAuthSession, AuthProvidersList } from '@typeheim/fire-auth'

// through provider
FireAuth.throughProvider(AuthProvidersList.Google).signInWithPopup()

// using email/password flow
FireAuth.signIn(new PasswordAuth('email', 'password'))

// getting user object
FireAuthSession.userStream.subscribe(user => /*do your magick*/)

// gedding auth status
FireAuthSession.isLoggedInStream.subscribe(isLoggedIn => /*do your magick*/)

// gedding access token
FireAuthSession.accessTokenStream.subscribe(token => /*do your magick*/)

Keywords

firestore

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts