Skip to content

authenticate

Submit a Sign In With Farcaster message, user signature, and profile data to the Connect relay server.

ts
const params = await walletClient.authenticate({
  message: 'example.com wants you to sign in with your Ethereum account…',
  signature: '0x9335c3055d47780411a3fdabad293c68c84ea350a11794cdc811fd5…',
  fid: 1,
  username: 'alice',
  bio: "I'm a little teapot who didn't fill out my bio",
  displayName: 'Alice Teapot',
  pfpUrl: 'https://images.example.com/profile.png',
});

Parameters

ParameterTypeDescriptionRequired
authKeystringFarcaster Auth API key. Farcaster Auth v1 restricts calls to /authenticate to Warpcast.Yes
channelTokenstringFarcaster Auth channel token.Yes
messagestringThe Sign in With Farcaster message produced by your wallet app and signed by the user.Yes
messagestringThe Sign in With Farcaster message produced by your wallet app and signed by the user.Yes
signatureHexSIWE signature created by the wallet user's account.Yes
fidnumberWallet user's fid.Yes
usernamestringWallet user's Farcaster username.Yes
biostringWallet user's bio.Yes
displayNamestringWallet user's display name.Yes
pfpUrlstringWallet user's profile photo URL.Yes

Returns

ts
{
  response: Response
  data: {
      state: 'completed'
      nonce: string
      message?: string
      signature?: `Hex`
      fid?: number
      username?: string
      bio?: string
      displayName?: string
      pfpUrl?: string
  }
  isError: boolean
  error: Error
}
ParameterDescription
responseHTTP response from the Connect relay server.
data.stateStatus of the sign in request, either "pending" or "complete"
data.nonceRandom nonce used in the SIWE message.
data.messageThe generated SIWE message.
data.signatureHex signature produced by the user's Warpcast wallet.
data.fidUser's Farcaster ID.
data.usernameUser's Farcaster username.
data.bioUser's Farcaster bio.
data.displayNameUser's Farcaster display name.
data.pfpUrlUser's Farcaster profile picture URL.
isErrorTrue when an error has occurred.
errorError instance.