Skip to main content

Function.useKeybanAuth

function useKeybanAuth(): AuthContext

Hook that provides authentication functionality using the Keyban client.

To access the Keyban service, the user must authenticate with the Keyban services. The goal is to ensure that only the user has access to their wallet. The application itself does not have direct access to the wallet unless the user authenticates. This approach enhances security by preventing unauthorized access.

This hook must be used within a KeybanProvider component.

Returns

AuthContext

The Keyban authentication context.

  • login: A function to log in the user, see AuthContext
  • logout: A function to log out the user, see AuthContext
  • isAuthenticated: A boolean indicating whether the user is authenticated, see BaseAuth
  • user: An object representing the user, see BaseAuth
  • isLoading: A boolean indicating whether the authentication status is still being determined, see BaseAuth

Throws

If the hook is used outside of a KeybanProvider.