useEnsAvatar

Get the ENS avatar for an ENS name

Example

import { useEnsAvatar } from "thirdweb/react";
const { data: ensAvatar } = useEnsAvatar({
client,
ensName: "my-ens-name.eth",
});
function useEnsAvatar(options: {
client: ThirdwebClient;
ensName: undefined | null | string;
}): UseQueryResult<null | string, Error>;

Parameters

the client and ENS name to get the avatar for

Type

let options: {
client: ThirdwebClient;
ensName: undefined | null | string;
};

Returns

let returnType: UseQueryResult<null | string, Error>;
  • a query object that resolves to the avatar