Skip to main content

Core Services

Platform-agnostic services that power nauth-toolkit. These services work with any Node.js framework.

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

Authentication Core

ServiceDescription
AuthServiceMain authentication orchestration - signup, login, password management

Audit & Logging

ServiceDescription
AuthAuditServiceAudit trail logging for authentication and security events

Client Information & Security

ServiceDescription
ClientInfoServiceExtract IP address, user-agent, and session context
CsrfServiceCSRF token generation and validation
GeoLocationServiceIP geolocation using MaxMind GeoIP2 (optional, requires configuration)

Multi-Factor Authentication

ServiceDescription
MFAServiceMFA provider registry and orchestration

Social Authentication

ServiceDescription
SocialAuthServiceComplete API for OAuth authentication, account linking, and management

Verification Services

ServiceDescription
EmailVerificationServiceEmail verification code generation and validation
PhoneVerificationServicePhone/SMS verification code generation and validation

Usage Pattern

All services are injected and configured automatically by the framework adapter:

import { Injectable } from '@nestjs/common';
import { AuthService } from '@nauth-toolkit/nestjs';

@Injectable()
export class MyService {
constructor(private readonly authService: AuthService) {}

async example() {
const result = await this.authService.signup({
email: 'user@example.com',
password: 'SecurePassword123!',
});
}
}