Skip to main content

Overview

useAppMetadata hook is used to fetch and manage the application metadata. It leverages the react-query library to handle the asynchronous operation and provides error handling and success callbacks.
Use useAppMetadata to fetch identity providers list for OAuth authentication.

Parameters

onSuccess
(metadata: AppMetadata) => void
required
callback function that is called when the fetching process is successful. It receives the AppMetadata object as an argument.
onError
HttpErrorCallback
required
callback function that is called when an error occurs during the fetching process.

Returns

data
AppMetadata | undefined
application metadata object if the fetching process is successful.
AppMetadata type
type AppMetadata = {
  idpProviders: IdentityProvider[];
};
IdentityProvider type
type IdentityProvider = {
  name: string;
  id: string;
  type: string;
};
isLoading
boolean
boolean indicating whether the fetching process is currently in progress.
isError
boolean
boolean indicating whether an error occurred during the fetching process.
error
HttpError | Error
error object if an error occurred during the fetching process.