hp-app-bundle-sdk
Version:
A comprehensive SDK for building mini-applications.
65 lines • 1.73 kB
TypeScript
export interface GoogleAuthConfig {
clientId: string;
scopes?: string[];
hostedDomain?: string;
}
export interface FacebookAuthConfig {
appId: string;
version?: string;
cookie?: boolean;
xfbml?: boolean;
scope?: string;
}
export interface FirebaseAuthConfig {
apiKey: string;
authDomain: string;
projectId: string;
appId: string;
measurementId?: string;
}
export interface AuthConfig {
autoRefresh: boolean;
refreshInterval: number;
tokenStorage: 'localStorage' | 'sessionStorage' | 'memory';
providers: {
google?: GoogleAuthConfig;
facebook?: FacebookAuthConfig;
firebase?: FirebaseAuthConfig;
};
}
export interface UserProfile {
id: string;
name: string;
email: string;
avatar?: string;
[key: string]: unknown;
}
export interface AuthToken {
accessToken: string;
refreshToken?: string;
expiresIn: number;
tokenType: string;
}
export interface FirebaseUser {
uid: string;
email: string | null;
displayName: string | null;
photoURL: string | null;
emailVerified: boolean;
stsTokenManager?: {
accessToken: string;
refreshToken: string;
expirationTime: number;
};
}
export interface IAuthModuleInterface {
login(provider?: 'google' | 'facebook' | 'firebase'): Promise<UserProfile>;
logout(): Promise<void>;
getUserProfile(): Promise<UserProfile>;
getAccessToken(): Promise<string>;
isAuthenticated(): Promise<boolean>;
initializeFirebase(config: FirebaseAuthConfig): void;
firebaseLogin(provider: 'google' | 'facebook'): Promise<UserProfile>;
firebaseSignOut(): Promise<void>;
}
//# sourceMappingURL=types.d.ts.map