Skip to main content

API Reference

Complete reference documentation for nauth-toolkit. All APIs documented with TypeScript signatures, validation rules, and framework-specific examples.

Getting Started​

import { AuthService, AuthModule, AuthGuard } from '@nauth-toolkit/nestjs';

Documentation Structure​

Framework Integration​

Core Services​

Data Transfer Objects​

Identity Provider​

  • OIDC Provider - Be an OpenID Connect provider, so other apps can offer "Sign in with your app"

Error Handling​

Feature Packages​

MFA Providers​

npm install @nauth-toolkit/mfa-totp
import { TOTPMFAModule } from '@nauth-toolkit/mfa-totp/nestjs';
import { SMSMFAModule } from '@nauth-toolkit/mfa-sms/nestjs';

@Module({
imports: [
AuthModule.forRoot(config),
TOTPMFAModule,
SMSMFAModule,
],
})

Social Auth Providers​

npm install @nauth-toolkit/social-google
import { GoogleSocialAuthModule } from '@nauth-toolkit/social-google/nestjs';
import { AppleSocialAuthModule } from '@nauth-toolkit/social-apple/nestjs';

@Module({
imports: [
AuthModule.forRoot(config),
GoogleSocialAuthModule,
AppleSocialAuthModule,
],
})

Email & SMS Providers​

npm install @nauth-toolkit/email-nodemailer

Configure in AuthModule.forRoot():

AuthModule.forRoot({
emailProvider: new NodemailerEmailProvider({ ... }),
smsProvider: new TwilioSMSProvider({ ... }),
})

OpenID Connect Provider​

npm install @nauth-toolkit/oidc-provider oidc-provider
import { OIDCProviderModule } from '@nauth-toolkit/oidc-provider/nestjs';

@Module({
imports: [AuthModule.forRoot(config), OIDCProviderModule.forRoot(oidcConfig)],
})

See Set Up the OpenID Connect Provider.

Reading API Documentation​

Services​

Service pages document methods with:

  • TypeScript signatures (parameters and return types)
  • Error codes with NAuthException details
  • Framework-specific examples in tabs
  • Links to related DTOs

DTOs​

DTO pages document request/response objects with:

  • Properties table with validation rules
  • JSON examples
  • Links to services that use them

Configuration​

Configuration pages document settings with:

  • Interface definitions
  • Default values
  • Validation rules

See Configuration for config options.

API Stability​

Public APIs (documented here) are stable and follow semantic versioning:

  • Major versions for breaking changes
  • Minor versions for new features
  • Patch versions for bug fixes

Internal APIs (not documented) may change without notice.

Getting Started:

Need Help?