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

ng-usermanagement

v1.1.2

Published

A simple way to implement user management into your application

Downloads

13

Readme

Table of Contents

Library's Components

  • <ng-register> standalone registration component to create new accounts
  • <ng-login-email-password> standalone login component with email & password
  • <ng-login-google> standalone login component with the google provider
  • <ng-user-settings> standalone user settings component
  • <ng-admin-settings> standalone admin settings component
  • <ng-create-group> standalone create group component
  • <ng-group-list> standalone group list of current logged in user
  • <ng-group-settings> standalone group settings component of given group
  • <ng-group-users-settings> standalone user settings of given group

Supported Providers:

  • email and password (traditional)
  • google

Supported Processes and Actions:

  • sign up
  • sign in
  • sign out
  • delete user's account
  • Impersonate a user (admin only)
  • firestore sync

Supported Angular Guards

  • LoggedInGuard used to protect angular routes from unauthenticated users (with fallback routes via NgxAuthFirebaseUIConfig)
  • AdminAuthGuard used to protect angular routes from non admin users (with fallback routes via NgxAuthFirebaseUIConfig)

Peer Dependencies - please make sure that peerDependencies are installed

"peerDependencies": {
    "@angular/common": "^8.2.0",
    "@angular/core": "^8.2.0",
    "@angular/router": "^8.2.10",
    "@angular/fire": "^5.2.1",
    "@angular/material": "8.2.3",
    "firebase": "^6.6.2",
    "rxjs": "~6.4.0"
  }

Installation

1. Install with npm

Install all of the above dependencies with npm Install the library with npm

npm install ng-usermanagement

2. Configs

Once you have installed the library you need to import the module into the main module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the library
import { NgUserManagementModule } from 'ng-usermanagement';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

const firebaseConfig = {
  authGuardLoggedInURL: "[fallback Url]" // Fallback to this url if the user isn't logged in
  firebaseConfig: {
    apiKey: "[Project Key]",
    authDomain: "[Project Id].firebaseapp.com",
    databaseURL: "https://[Project Id].firebaseio.com",
    projectId: "[Project Id]",
    storageBucket: "[Project Id].appspot.com",
    messagingSenderId: "[messageSender Id]",
    appId: "[App Id]"
  }
};

const inputValidationConfig = {
  required: 'Required',
  email: 'Invalid email address',
  verifyPassword: 'Verify your password',
}

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    NgUserManagementModule.forRoot(firebaseConfig, inputValidationConfig),
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

3. firebase cloud functions

Copy and paste the firebase cloud functions into your cloud functions folder. If the folder doens't exist yet run the following command.

firebase init functions

copy the following cloud functions here

deploy the cloud functions with the following command.

firebase deploy --only functions

4. firestore rules

Copy and paste the firestore rules into your firestore rules file. If the file doesn't exist yet run the following command.

firebase init firestore

copy the following firestore rules here

deploy the firestore rules with the following command.

firebase deploy --only firestore:rules

start cypress testing

ng serve
npm run build:testConfig
npx cypress open

Publishing

Build the library.

ng build ng-usermanagement

navigate to the dist folder cd dist/ng-usermanagement

cd dist/ng-usermanagement
npm publish