New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by42.86%
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc