{"id":25982,"library":"ng-awesome-node-auth","title":"ng-awesome-node-auth","description":"Angular (v21+) standalone library providing interceptors, guards, and session management for backends using awesome-node-auth. v1.8.4, actively maintained. Key differentiators: fully tree-shakable, reactive signals for user state, smart guards (authGuard/guestGuard), automatic CSRF protection, optional UI sync for themes and feature flags, and SSR compatibility. Integrates seamlessly with Angular 21's standalone APIs via provideAuth and provideAuthUi providers.","status":"active","version":"1.8.4","language":"javascript","source_language":"en","source_url":"https://github.com/nik2208/ng-awesome-node-auth","tags":["javascript","auth","angular","awesome-node-auth","authentication","jwt","admin-ui","lib","typescript"],"install":[{"cmd":"npm install ng-awesome-node-auth","lang":"bash","label":"npm"},{"cmd":"yarn add ng-awesome-node-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add ng-awesome-node-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Angular common utilities","package":"@angular/common","optional":false},{"reason":"Peer dependency for Angular core framework","package":"@angular/core","optional":false}],"imports":[{"note":"ESM only; use named import. ensure path does not include trailing slash.","wrong":"import { provideAuth } from 'ng-awesome-node-auth/';","symbol":"provideAuth","correct":"import { provideAuth } from 'ng-awesome-node-auth'"},{"note":"authGuard is a named export, not a default export. Also available: guestGuard.","wrong":"import AuthGuard from 'ng-awesome-node-auth'","symbol":"authGuard","correct":"import { authGuard } from 'ng-awesome-node-auth'"},{"note":"UiConfigService is re-exported from the main package, not a separate subpath.","wrong":"import { UiConfigService } from 'ng-awesome-node-auth/ui'","symbol":"UiConfigService","correct":"import { UiConfigService } from 'ng-awesome-node-auth'"},{"note":"provideAuthUi is a top-level export from the package.","wrong":"import { provideAuthUi } from 'ng-awesome-node-auth/core'","symbol":"provideAuthUi","correct":"import { provideAuthUi } from 'ng-awesome-node-auth'"},{"note":"user is a signal function exported from the main package.","wrong":"import { user } from 'ng-awesome-node-auth/signals'","symbol":"user","correct":"import { user } from 'ng-awesome-node-auth'"}],"quickstart":{"code":"import { ApplicationConfig } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { provideAuth, provideAuthUi, authGuard, guestGuard } from 'ng-awesome-node-auth';\nimport { LoginComponent, DashboardComponent } from './components';\n\nexport const appConfig: ApplicationConfig = {\n  providers: [\n    provideRouter([\n      { path: 'login', component: LoginComponent, canActivate: [guestGuard] },\n      { path: 'dashboard', component: DashboardComponent, canActivate: [authGuard] }\n    ]),\n    provideAuth({ apiPrefix: '/api/auth' }),\n    provideAuthUi(),\n  ]\n};","lang":"typescript","description":"Shows how to configure ng-awesome-node-auth in an Angular 21 application using provideAuth and provideAuthUi, and protects routes with authGuard and guestGuard."},"warnings":[{"fix":"Upgrade to Angular 21.2.0 or later.","message":"Minimum Angular version 21.2.0 is required.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure provideAuth is only provided in the root ApplicationConfig.","message":"provideAuth() must be called exactly once per application; calling it multiple times may cause token refresh conflicts.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set apiPrefix to match your backend's authentication endpoints, e.g., '/api/auth'.","message":"The interceptors only attach tokens to requests matching the configured apiPrefix; other requests are ignored.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use an older version (<1.0.0) if you must stay on Angular 20, but no support is guaranteed.","message":"Using the library with Angular 20 or below is not supported; peer dependencies enforce Angular 21.","severity":"deprecated","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add provideHttpClient() in your app.config.ts: import { provideHttpClient } from '@angular/common/http'; then add to providers array.","cause":"Missing HttpClientModule or provideHttpClient() in the app providers.","error":"NullInjectorError: No provider for _HttpClient!"},{"fix":"Ensure @angular/core and @angular/common are at version ^21.2.0 and run 'npm install' again.","cause":"Attempting to use the library without appropriate Angular version or missing peer dependencies.","error":"TypeError: Cannot read properties of undefined (reading 'pipe')"},{"fix":"Run 'npm install ng-awesome-node-auth' and verify your tsconfig.json includes 'node_modules' in 'moduleResolution'.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'ng-awesome-node-auth' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}