@tradly/auth
Version:
Auth package for Tradly - handles authentication (email, phone, social login)
53 lines (52 loc) • 1.49 kB
TypeScript
/**
* Global configuration for Auth package
* Stores domain, env, and baseUrl globally
*/
export interface AuthConfig {
domain: string;
env: string;
baseUrl?: string;
}
/**
* Initialize Auth with domain and environment
* This should be called once at the start of the application
* Multiple domains can be initialized - each is stored separately
* Automatically generates and sets UUID if not already present
*/
export declare function initializeAuth(domain: string, env?: string, baseUrl?: string): void;
/**
* Get current auth configuration for the active domain
*/
export declare function getAuthConfig(): AuthConfig | null;
/**
* Get auth configuration for a specific domain
*/
export declare function getAuthConfigByDomain(domain: string): AuthConfig | null;
/**
* Get domain from config
*/
export declare function getDomain(): string | null;
/**
* Get environment from config
*/
export declare function getEnv(): string | null;
/**
* Get baseUrl from config
*/
export declare function getBaseUrl(): string | null;
/**
* Clear auth configuration for current domain
*/
export declare function clearAuthConfig(): void;
/**
* Clear auth configuration for a specific domain
*/
export declare function clearAuthConfigByDomain(domain: string): void;
/**
* Check if auth is initialized
*/
export declare function isAuthInitialized(): boolean;
/**
* Alias for initializeAuth - exported for convenience
*/
export { initializeAuth as InitializeAuth };