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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anarchitects/auth-angular

v2.1.0

Published

Angular domain libraries for the Anarchitecture auth domain. The package is organized into standalone slices (config, data-access, feature, state, util, ui) that compose implementation-aligned authentication flows for Angular applications.

Readme

@anarchitects/auth-angular

Angular domain libraries for the Anarchitecture auth domain. The package is organized into standalone slices (config, data-access, feature, state, util, ui) that compose implementation-aligned authentication flows for Angular applications.

Features

  • config: DI tokens and provider helpers (API base URL, defaults)
  • data-access: generated OpenAPI clients plus adapters over the Nest API
  • state: signal-based store plus explicit provider helper for login/logout, token refresh, and ability hydration
  • feature: router policy guard and orchestration components that delegate rendering to auth UI components
  • util: CASL ability helpers (createAppAbility, AppAbility)
  • ui: presentational auth domain form components built on AnarchitectsUiForm

Installation

npm install @anarchitects/auth-angular
# or
yarn add @anarchitects/auth-angular

Peer dependencies: Angular v20+, @ngrx/signals, @sinclair/typebox, and the sibling packages @anarchitects/auth-ts & @anarchitects/auth-nest (for end-to-end flows).

Usage

Quick start

// app.config.ts
import { ApplicationConfig } from '@angular/core';
import { provideAuthConfig } from '@anarchitects/auth-angular/config';
import { provideAuthDataAccess } from '@anarchitects/auth-angular/data-access';
import { provideAuthState } from '@anarchitects/auth-angular/state';

export const appConfig: ApplicationConfig = {
  providers: [
    provideAuthConfig({
      apiBaseUrl: 'https://api.anarchitects.dev',
    }),
    provideAuthDataAccess(),
    provideAuthState(),
  ],
};
// app.component.ts
import { Component, inject } from '@angular/core';
import { AuthStore } from '@anarchitects/auth-angular/state';

@Component({
  selector: 'app-root',
  template: `
    <button (click)="login()">Login</button>
    <p *ngIf="store.isLoggedIn()">Welcome {{ store.loggedInUser()?.email }}</p>
  `,
})
export class AppComponent {
  readonly store = inject(AuthStore);

  login() {
    this.store.login({ credential: '[email protected]', password: 'secret' });
  }
}
// app.routes.ts
import { Routes } from '@angular/router';
import { policyGuard } from '@anarchitects/auth-angular/feature';

export const routes: Routes = [
  {
    path: 'admin',
    canMatch: [policyGuard],
    data: { action: 'manage', subject: 'admin-section' },
    loadComponent: () => import('./admin.component').then((m) => m.AdminComponent),
  },
];

Secondary entry points

| Import path | Description | | ---------------------------------------- | --------------------------------------- | | @anarchitects/auth-angular/config | DI tokens and providers | | @anarchitects/auth-angular/data-access | Generated API clients and HTTP adapters | | @anarchitects/auth-angular/state | Signal store and CASL ability sync | | @anarchitects/auth-angular/feature | Router policy guard | | @anarchitects/auth-angular/ui | Auth domain form UI components | | @anarchitects/auth-angular/util | CASL ability factory and typings |

Nx scripts

  • nx build auth-angular – build the Angular package
  • nx test auth-angular – execute unit tests (Jest)
  • nx lint auth-angular – run ESLint against the library

Development notes

  • DTOs live in @anarchitects/auth-ts; regenerate OpenAPI docs when route schemas change (nx run api-specs:generate).
  • Data-access layer should always use the generated OpenAPI clients—no manual HTTP calls.
  • State layer uses Angular signals via @ngrx/signals for reactive updates and caches the CASL ability returned by the API.
  • Ability creation is centralised in @anarchitects/auth-angular/util; import createAppAbility instead of instantiating CASL directly.
  • Keep UI, feature, data-access, state, and config layers decoupled per architecture guidelines.

License

Licensed under the Apache License, Version 2.0.