UNPKG

@proveanything/smartlinks-auth-ui

Version:

Lightweight React authentication UI components with bearer token support and Smartlinks SDK integration

27 lines 1.08 kB
import React from 'react'; import type { AuthUser, AuthStateChangeCallback } from '../types'; interface AuthContextValue { user: AuthUser | null; token: string | null; accountData: Record<string, any> | null; accountInfo: Record<string, any> | null; isAuthenticated: boolean; isLoading: boolean; login: (token: string, user: AuthUser, accountData?: Record<string, any>) => Promise<void>; logout: () => Promise<void>; getToken: () => Promise<string | null>; refreshToken: () => Promise<string>; getAccount: (forceRefresh?: boolean) => Promise<Record<string, any>>; refreshAccount: () => Promise<Record<string, any>>; clearAccountCache: () => Promise<void>; onAuthStateChange: (callback: AuthStateChangeCallback) => () => void; } interface AuthProviderProps { children: React.ReactNode; accountCacheTTL?: number; preloadAccountInfo?: boolean; } export declare const AuthProvider: React.FC<AuthProviderProps>; export declare const useAuth: () => AuthContextValue; export {}; //# sourceMappingURL=AuthContext.d.ts.map