Skip to main content

Function: useAuth()

useAuth(): UseAuthReturn

Redirect to the Monerium auth flow.

Returns

UseAuthReturn

  • authorize - Redirects to the Monerium auth flow.
  • isAuthorized - Whether the user is authorized.
  • isLoading - Whether the auth flow is loading.
  • error - Error message if the auth flow fails.
  • disconnect - Disconnect the user.
  • revokeAccess - Revoke the user's access.

Example

const { authorize, isAuthorized, isLoading, error } = useAuth();

authorize(); // Redirects to the Monerium auth flow.

// Opt-in to automated wallet linking with these parameters.
authorize({ address, signature, chain }).

Defined in

sdk-react-provider/src/lib/hooks.tsx:120