@farcaster/quick-auth

中文文档
0.1.0发布于 2026/11/10MITTypeScriptESM + CJS构建来源已验证近 30 天下载 52万

Client for Farcaster Quick Auth

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. Upgrading to 0.1.0

@farcaster/quick-auth

A client for interacting with a Farcaster Quick Auth server.

Installation

npm install @auth-server/client
# or
yarn add @auth-server/client
# or
pnpm add @auth-server/client

Usage

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
});

Upgrading to 0.1.0

0.1.0 depends on Zod 4 (zod@^4.6.6) instead of Zod 3. The client API and runtime behavior are unchanged.

The exported Endpoints.VerifyJwt.requestQueryParametersSchema is now a Zod 4 schema. If you compose it into your own schemas, for example z.object({ query: Endpoints.VerifyJwt.requestQueryParametersSchema }), your code must also use Zod 4. Zod 3 schemas cannot contain Zod 4 schemas, and doing so fails at type-check time and at parse time. Zod 3.25+ also ships Zod 4 as zod/v4, so you can migrate one call site at a time:

import { z } from 'zod/v4';
import { Endpoints } from '@farcaster/quick-auth';

const schema = z.object({ query: Endpoints.VerifyJwt.requestQueryParametersSchema });

If you only use createClient(), createLightClient() or decodeJwt(), no changes are needed.

版本与发布记录

@farcaster/quick-auth 共发布 9 个版本,首次发布于 2025/05/20;过去 12 个月发布了 1 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.0latest2026/11/104 天前
0.0.82025/09/141.2 年前
0.0.72025/07/051.4 年前
0.0.62025/05/211.5 年前
0.0.52025/05/211.5 年前
0.0.42025/05/201.5 年前

关于 @farcaster/quick-auth 的常见问题

@farcaster/quick-auth 是什么?

Client for Farcaster Quick Auth

如何安装 @farcaster/quick-auth?

在项目目录运行 npm install @farcaster/quick-auth,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(5.8.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@farcaster/quick-auth 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@farcaster/quick-auth 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@farcaster/quick-auth 可以商用吗?

@farcaster/quick-auth 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@farcaster/quick-auth 的下载量有多少?

根据 npm 官方下载统计,@farcaster/quick-auth 在 2026/10/15 – 2026/11/13 这 30 天内被下载 520,255 次,日均约 17,342 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@farcaster/quick-auth 还在维护吗?

最新版本 0.1.0 发布于 2026/11/10(4 天前);至今共发布 9 个版本,其中过去 12 个月发布了 1 个;首次发布于 2025/05/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。