Neynar Documentation

Usage

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

const { token } = await sdk.quickAuth.getToken()

See the session token example.

Parameters

force

Acquire a new token even if one is already in memory and not expired.

quickAuthServerOrigin (optional)

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

The FID of the signed in user.

iss

The Quick Auth server that verified the SIWF credential and issued the JWT.

aud

The domain this token was issued to.

exp

The JWT expiration time.

iat

The JWT issued at time.