useStatus
A custom React hook to fetch and manage user status from your backend for address-based verifications.
Last updated
A custom React hook to fetch and manage user status from your backend for address-based verifications.
Last updated
To make use of this hook, you must set up your own backend to handle status requests as described .
The useStatus
hook accepts a configuration object with the following options:
endpoint
(required): Your own endpoint for user status.
refetchOnFocus
(optional, default: true
): A boolean value indicating whether to refetch the user status when the window gets focused.
The useStatus
hook returns an object with the following properties:
status
: A string representing the user status. It will be undefined
initially and will be updated with the fetched status when available.
type
: A string representing the user type. It will be undefined
initially and will be updated with the fetched user type when available.
isLoading
: A boolean value indicating whether the data is being fetched from the endpoint.
refetch
: A function that can be called to manually trigger a refetch of the user status.