Interacting with Lens protocol

In Lens protocol, each profile is represented by an ERC721 token. In this particular context, the tokenId (of the ERC721 token) is the profileId. They can be used interchangably.

Get Lens profile metadata from a profileId

import { getProfileMetadata } from "thirdweb/extensions/lens";
const profileData = await getProfileMetadata({ profileId, client });
if (profileData) {
console.log("Display name: ", profileData.lens.name);
console.log("Bio: ", profileData.lens.bio);
}

Get the owner's wallet address from their Lens handle

import { resolveAddress } from "thirdweb/extensions/lens";
const walletAddress = await resolveAddress({
name: "vitalik",
client,
});