Skip to main content

Documentation Index

Fetch the complete documentation index at: https://base-a060aa97-pat-schemav2-docs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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:

Usage

Get Basename avatar:
import { getAvatar } from '@coinbase/onchainkit/identity';
import { base, mainnet } from 'viem/chains';

const baseAvatar = await getAvatar({ ensName: 'paulcramer.eth', chain: base });
Get ENS avatar:
import { getAvatar } from '@coinbase/onchainkit/identity';
import { mainnet } from 'viem/chains';

const ensAvatar = await getAvatar({ ensName: 'paulcramer.eth', chain: mainnet });

Returns

Promise<GetAvatarReturnType>