π@hsuite/auth-types - Authentication Type Definitions
Table of Contents
Quick Start
npm install @hsuite/auth-typesimport { IAuth, Auth } from '@hsuite/auth-types';
// Use interfaces for type checking
const loginData: IAuth.ICredentials.IWeb2.IDto.ILogin = {
username: "john_doe",
email: "[email protected]",
password: "securePassword123"
};
// Use models for runtime logic
const loginDto = new Auth.Credentials.Web2.Dto.Login(loginData);Key Features
Comprehensive TypeScript library for authentication and authorization type definitions
ποΈ Architecture
Core Namespaces
π IAuth (Interfaces)
ποΈ Auth (Models)
π₯ User (Models)
π― Decorators
Module Structure
π§ API Reference
Decorators
@Roles(roles: string[])
@Public()
@isTwoFactorAuth()
@bypassTokenGate()
Core Interfaces
IAuth.IConfiguration.IAuthentication
IAuth.ICredentials.IWeb2.IDto.ILogin
IAuth.ICredentials.IWeb2.IDto.ISignup
IAuth.ICredentials.IUser.IEntity
Model Classes
Auth.Configuration.Authentication
Auth.Credentials.Web2.Dto.Login
Auth.Credentials.Web3.Entity
Auth.TwoFactor.Auth
π Guides
Decorator Usage Guide
Interface Reference Guide
Model Implementation Guide
π― Examples
Role-Based Access Control
Web2 Authentication Models
Web3 Authentication Models
Two-Factor Authentication
User Types
Configuration Models
π Integration
Required Dependencies
TypeScript Configuration
Metadata Keys
π― Best Practice: Use interfaces for type definitions and model classes for runtime validation and data transformation.
Previous@hsuite/auth - Authentication & User Management ModuleNext@hsuite/client - Client Service Module
Last updated