useAccount
Get the current logged-in user's account.
You can use Comet's login system across your entire app with the useAccount
hook. This hook will tell you if a user is logged in to Comet or not. If they are logged in, it will return that user's account information.
API
The account
object contains the following fields:
id
- the Comet User ID of the logged-in user.username
- the username of the logged-in user.address
- the Solana address of the logged-in user.
If no user is logged in, account
will be null.
Example
App.js
Last updated