Documentation
Hooks
useAccountCharacter

useAccountCharacter

Hook for getting the current character. Returns null if there is no connected account or if the connected account does not have any characters.

import { CharacterEntity } from "crossbell";
 
function useAccountCharacter(): CharacterEntity | null;

Usage

import { useAccountCharacter } from "@crossbell/connect-kit";
 
function App() {
	const character = useAccountCharacter();
 
	return (
		<div>
			{character ? `Character: ${character.handle}` : "No Character Yet"}
		</div>
	);
}