Skip to main content
Request a signed JWT from a Farcaster Quick Auth Server.

Usage

import { sdk } from '@farcaster/miniapp-sdk'

const { token } = await sdk.quickAuth.getToken()
See the session token example.

Parameters

force

  • Type: boolean
Acquire a new token even if one is already in memory and not expired.

quickAuthServerOrigin (optional)

  • Type: string
Use a custom Quick Auth Server. Defaults to https://auth.farcaster.xyz.

Return Value

A JWT issued by the Quick Auth Server based on the Sign In with Farcaster credential signed by the user.
{ token: string; }
You must validate the token on your server.

JWT Payload

{
  "iat": 1747764819,
  "iss": "https://auth.farcaster.xyz",
  "exp": 1747768419,
  "sub": 6841,
  "aud": "miniapps.farcaster.xyz"
}

sub

  • Type: number
The FID of the signed in user.

iss

  • Type: string
The Quick Auth server that verified the SIWF credential and issued the JWT.

aud

  • Type: string
The domain this token was issued to.

exp

  • Type: number
The JWT expiration time.

iat

  • Type: number
The JWT issued at time.