gebeya-telegram-otp
Version:
Reusable Telegram phone verification components for React applications
52 lines • 1.52 kB
TypeScript
import { ReactNode } from 'react';
export interface TelegramUser {
id: string;
phone?: string;
phone_confirmed_at?: string;
}
export interface TelegramVerificationData {
user: TelegramUser;
phoneNumber: string;
sessionId: string;
verificationMethod: 'telegram';
}
export interface TelegramConfig {
botName: string;
botToken?: string;
}
export interface TelegramVerifyButtonProps {
onVerificationComplete?: (userData: TelegramVerificationData) => void;
onVerificationStart?: () => void;
buttonText?: string;
variant?: 'default' | 'outline' | 'secondary' | 'ghost';
size?: 'sm' | 'default' | 'lg';
className?: string;
}
export interface TelegramVerificationModalProps {
isOpen: boolean;
onClose: () => void;
onVerificationComplete?: (userData: TelegramVerificationData) => void;
onVerificationStart?: () => void;
}
export interface TelegramVerificationProviderProps {
children: ReactNode;
supabaseClient: any;
telegramConfig: TelegramConfig;
onSuccess?: (userData: TelegramVerificationData) => void;
onError?: (error: string) => void;
theme?: {
primaryColor?: string;
borderRadius?: string;
fontSize?: string;
};
}
export interface AuthFlowProps {
onComplete?: (userData: TelegramVerificationData) => void;
}
export type AuthStep = 'phone' | 'qr' | 'otp' | 'success';
export interface CountryOption {
code: string;
name: string;
flag: string;
}
//# sourceMappingURL=index.d.ts.map