$ show auth0/auth0-angular
This is an Angular SDK library (`@auth0/auth0-angular`) that integrates Auth0 authentication (OAuth2/OIDC) into Angular single-page applications. It wraps the Promise-based `@auth0/auth0-spa-js` into Angular's reactive ecosystem using RxJS Observables, dependency injection, and Angular Router. The library provides core authentication flows (redirect/popup login, logout, token management), route protection via guards, automatic bearer token injection via HTTP interceptors, and additional features such as MFA, passkeys (WebAuthn), enterprise account linking, custom token exchange, and a MyAccount API client. It supports both traditional NgModule-based and modern standalone (functional) Angular patterns. The playground application included serves as a development and e2e test harness with a local OIDC provider. The architecture is clean, well-tested, and follows Angular best practices, though the core logic is delegated to the underlying Auth0 SPA SDK.
The LLM identified 1 files worth highlighting for reuse:
An abstract class that abstracts navigation logic in Angular applications. If Angular Router is available, it delegates to `router.navigateByUrl`; otherwise it falls back to `window.history.replaceState`. This pattern allows the Auth0 SDK to work in environments where the Angular Router may not be present (e.g., Angular Universal or custom setups). It is self-contained, imports only Angular common/core/router modules, and could be extracted as a standalone library for any Angular package needing platform-aware navigation.