@proveanything/smartlinks-auth-ui
Version:
Lightweight React authentication UI components with bearer token support and Smartlinks SDK integration
60 lines • 2.09 kB
TypeScript
import type { AuthResponse, AuthFormData, AuthUIConfig, AuthLogger } from './types';
/**
* AuthAPI - Thin wrapper around Smartlinks SDK authKit namespace
* All authentication operations now use the global Smartlinks SDK
*/
export declare class AuthAPI {
private clientId;
private clientName?;
private log;
constructor(_apiEndpoint: string, clientId: string, clientName?: string, logger?: AuthLogger);
login(email: string, password: string): Promise<AuthResponse>;
register(data: AuthFormData): Promise<AuthResponse>;
loginWithGoogle(token: string, options?: {
googleUserInfo?: {
email: string;
name?: string;
sub: string;
picture?: string;
};
tokenType?: 'id_token' | 'access_token';
}): Promise<AuthResponse>;
sendPhoneCode(phoneNumber: string): Promise<{
verificationId: string;
}>;
verifyPhoneCode(phoneNumber: string, code: string): Promise<AuthResponse>;
requestPasswordReset(email: string, redirectUrl: string): Promise<{
success: boolean;
message: string;
}>;
verifyResetToken(token: string): Promise<{
valid: boolean;
email?: string;
expiresAt?: number;
message?: string;
}>;
completePasswordReset(token: string, newPassword: string): Promise<{
success: boolean;
message: string;
}>;
sendEmailVerification(userId: string, email: string, redirectUrl: string): Promise<{
success: boolean;
message: string;
}>;
verifyEmailWithToken(token: string): Promise<AuthResponse & {
message: string;
}>;
resendVerification(userId: string, email: string, redirectUrl: string): Promise<{
success: boolean;
message: string;
}>;
fetchConfig(): Promise<AuthUIConfig>;
sendMagicLink(email: string, redirectUrl: string): Promise<{
success: boolean;
message: string;
}>;
verifyMagicLink(token: string): Promise<AuthResponse & {
message: string;
}>;
}
//# sourceMappingURL=api.d.ts.map