@authx-rs/sdk-react
Generated from packages/authx-sdk-react/dist/types.
React provider and hooks for authx token clients.
Modules
Section titled “Modules”AuthxTokenProviderProps
Section titled “AuthxTokenProviderProps”export interface AuthxTokenProviderProps { client: AuthxTokenManager; children?: ReactNode;}AuthxReactContextValue
Section titled “AuthxReactContextValue”export interface AuthxReactContextValue { client: AuthxTokenManager; snapshot: AuthxTokenSnapshot; accessToken: string | null; isAuthenticated: boolean; refresh(): Promise<StoredTokenState>; clear(): Promise<AuthxTokenSnapshot>; setTokens(tokens: StoredTokenState | null): Promise<AuthxTokenSnapshot>; setTokenResponse(response: OidcTokenResponse, options?: { now?: number; preserveRefreshToken?: boolean; }): Promise<AuthxTokenSnapshot>; fetch(input: RequestInfo | URL, init?: RequestInit, options?: AuthxFetchOptions): Promise<Response>;}AuthxTokenProvider
Section titled “AuthxTokenProvider”export declare function AuthxTokenProvider(props: AuthxTokenProviderProps): ReactElement;useAuthxToken
Section titled “useAuthxToken”export declare function useAuthxToken(): AuthxReactContextValue;useAuthxSnapshot
Section titled “useAuthxSnapshot”export declare function useAuthxSnapshot(): AuthxTokenSnapshot;useAccessToken
Section titled “useAccessToken”export declare function useAccessToken(): string | null;useIsAuthenticated
Section titled “useIsAuthenticated”export declare function useIsAuthenticated(): boolean;useAuthenticatedFetch
Section titled “useAuthenticatedFetch”export declare function useAuthenticatedFetch(): (input: RequestInfo | URL, init?: RequestInit, options?: AuthxFetchOptions) => Promise<Response>;