Skip to main content

Frontend SDK

Package: @nauth-toolkit/client Type: Optional Client Library

Optional convenience layer for integrating nauth-toolkit into JavaScript/TypeScript applications. Provides token management, challenge flows, and typed API calls without prescribing UI.

info

The SDK is optional. Advanced users can integrate directly with backend APIs for custom workflows.

Installation

npm install @nauth-toolkit/client

For Angular apps, also install the Angular adapter:

npm install @nauth-toolkit/client-angular

Choose Your Framework

FrameworkGuideWhat You Get
Angular (Standalone)Standalone SetupFunctional interceptor, guards, DI providers
Angular (NgModule)NgModule SetupNAuthModule.forRoot(), class-based guards
ReactSetup & ContextAuthContext, useAuth hook, ProtectedRoute
Mobile (Capacitor)Capacitor SetupNative storage, dual-mode config
Other frameworksGetting StartedGeneric SDK setup for any JS/TS app

Features

FeatureDescription
StandaloneNo runtime dependency on @nauth-toolkit/core; all types bundled
Token DeliveryJSON or cookies mode with automatic handling
Challenge SystemUnified respondToChallenge() for all verification flows
MFA SupportSetup, verify, and manage MFA devices
Social AuthOAuth flow initiation and callback handling
Cross-Tab SyncToken state synchronized across browser tabs (JSON mode)
SSR-SafeInterceptor safely skips auth logic during server rendering
Framework AdaptersAngular bindings included; React patterns documented

Token Delivery Modes

ModeStorageUse Case
cookiesHTTP-only cookiesWeb applications
jsonClient storageMobile/native apps

See Token Management for details on refresh, cross-tab sync, and security.

Feature Guides

Concepts

API Reference