Your bio is a short text field that shows up on your Farcaster profile and gives others a little context about who you are. It’s a lightweight way to personalize your presence on the network.
Like setting a display name or PFP, updating your bio just requires sending a signed message to a Farcaster hub. If you haven’t done that before, check out the following guides first:
Setting your PFP is a lot like setting a display name or username, it’s just a signed message sent to a Farcaster hub. If you’re not familiar with the underlying process, check out these guides first:
Once you’re set up, you can use this script to update your bio.
import { hexToBytes, type Hex } from 'viem';
import {
FarcasterNetwork,
makeUserDataAdd,
Message,
NobleEd25519Signer,
UserDataType,
} from '@farcaster/core';
const HUB_ENDPOINT = 'https://hub.pinata.cloud';
const fid = Number(process.env.WALLET_FID);
// Load the authorized signer
const privateKeyBytes = hexToBytes(process.env.WALLET_SIGNER_PRIVATE_KEY! as Hex);
const signer = new NobleEd25519Signer(privateKeyBytes);
// Set your bio text
const bio = 'not a real doctor';
// Create the signed UserDataAdd message
const message = await makeUserDataAdd(
{ type: UserDataType.BIO, value: bio },
{ fid, network: FarcasterNetwork.MAINNET },
signer
);
console.log('Signed message:', message);
// Encode the message for hub submission
const data = Message.encode(message.value).finish();
console.log('Encoded message data:', data);
// Submit the message to the hub
const response = await fetch(`${HUB_ENDPOINT}/v1/submitMessage`, {
method: 'post',
headers: { 'Content-Type': 'application/octet-stream' },
body: data,
});
console.log('Hub response:', await response.json());
Once submitted, your bio should show up on your profile in clients like Warpcast shortly after the hub processes your message.
Want to update the rest of your profile too? Check out these other posts: