@thzero/library_client_firebase

0.18.3 • Public • Published

GitHub package.json version David License: MIT

library_client_firebase

Requirements

NodeJs

NodeJs version 18+

Installation

NPM

Configuration

Firebase

Google Firebase (https://firebase.google.com) provides the social based authentication; currently only Google social accounts are supported.

  • Add a new project
    • If not already completed when setting up the server application
  • Setup Authentication, enabled Google in the Sign-in method.
    • If not already completed when setting up the server application
  • Get the Firebase SDK configuration
    • Go to Project Overview->Settings->General
    • Click Add App and select Web
      • Click Firebase SDK snippet, select *Config
      • Select the JSON object and store it
      • The contents of the JSON object will be stored as key/value pairs in the external/firebase confib object (below)
  • Supports Firebase Analytics.
    • Go to Project Overview->Settings->Integrations
      • Enable the Google Analytics.
      • Copy the 'measurementId' key//value pair into the external/firebase config object (below)

Application Configuration

  • In the configuration files (development.json and production.json) of the application
    • Add the following onfiguration block to contain the firebase key.
	,
	"external": {
		"firebase": <firebase key JSON object from above goes here>
	}

Locales

Merge the following to the 'src/locals/en/index.json' file:

{
	"admin": {
		"users": "Users"
	},
	"forms": {
		"externalId": "External Id",
		"news": {
		  "requiresAuth": "Requires Authentication",
		},
		"role": "Role",
		"roles": "Roles",
	},
	"news": {
		"requiresAuth": "Authenticated",
	},
	"users": {
		"actions": "Actions",
		"externalId": "External Id",
		"id": "Id",
		"name": "Name",
		"role": "Role",
		"roles": "Roles"
	}
 }

Main.js

  • Add the following import statement to the 'main.js' file.
import bootStarter from '@thzero/library_client_firebase/boot/starter';
  • Adjust the start method of the 'main.js' file to iclude 'bootAuth' as the last parameter.
start(app, router, store, vuetify, [ ... ], bootStarter);

Route.js

Routes can be denoted as not requiring authentication. To do so, tag on the route the following in the 'meta node'.

    requiresAuth: false

It is advised that the following routes should have authentication turned off.

  • Home
  • About
  • Open Source
  • Auth
  • Not Found
  • Blank

It is advised that the following routes should have authentication turned on.

  • Admin
  • Settings
  • Support
  • Any application routes that require authenticated users.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.18.3
    65
    • latest

Version History

Package Sidebar

Install

npm i @thzero/library_client_firebase

Weekly Downloads

74

Version

0.18.3

License

MIT

Unpacked Size

23.3 kB

Total Files

6

Last publish

Collaborators

  • thzero