Skip to content

watchStatus

Poll for the current status of a Farcaster Auth request.

When the status changes to 'complete' this action resolves with the final channel value, including the Sign In With Farcaster message, signature, and user profile information.

ts
const status = await appClient.watchStatus({
  channelToken: '210f1718-427e-46a4-99e3-2207f21f83ec',
  timeout: 60_000,
  interval: 1_000,
  onResponse: ({ response, data }) => {
    console.log('Response code:', response.status);
    console.log('Status data:', data);
  },
});

Parameters

ParameterTypeDescriptionRequiredExample
channelTokenstringFarcaster Auth channel token.Yes8d0494d9-e0cf-402b-ab0a-394ac7fe07a0
timeoutnumberPolling timeout, in milliseconds. If the connect request is not completed before the timeout, watchStatus returns an error.No300_000
intervalnumberPolling interval, in milliseconds. The client will check for updates at this frequency.No1_000
onResponsefunctionCallback function invoked each time the client polls for an update and receives a response from the relay server. Receives the return value of the latest status request.No({ data }) => console.log(data.fid)

Returns

ts
{
    response: Response
    data: {
      state: "pending";
      nonce: string;
      metadata: {
        ip: string;
        userAgent: string;
      };
      acceptAuthAddress: boolean;
    } | {
      state: "completed";
      nonce: string;
      url: string;
      message?: string;
      signature?: `0x${string}`;
      authMethod?: "custody" | "authAddress";
      fid?: number;
      username?: string;
      bio?: string;
      displayName?: string;
      pfpUrl?: string;
      verifications?: string[];
      custody?: Hex;
      signatureParams: {
        siweUri: string;
        domain: string;
        nonce?: string;
        notBefore?: string;
        expirationTime?: string;
        requestId?: string;
        redirectUrl?: string;
      };
      metadata: {
        ip: string;
        userAgent: string;
      };
      acceptAuthAddress: boolean;
    }
    isError: boolean
    error: Error
}
ParameterDescription
responseHTTP response from the Connect relay server.
data.stateStatus of the sign in request, either "pending" or "completed"
data.nonceRandom nonce used in the SIWE message. If you don't provide a custom nonce as an argument, you should read this value.
data.urlURL of the application.
data.messageThe generated SIWE message.
data.signatureHex signature produced by the user's Warpcast wallet.
data.authMethodAuth method used to sign the message. Either "custody" or "authAddress".
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.
data.custodyUser's FID custody address.
data.verificationsList of user's verified addresses.
data.signatureParamsSIWF message parameters.
data.metadata.ipIP address of client request.
data.metadata.userAgentUser agent of client request.
data.acceptAuthAddresstrue if requesting application accepts auth address signatures.
isErrorTrue when an error has occurred.
errorError instance.