Client for Farcaster Quick Auth
npm install @farcaster/quick-authA client for interacting with a Farcaster Quick Auth server.
``sh`
npm install @auth-server/clientor
yarn add @auth-server/clientor
pnpm add @auth-server/client
`typescript
import { createClient } from '@farcaster/quick-auth';
// Get a nonce
const domain = 'your-domain.com';
const client = createClient();
const nonce = await client.getNonce();
// Generate a SIWF message using nonce and domain (not shown)
// Verify a SIWF message and get a JWT token
const token = await client.verifySiwf({
message,
signature,
domain
});
// Use the return JWT as an Bearer token and validate on your server
const token = await client.verifyToken({
token,
domain
});
``