Skip to content

Auth client

NPM Version

The @farcaster/auth-client library provides a framework agnostic client for Farcaster Auth. If you're not using React, want greater customizability, or want to interact with the Farcaster Auth relay directly, you can use the Auth client library to build your own Sign in With Farcaster flow.

Getting Started


Install the Auth client and its peer dependency viem.

npm install @farcaster/auth-client viem

Note: This is a low level client library. If you're using React, take a look at auth-kit instead.

Create a client

Set up a client with a relay server URL and Ethereum connector.

import { createAppClient, viemConnector } from '@farcaster/auth-client';

const appClient = createAppClient({
  relay: '',
  ethereum: viemConnector(),

Depending on the type of app you're building, you may use an AppClient or a WalletClient. If you're building a connected app and logging in users, use an app client. If you're building a Farcaster wallet app, use a wallet client.

Consume actions

Now that your client is set up, you can use it to interact with Farcaster Auth actions.

const { data: { channelToken } } = await appClient.createChannel({
    siweUri: "",
    domain: "";

const status = await appClient.watchStatus({