Skip to content

createChannel

Create a Farcaster Auth relay channel.

Returns a secret token identifying the channel, and a URI to display to the end user as a link or QR code.

ts
const channel = await appClient.createChannel({
  siweUri: 'https://example.com/login',
  domain: 'example.com',
});

Parameters

ParameterTypeDescriptionRequiredExample
siweUristringLogin URL for your application.Yeshttps://example.com/login
domainstringDomain of your application.Yesexample.com
noncestringA custom nonce. Must be at least 8 alphanumeric characters.NoESsxs6MaFio7OvqWb
notBeforestringStart time at which the signature becomes valid. ISO 8601 datetime.No2023-12-20T23:21:24.917Z
expirationTimestringExpiration time at which the signature is no longer valid. ISO 8601 datetime.No2023-12-20T23:21:24.917Z
requestIdstringA system specific ID your app can use to refer to the sign in request.No8d0494d9-e0cf-402b-ab0a-394ac7fe07a0

Returns

ts
{
  response: Response;
  data: {
    channelToken: string;
    url: string;
    nonce: string;
  }
  isError: boolean;
  error: Error;
}
ParameterDescription
responseHTTP response from the Connect relay server.
data.channelTokenConnect relay channel token UUID.
data.urlSign in With Farcaster URL to present to the user. Links to Warpcast client in v1.
data.nonceRandom nonce included in the Sign in With Farcaster message.
isErrorTrue when an error has occurred.
errorError instance.