Skip to content

getAvatar

The getAvatar utility is designed to retrieve an avatar image URL from an onchain identity provider for a given name.

Consider the utility instead of the hook when you use it with Next.js or any Node.js backend.

Supported providers:

  • ENS

Usage

import { getAvatar } from '@coinbase/onchainkit/identity';
 
const avatar = await getAvatar({ ensName: 'vitalik.eth' });

Returns

Promise<GetAvatarReturnType>