npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

o2-auth-fb-service

v0.4.4

Published

[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)

Downloads

4

Readme

o2-auth-fb-service Authentication Service by Firebase for Angular5

MIT License

o2-auth-fb-service is a library for authenticating users by Firebase service by Angular5.

Video Explanation https://youtu.be/WdaarC4sOg8

Overview

o2-auth-fb-service is a tool for using Firebase authentication service by using Angular5

Main functions

  • Signup (using Firebase authentication service)
  • Login
    • Email
    • Google
    • Facebook
    • Twitter
    • GitHub
  • Logout

Prerequisite

  • Node.js
  • TypeScript2
  • Angular5
  • Firebase
  • AngularFire2

Installation

To install this library, run:

$ npm install o2-auth-fb-service --save

Step by Step Installation of a demo program based on Angular/CLI

Install Demo Program

Make your some directory for testing and change into the directory.

$ md test
$ cd test

Next run git clone like this.

$ git clone https://github.com/Ohtsu/o2-auth-fb-service-demo.git 
$ cd o2-auth-fb-service-demo 
$ npm install

Get Firebase config data

Of course you need to have Firebase account and your own project. If you don't have the account, visit the following page in advance and make your own project.

https://www.firebase.com/login/

You need to get Firebase config data from your own project page. This url is as follows.

https://console.firebase.google.com/project/your-project-name/overview

You need the following parameters

  • apiKey
  • authDomain
  • databaseURL
  • storageBucket
  • messagingSenderId

In "Overview" page, click Web Application icon.

Then those parameters above will be shown. Copy them.

Modify environment.ts

Change directory to "src/app/environments".

$ cd src/app/environments

You will find environment.ts and environment.prod.ts. Modify these files as follows. In firebaseConfig, paste the data above.

export const environment = {
  production: true,
  // Add Start --------------------------------------------
  firebase: {
    apiKey: '"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    authDomain: 'xxxxxxxxxxxxxxxxxx.firebaseapp.com',
    databaseURL: 'https://xxxxxxxxxxxxxxxxxx.firebaseio.com',
    projectId: 'xxxxxxxxxxxxx',
    storageBucket: 'xxxxxxxxxxxxx.appspot.com',
    messagingSenderId: 'xxxxxxxxxxxxxxxxxxxxx'
  }
  // Add End --------------------------------------------
};

Add Login method in Firebase

If you want to use the 3rd party authentications such as Google, Facebook, Twitter and GitHub, you need add login methods in Firebase Authentication page. Set the target login method enable in the status.

Start demo program

If you start local server as follows, you can get the home page in your browser by accessing http://localhost:4200.

$ ng serve

Try change the page by accessing by accessing http://localhost:4200/signup. You will find the following page.

Next change the page by accessing by accessing http://localhost:4200/signin. You will find the following page.

In this page, open the developer tool (type control + shift + i in Chrome) and select Console tab. If you have not logged in yet, you will find is Authenticated ---- false.

Try to click Login Google button (Of course you need to enable Google login method), you will find Google Login Popup Window.

If you succeed in the authentication, you will find the messages such as is Authenticated ---- true, token ---, user --- and so on.

Version

  • o2-auth-fb-service : 0.4.3
  • Angular : 5.0.0
  • TypeScript : 2.4.2
  • @angular/cli : 1.5.0
  • firebase : 4.8.0
  • angularfire2: 5.0.0-rc.4

Reference

Change Log

  • 2017.12.31 version 0.4.3 uploaded
  • 2018.1.10 version 0.4.4 Add Video Explanation URL

Copyright

  • copyright 2017 by Shuichi Ohtsu (DigiPub Japan)

License

MIT © Shuichi Ohtsu