convert-farcaster-miniapp-to-app

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Convert Farcaster Miniapp to Base App

将Farcaster Miniapp转换为Base应用

Convert a Farcaster miniapp into a normal app on Base. The default outcome is a regular web app that works in the Base app browser and on the open web, with Farcaster Mini App host coupling removed.
If some Farcaster functionality truly needs to survive, keep it separate from the main app surface. Prefer read-only data first. Only preserve Mini App-specific behavior when the user explicitly insists, and isolate it behind a dedicated route or page rather than carrying it through the whole app.
将Farcaster miniapp转换为Base平台上的常规应用。默认输出是可在Base应用浏览器和开放Web中运行的常规Web应用,且移除了与Farcaster Mini App宿主的耦合。
如果某些Farcaster功能确实需要保留,请将其与主应用界面分离。优先保留只读数据。仅当用户明确要求时,才保留Mini App特定行为,并将其隔离在专用路由或页面中,而非贯穿整个应用。

Core Principle

核心原则

Always separate these decisions:
  1. Remove Mini App host/runtime coupling.
  2. Decide whether any Farcaster-facing functionality should remain.
  3. If something remains, keep it isolated from the main app and avoid introducing new vendor dependencies by default.
Do not automatically turn "keep some Farcaster functionality" into "migrate to Neynar." If a project already uses Neynar and the user wants to keep an isolated Farcaster-only area, you may preserve that existing integration. Do not introduce new Neynar adoption as the default recommendation.
始终分开以下决策:
  1. 移除Mini App宿主/运行时耦合。
  2. 决定是否保留任何面向Farcaster的功能。
  3. 若需保留部分功能,将其与主应用隔离,默认避免引入新的供应商依赖。
切勿自动将“保留部分Farcaster功能”等同于“迁移至Neynar”。如果项目已使用Neynar且用户希望保留独立的Farcaster专属区域,可保留现有集成。默认不推荐引入新的Neynar依赖。

Quick Start

快速开始

Follow these five phases sequentially:
  1. Discovery — Quick scan + quiz to choose a path
  2. Analysis — Detailed read-only analysis scoped to the chosen path
  3. Conversion — Remove Mini App SDK patterns and isolate any intentionally preserved Farcaster surface
  4. Cleanup — Remove dead code, env vars, and dependencies
  5. Verification — Type check, build, and summarize
按以下五个阶段依次执行:
  1. 发现阶段 — 快速扫描+问卷选择转换路径
  2. 分析阶段 — 根据所选路径进行详细的只读分析
  3. 转换阶段 — 移除Mini App SDK模式,隔离所有有意保留的Farcaster功能模块
  4. 清理阶段 — 移除死代码、环境变量和依赖项
  5. 验证阶段 — 类型检查、构建和总结

Conversion Paths

转换路径

The quiz should route the user into one of two paths:
PathNameWho it's forWhat happens
ARegular App DefaultMost projectsStrip Farcaster Mini App coupling and become a normal Base/web app
BIsolated Farcaster SurfaceThe app still needs a small Farcaster-specific areaConvert the main app into a normal app, then keep only a separate Farcaster route/page for the remaining functionality
Path B
is still biased toward removing complexity:
  • Prefer read-only Farcaster data.
  • Avoid preserving Mini App host/runtime behavior unless the user explicitly asks for it.
  • Keep any preserved Farcaster logic out of the main app shell, shared providers, and primary auth flow.

问卷会引导用户进入以下两种路径之一:
路径名称适用对象操作内容
A默认常规应用大多数项目移除Farcaster Mini App耦合,成为常规Base/Web应用
B隔离式Farcaster功能模块仍需保留少量Farcaster特定功能的应用将主应用转换为常规应用,仅保留一个独立的Farcaster路由/页面用于剩余功能
路径B
同样倾向于降低复杂度:
  • 优先保留只读Farcaster数据。
  • 除非用户明确要求,否则避免保留Mini App宿主/运行时行为。
  • 将所有保留的Farcaster逻辑排除在主应用外壳、共享提供者和主要认证流程之外。

Phase 0: Discovery

阶段0:发现

0A. Quick Scan (automated, no user interaction)

0A. 快速扫描(自动化,无需用户交互)

Run a lightweight scan before asking questions. Produce an internal tally:
  1. Detect framework from
    package.json
    (
    next
    ,
    vite
    ,
    react-scripts
    ,
    @remix-run/*
    )
  2. Count Farcaster packages in
    dependencies
    and
    devDependencies
  3. Grep source files (
    .ts
    ,
    .tsx
    ,
    .js
    ,
    .jsx
    ) for:
    • sdk.actions.*
      calls (count total)
    • sdk.quickAuth
      usage (yes/no)
    • sdk.context
      usage (yes/no)
    • .well-known/farcaster.json
      (yes/no)
    • farcasterMiniApp
      /
      miniAppConnector
      connector (yes/no)
    • Total files with any
      @farcaster/
      import
    • @neynar/
      imports or
      api.neynar.com
      fetch calls (yes/no)
  4. Identify the blast radius:
    • Are Farcaster references spread across the main app shell?
    • Are they already mostly confined to a route like
      app/farcaster/
      ,
      pages/farcaster/
      , or a small set of components?
    • Are there obvious host-only features such as haptics, notifications,
      openMiniApp
      , or
      sdk.context.client
      ?
Use this tally to inform quiz suggestions. Do not dump raw scan output to the user before asking the quiz.
在提问前先执行轻量扫描,生成内部统计结果:
  1. package.json
    检测框架
    next
    vite
    react-scripts
    @remix-run/*
  2. 统计
    dependencies
    devDependencies
    中的Farcaster包数量
  3. 在源文件(
    .ts
    .tsx
    .js
    .jsx
    )中搜索
    • sdk.actions.*
      调用(统计总数)
    • sdk.quickAuth
      使用情况(是/否)
    • sdk.context
      使用情况(是/否)
    • .well-known/farcaster.json
      (是/否)
    • farcasterMiniApp
      /
      miniAppConnector
      连接器(是/否)
    • 包含
      @farcaster/
      导入的文件总数
    • @neynar/
      导入或
      api.neynar.com
      请求调用(是/否)
  4. 确定影响范围
    • Farcaster引用是否遍布主应用外壳?
    • 它们是否已大多局限于
      app/farcaster/
      pages/farcaster/
      等路由或少量组件中?
    • 是否存在明显的宿主专属功能,如触觉反馈、通知、
      openMiniApp
      sdk.context.client
使用这些统计结果为问卷提供建议。在提问前,不要向用户输出原始扫描结果。

0B. Interactive Quiz

0B. 交互式问卷

Ask these questions one at a time. Use the quick scan results to suggest the most likely answer.
Q1 (always ask):
Based on my scan, your project has [X] files using the Farcaster SDK with [summary of what is used].
Which outcome do you want?
  • (a) Regular app everywhere — remove Farcaster-specific behavior and just keep a normal Base/web app
  • (b) Regular app first, plus a separate Farcaster area — keep the main app clean, but preserve a small isolated route/page if really needed
Q2 (always ask):
How deeply is the Mini App SDK used today?
  • (a) Minimal — mostly
    sdk.actions.ready()
    and a few helpers
  • (b) Moderate — some
    context
    ,
    openUrl
    , profile links, or conditional
    isInMiniApp
    logic
  • (c) Heavy — auth, wallet connector, notifications, compose flows, or host-specific behavior
Q3 (ask if Q1 = b):
What is the smallest Farcaster feature set you actually need to preserve?
  • (a) Read-only only — profile or cast display, links out to Farcaster profiles, maybe a small social page
  • (b) Some Farcaster-specific interactions — there is a separate page/path that still needs more than read-only behavior
  • (c) Not sure — analyze what is isolated already and recommend the smallest keep-surface possible
Q4 (ask if Q1 = b and there is existing isolated Farcaster code or existing Neynar usage):
Does the project already have an isolated Farcaster-only route/page or integration that you want to keep as-is if possible?
  • (a) Yes — preserve only that isolated surface
  • (b) No — prefer removing it unless there is a very strong reason to keep it
Q5 (ask if quick auth or other Mini App auth is present):
After conversion, what should the main app use for authentication?
  • (a) SIWE — wallet-based auth for the regular app
  • (b) Existing non-Farcaster auth — keep whatever normal web auth already exists
  • (c) No auth — remove auth entirely
依次提出以下问题。利用快速扫描结果给出最可能的答案建议。
问题1(必问):
根据扫描结果,你的项目中有[X]个文件使用Farcaster SDK,涉及[功能摘要]。
你希望得到哪种结果?
  • (a) 全平台常规应用 — 移除Farcaster特定行为,仅保留常规Base/Web应用
  • (b) 主应用为常规应用,外加独立Farcaster区域 — 保持主应用简洁,仅在确实需要时保留一个小型隔离路由/页面
问题2(必问):
当前Mini App SDK的使用深度如何?
  • (a) 轻度 — 主要使用
    sdk.actions.ready()
    和少量辅助函数
  • (b) 中度 — 使用部分
    context
    openUrl
    、个人资料链接或条件
    isInMiniApp
    逻辑
  • (c) 重度 — 使用认证、钱包连接器、通知、发布流程或宿主特定行为
问题3(仅当问题1选b时提问):
你实际需要保留的最小Farcaster功能集是什么?
  • (a) 仅只读功能 — 个人资料或动态展示、指向Farcaster个人资料的链接,可能包含小型社交页面
  • (b) 部分Farcaster特定交互 — 存在某个单独页面/路径仍需要超出只读的功能
  • (c) 不确定 — 分析当前已隔离的功能,建议保留最小必要的功能模块
问题4(仅当问题1选b且项目已有隔离的Farcaster代码或Neynar使用时提问):
项目中是否已有一个隔离的Farcaster专属路由/页面或集成,你希望尽可能原样保留?
  • (a) 是 — 仅保留该隔离功能模块
  • (b) 否 — 优先移除,除非有非常充分的保留理由
问题5(仅当存在快速认证或其他Mini App认证时提问):
转换后,主应用应使用哪种认证方式?
  • (a) SIWE — 基于钱包的常规应用认证
  • (b) 现有非Farcaster认证 — 保留已有的常规Web认证方式
  • (c) 无认证 — 完全移除认证

0C. Path Selection

0C. 路径选择

Map answers to a path:
Desired outcomeTypical result
Q1 = regular app everywhere
Path A — Regular App Default
Q1 = regular app first, plus separate Farcaster area
Path B — Isolated Farcaster Surface
Then tighten the recommendation:
  • If the user chose
    Path B
    , prefer read-only preservation unless they explicitly require something else.
  • If the scan shows heavy host/runtime coupling but the user wants
    Path A
    , warn them that some features will be deleted rather than recreated.
  • If the project already uses Neynar, only keep it if it remains inside the isolated Farcaster surface. Do not expand it into the main app.
Announce the chosen path:
Based on your answers, I'll use Path [X]: [Name]. This will [one-sentence description]. I'll now do a detailed analysis of your project.
Record the quiz answers internally. They guide whether the agent should:
  • fully remove Farcaster features
  • preserve only a read-only isolated surface
  • quarantine any unavoidable Farcaster-specific logic to a dedicated route/page
Proceed to Phase 1.

将答案映射到对应路径:
期望结果典型输出
问题1 = 全平台常规应用
路径A — 默认常规应用
问题1 = 主应用为常规应用,外加独立Farcaster区域
路径B — 隔离式Farcaster功能模块
然后细化建议:
  • 如果用户选择
    路径B
    ,优先采用只读保留,除非用户明确要求其他方式。
  • 如果扫描显示存在重度宿主/运行时耦合,但用户选择
    路径A
    ,需警告用户部分功能将被删除而非重构。
  • 如果项目已使用Neynar,仅当它保留在隔离的Farcaster功能模块内时才保留,不要将其扩展到主应用中。
告知用户所选路径:
根据你的回答,我将使用路径[X]:[名称]。该路径会[一句话描述]。现在我将对你的项目进行详细分析。
内部记录问卷答案,指导代理是否:
  • 完全移除Farcaster功能
  • 仅保留只读的隔离功能模块
  • 将任何不可避免的Farcaster特定逻辑隔离到专用路由/页面
进入阶段1。

Phase 1: Analysis (Read-Only)

阶段1:分析(只读)

1A. Detect Framework

1A. 检测框架

Read
package.json
:
  • next
    → Next.js
  • vite
    → Vite
  • react-scripts
    → Create React App
  • @remix-run/*
    → Remix
读取
package.json
  • next
    → Next.js
  • vite
    → Vite
  • react-scripts
    → Create React App
  • @remix-run/*
    → Remix

1B. Scan for Farcaster Dependencies

1B. 扫描Farcaster依赖项

List all packages matching:
  • @farcaster/miniapp-sdk
    ,
    @farcaster/miniapp-core
    ,
    @farcaster/miniapp-wagmi-connector
  • @farcaster/frame-sdk
    ,
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    ,
    @farcaster/auth-kit
  • @neynar/*
    (compatibility only; do not assume it stays)
列出所有匹配的包:
  • @farcaster/miniapp-sdk
    @farcaster/miniapp-core
    @farcaster/miniapp-wagmi-connector
  • @farcaster/frame-sdk
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    @farcaster/auth-kit
  • @neynar/*
    (仅兼容;不默认保留)

1C. Grep for Farcaster Code

1C. 搜索Farcaster代码

Search source files (
.ts
,
.tsx
,
.js
,
.jsx
) for:
SDK imports:
@farcaster/miniapp-sdk
@farcaster/miniapp-core
@farcaster/miniapp-wagmi-connector
@farcaster/frame-sdk
@farcaster/frame-wagmi-connector
@farcaster/quick-auth
@farcaster/auth-kit
@neynar/
SDK calls:
sdk.actions.ready
sdk.actions.openUrl
sdk.actions.close
sdk.actions.composeCast
sdk.actions.addMiniApp
sdk.actions.requestWalletAddress
sdk.actions.viewProfile
sdk.actions.viewToken
sdk.actions.sendToken
sdk.actions.swapToken
sdk.actions.signIn
sdk.actions.setPrimaryButton
sdk.actions.openMiniApp
sdk.quickAuth
sdk.context
sdk.isInMiniApp
sdk.getCapabilities
sdk.haptics
sdk.back
sdk.wallet
Connectors & providers:
farcasterMiniApp()
miniAppConnector()
farcasterFrame()
MiniAppProvider
MiniAppContext
useMiniApp
useMiniAppContext
Manifest & meta:
.well-known/farcaster.json
fc:miniapp
fc:frame
Environment variables:
NEYNAR_API_KEY
NEXT_PUBLIC_NEYNAR_CLIENT_ID
FARCASTER_
FC_
在源文件(
.ts
.tsx
.js
.jsx
)中搜索:
SDK导入:
@farcaster/miniapp-sdk
@farcaster/miniapp-core
@farcaster/miniapp-wagmi-connector
@farcaster/frame-sdk
@farcaster/frame-wagmi-connector
@farcaster/quick-auth
@farcaster/auth-kit
@neynar/
SDK调用:
sdk.actions.ready
sdk.actions.openUrl
sdk.actions.close
sdk.actions.composeCast
sdk.actions.addMiniApp
sdk.actions.requestWalletAddress
sdk.actions.viewProfile
sdk.actions.viewToken
sdk.actions.sendToken
sdk.actions.swapToken
sdk.actions.signIn
sdk.actions.setPrimaryButton
sdk.actions.openMiniApp
sdk.quickAuth
sdk.context
sdk.isInMiniApp
sdk.getCapabilities
sdk.haptics
sdk.back
sdk.wallet
连接器与提供者:
farcasterMiniApp()
miniAppConnector()
farcasterFrame()
MiniAppProvider
MiniAppContext
useMiniApp
useMiniAppContext
清单与元数据:
.well-known/farcaster.json
fc:miniapp
fc:frame
环境变量:
NEYNAR_API_KEY
NEXT_PUBLIC_NEYNAR_CLIENT_ID
FARCASTER_
FC_

1D. Check Existing Web3 Setup

1D. 检查现有Web3配置

Look for:
  • coinbaseWallet
    connector in wagmi config
  • SIWE /
    siwe
    package usage
  • connectkit
    ,
    rainbowkit
    , or
    @coinbase/onchainkit
  • Existing wallet connection UI
查找:
  • wagmi配置中的
    coinbaseWallet
    连接器
  • SIWE /
    siwe
    包的使用情况
  • connectkit
    rainbowkit
    @coinbase/onchainkit
  • 现有钱包连接UI

1E. Check Separation Boundaries

1E. 检查分离边界

Map where Farcaster logic currently lives:
  • Root providers or app shell
  • Shared hooks or auth middleware
  • One-off components
  • Dedicated routes/pages like
    app/farcaster/*
  • Server routes used only by Farcaster functionality
Mark each location with one action:
  • remove
  • stub
  • move behind isolated route/page
  • keep only as read-only
映射Farcaster逻辑当前的存放位置:
  • 根提供者或应用外壳
  • 共享钩子或认证中间件
  • 独立组件
  • 专用路由/页面,如
    app/farcaster/*
  • 仅用于Farcaster功能的服务端路由
为每个位置标记操作类型:
  • 移除
  • 存根
  • 移至隔离路由/页面后
  • 仅保留只读功能

1F. Report Findings

1F. 报告分析结果

Create a path-scoped summary.
All paths include:
undefined
创建路径专属的摘要。
所有路径均包含:
undefined

Conversion Analysis — Path [X]: [Name]

转换分析 — 路径[X]:[名称]

Framework: [detected] Farcaster packages: [list] Files with Farcaster code: [count]
框架: [检测结果] Farcaster包: [列表] 包含Farcaster代码的文件数: [数量]

Wagmi Connector

Wagmi连接器

  • File: [path]
  • Current connector: [farcasterMiniApp / miniAppConnector / farcasterFrame / none]
  • Other connectors: [list]
  • Action: [replace with coinbaseWallet / leave existing wallet setup / remove only]
  • 文件:[路径]
  • 当前连接器:[farcasterMiniApp / miniAppConnector / farcasterFrame / 无]
  • 其他连接器:[列表]
  • 操作:[替换为coinbaseWallet / 保留现有钱包配置 / 仅移除]

MiniApp Provider

MiniApp提供者

  • File: [path]
  • Pattern: [simple / complex]
  • Consumers: [files importing from this]
  • Action: [stub / remove / isolate]
  • 文件:[路径]
  • 模式:[简单 / 复杂]
  • 使用者:[导入该文件的文件列表]
  • 操作:[存根 / 移除 / 隔离]

SDK Action Calls

SDK操作调用

[list each: file, what it does, action]
[列出每个调用:文件、功能、操作]

Manifest & Meta

清单与元数据

  • Manifest route: [path or N/A]
  • Meta tags: [file or N/A]

**Path A additionally includes:**
  • 清单路由:[路径或无]
  • 元标签:[文件或无]

**路径A额外包含:**

Main App Outcome

主应用输出

  • Action: remove Farcaster-specific UI and flows from the main app entirely
  • 操作:从主应用中完全移除Farcaster特定UI和流程

Authentication

认证

  • Quick Auth used: [yes/no, file]
  • Action: replace with SIWE / keep existing non-Farcaster auth / remove
  • 使用快速认证:[是/否,文件路径]
  • 操作:替换为SIWE / 保留现有非Farcaster认证 / 移除

Existing Neynar Usage

现有Neynar使用情况

  • Package or files: [list or N/A]
  • Action: remove entirely unless the user later re-scopes to Path B
  • 包或文件:[列表或无]
  • 操作:完全移除,除非用户后续重新选择路径B

Environment Variables

环境变量

[list all FC/Neynar vars that will be removed]

**Path B additionally includes:**
[列出所有将被移除的FC/Neynar变量]

**路径B额外包含:**

Main App Outcome

主应用输出

  • Action: convert the main app into a normal web app first
  • 操作:先将主应用转换为常规Web应用

Isolated Farcaster Surface

隔离式Farcaster功能模块

  • Route/page to keep: [path or proposed path]
  • Scope: [read-only / mixed / host-specific]
  • Recommended target scope: [prefer read-only / quarantine existing behavior / remove]
  • 保留的路由/页面:[路径或建议路径]
  • 范围:[只读 / 混合 / 宿主特定]
  • 建议目标范围:[优先只读 / 隔离现有行为 / 移除]

Authentication

认证

  • Quick Auth used: [yes/no, file]
  • Main app action: replace with SIWE / keep existing non-Farcaster auth / remove
  • Isolated Farcaster surface action: [remove auth coupling / preserve existing isolated flow only if explicitly requested]
  • 使用快速认证:[是/否,文件路径]
  • 主应用操作:替换为SIWE / 保留现有非Farcaster认证 / 移除
  • 隔离Farcaster功能模块操作:[移除认证耦合 / 仅在用户明确要求时保留现有隔离流程]

Existing Neynar Usage

现有Neynar使用情况

  • Package or files: [list or N/A]
  • Action: [remove / keep only inside isolated surface]
  • 包或文件:[列表或无]
  • 操作:[移除 / 仅在隔离功能模块内保留]

Environment Variables

环境变量

  • Remove from main app: [FC_, FARCASTER_, etc.]
  • Keep only if isolated surface truly still needs them: [NEYNAR_API_KEY, etc. or N/A]

**All paths end with:**
  • 从主应用中移除:[FC_, FARCASTER_, 等]
  • 仅当隔离功能模块确实仍需时保留:[NEYNAR_API_KEY, 等或无]

**所有路径均以以下内容结尾:**

Potential Issues

潜在问题

  • FID used as database primary key
  • Farcaster colors in tailwind config
  • isInMiniApp
    branches with unique else logic
  • Components only meaningful inside Farcaster
  • Farcaster code mixed into shared providers or root layout

Ask:

> Does this analysis look correct? Ready to proceed with conversion?

**STOP and wait for user confirmation before Phase 2.**

---
  • FID被用作数据库主键
  • tailwind配置中包含Farcaster品牌颜色
  • isInMiniApp
    分支包含唯一的else逻辑
  • 仅在Farcaster内有意义的组件
  • Farcaster代码混入共享提供者或根布局

询问用户:

> 该分析是否正确?是否准备开始转换?

**在进入阶段2前,停止并等待用户确认。**

---

Phase 2: Conversion

阶段2:转换

Steps are organized by feature area. Each step notes which paths it applies to and what to do differently for
Path B
.
步骤按功能区域组织。每个步骤会注明适用路径以及
路径B
的特殊处理方式。

2A. Wagmi Connector (All Paths)

2A. Wagmi连接器(所有路径)

Find the wagmi config file (
lib/wagmi.ts
,
config/wagmi.ts
,
providers/wagmi-provider.tsx
, etc.):
  1. Remove import of
    farcasterMiniApp
    or
    miniAppConnector
    from
    @farcaster/miniapp-wagmi-connector
  2. Remove the
    farcasterMiniApp()
    /
    miniAppConnector()
    call from the
    connectors
    array
  3. If no wallet connector remains, add:
    typescript
    import { coinbaseWallet } from "wagmi/connectors";
    
    coinbaseWallet({ appName: "<app name>" })
  4. If
    coinbaseWallet
    already exists, leave it as-is
  5. Clean up empty lines and stale imports
Skip this step if wagmi is not in the project.
找到wagmi配置文件(
lib/wagmi.ts
config/wagmi.ts
providers/wagmi-provider.tsx
等):
  1. 移除从
    @farcaster/miniapp-wagmi-connector
    导入的
    farcasterMiniApp
    miniAppConnector
  2. connectors
    数组中移除
    farcasterMiniApp()
    /
    miniAppConnector()
    调用
  3. 如果没有剩余钱包连接器,添加:
    typescript
    import { coinbaseWallet } from "wagmi/connectors";
    
    coinbaseWallet({ appName:"<应用名称>" })
  4. 如果
    coinbaseWallet
    已存在,保持原样
  5. 清理空行和过期导入
如果项目中没有wagmi,跳过此步骤。

2B. MiniApp Provider / Context (All Paths)

2B. MiniApp提供者 / 上下文(所有路径)

If the app has a shared Mini App provider, remove host/runtime assumptions from the main app.
Pattern A: simple provider
Replace with a safe stub:
tsx
'use client'

import React, { createContext, useContext, useMemo } from "react";

interface MiniAppContextType {
  context: undefined;
  ready: boolean;
  isInMiniApp: boolean;
}

const MiniAppContext = createContext<MiniAppContextType | undefined>(undefined);

export function useMiniAppContext() {
  const context = useContext(MiniAppContext);
  if (context === undefined) {
    throw new Error("useMiniAppContext must be used within a MiniAppProvider");
  }
  return context;
}

export default function MiniAppProvider({ children }: { children: React.ReactNode }) {
  const value = useMemo(
    () => ({
      context: undefined,
      ready: true,
      isInMiniApp: false,
    }),
    []
  );

  return <MiniAppContext.Provider value={value}>{children}</MiniAppContext.Provider>;
}
Preserve export style and hook names so consumers do not break.
Pattern B: complex provider
  • If many consumers depend on it, stub it first.
  • If only a few files use it, remove it and update those imports directly.
  • In
    Path B
    , do not let the isolated Farcaster surface keep this provider wired through the root app shell. If needed, make it local to the isolated route only.
如果应用有共享Mini App提供者,从主应用中移除宿主/运行时假设。
模式A:简单提供者
替换为安全的存根:
tsx
'use client'

import React, { createContext, useContext, useMemo } from "react";

interface MiniAppContextType {
  context: undefined;
  ready: boolean;
  isInMiniApp: boolean;
}

const MiniAppContext = createContext<MiniAppContextType | undefined>(undefined);

export function useMiniAppContext() {
  const context = useContext(MiniAppContext);
  if (context === undefined) {
    throw new Error("useMiniAppContext必须在MiniAppProvider内使用");
  }
  return context;
}

export default function MiniAppProvider({ children }: { children: React.ReactNode }) {
  const value = useMemo(
    () => ({
      context: undefined,
      ready: true,
      isInMiniApp: false,
    }),
    []
  );

  return <MiniAppContext.Provider value={value}>{children}</MiniAppContext.Provider>;
}
保留导出样式和钩子名称,避免使用者代码报错。
模式B:复杂提供者
  • 如果有大量使用者依赖,先创建存根。
  • 如果只有少量文件使用,直接移除并更新这些文件的导入。
  • 路径B
    中,不要让隔离的Farcaster功能模块通过根应用外壳保留该提供者。如果需要,仅在隔离路由内本地化使用。

2C. Authentication

2C. 认证

The main app should use normal web auth, not Mini App auth.
Default rule for both paths:
  • If
    sdk.quickAuth.getToken()
    is used, replace it with SIWE or remove it.
  • If a normal non-Farcaster auth system already exists, prefer that over adding new auth.
  • Do not introduce new Farcaster or Neynar auth as the default conversion target.
主应用应使用常规Web认证,而非Mini App认证。
适用于所有路径的默认规则:
  • 如果使用
    sdk.quickAuth.getToken()
    ,替换为SIWE或移除。
  • 如果已有常规非Farcaster认证系统,优先使用现有系统而非添加新认证。
  • 默认转换目标不引入新的Farcaster或Neynar认证。

SIWE Replacement Pattern

SIWE替换模式

Client-side (e.g.
useSignIn.ts
):
  • Remove
    import sdk from "@farcaster/miniapp-sdk"
  • Remove
    sdk.quickAuth.getToken()
  • Replace with:
    1. Get wallet address from
      useAccount()
      (wagmi)
    2. Create a SIWE message with
      siwe
    3. Sign with
      useSignMessage()
      (wagmi)
    4. Send signature + message to the backend for verification
Server-side (e.g.
app/api/auth/sign-in/route.ts
):
  • Remove
    @farcaster/quick-auth
    verification
  • Replace with SIWE verification:
    1. Parse the SIWE message
    2. Verify the signature with
      siwe
      or
      viem
    3. Use recovered wallet address as the normal app identity
If FID is used as a database primary key:
  • Do not auto-change schema
  • Add a TODO comment for later migration
  • Warn in Phase 4 summary
Path B note:
  • If the isolated Farcaster surface already has its own auth or integration flow and the user explicitly wants to keep it, quarantine it there only.
  • Do not let that flow remain the default app-wide auth system.
客户端(例如
useSignIn.ts
):
  • 移除
    import sdk from "@farcaster/miniapp-sdk"
  • 移除
    sdk.quickAuth.getToken()
  • 替换为:
    1. useAccount()
      (wagmi)获取钱包地址
    2. 使用
      siwe
      创建SIWE消息
    3. 使用
      useSignMessage()
      (wagmi)签名
    4. 将签名+消息发送到后端进行验证
服务端(例如
app/api/auth/sign-in/route.ts
):
  • 移除
    @farcaster/quick-auth
    验证
  • 替换为SIWE验证:
    1. 解析SIWE消息
    2. 使用
      siwe
      viem
      验证签名
    3. 使用恢复的钱包地址作为常规应用身份
如果FID被用作数据库主键:
  • 不要自动更改数据库 schema
  • 添加TODO注释以便后续迁移
  • 在阶段4的总结中发出警告
路径B注意事项:
  • 如果隔离的Farcaster功能模块已有自己的认证或集成流程,且用户明确要求保留,仅在该模块内隔离保留。
  • 不要让该流程成为应用级的默认认证系统。

2D. SDK Action Calls

2D. SDK操作调用

2D-1. Main replacements for both paths

2D-1. 适用于所有路径的主要替换规则

OriginalReplacement
sdk.actions.ready()
Remove entirely
sdk.actions.openUrl(url)
window.open(url, "_blank")
sdk.actions.close()
window.close()
or remove
sdk.actions.composeCast(...)
Remove from the main app
sdk.actions.addMiniApp()
Remove call and UI
sdk.actions.requestWalletAddress()
Remove; wagmi handles wallet access
sdk.actions.viewProfile(fid)
window.open(\
https://warpcast.com/~/profiles/${fid}\`, "_blank")`
sdk.actions.viewToken(opts)
window.open(\
https://basescan.org/token/${opts.token}\`, "_blank")`
sdk.actions.sendToken(opts)
Replace with wagmi flow if the feature matters, otherwise remove
sdk.actions.swapToken(opts)
Remove call and UI unless there is a real app-specific swap feature outside Farcaster
sdk.actions.signIn(...)
Remove; auth handled by normal web auth
sdk.actions.setPrimaryButton(...)
Remove entirely
sdk.actions.openMiniApp(...)
Remove from the main app
sdk.isInMiniApp()
Remove conditional and keep the non-Farcaster branch
sdk.context
Remove from the main app
sdk.getCapabilities()
Remove or replace with
async () => []
sdk.haptics.*
Remove entirely
sdk.back.*
Remove entirely
sdk.wallet.*
Remove; wagmi handles wallet access
For conditional
isInMiniApp
branches:
tsx
// BEFORE
if (isInMiniApp) {
  sdk.actions.openUrl(url);
} else {
  window.open(url, "_blank");
}

// AFTER
window.open(url, "_blank");
Always keep the normal web branch.
原调用替换内容
sdk.actions.ready()
完全移除
sdk.actions.openUrl(url)
window.open(url, "_blank")
sdk.actions.close()
window.close()
或移除
sdk.actions.composeCast(...)
从主应用中移除
sdk.actions.addMiniApp()
移除调用和UI
sdk.actions.requestWalletAddress()
移除;wagmi处理钱包访问
sdk.actions.viewProfile(fid)
window.open(\
https://warpcast.com/~/profiles/${fid}\`, "_blank")`
sdk.actions.viewToken(opts)
window.open(\
https://basescan.org/token/${opts.token}\`, "_blank")`
sdk.actions.sendToken(opts)
如果该功能重要,替换为wagmi流程;否则移除
sdk.actions.swapToken(opts)
移除调用和UI,除非Farcaster之外有真正的应用专属兑换功能
sdk.actions.signIn(...)
移除;由常规Web认证处理
sdk.actions.setPrimaryButton(...)
完全移除
sdk.actions.openMiniApp(...)
从主应用中移除
sdk.isInMiniApp()
移除条件判断,保留常规Web分支
sdk.context
从主应用中移除
sdk.getCapabilities()
移除或替换为
async () => []
sdk.haptics.*
完全移除
sdk.back.*
完全移除
sdk.wallet.*
移除;wagmi处理钱包访问
对于条件
isInMiniApp
分支:
tsx
// 转换前
if (isInMiniApp) {
  sdk.actions.openUrl(url);
} else {
  window.open(url, "_blank");
}

// 转换后
window.open(url, "_blank");
始终保留常规Web分支。

2D-2. Path B overrides

2D-2. 路径B的特殊处理

Path B
does not mean "recreate everything." It means "keep the main app clean and preserve the smallest separate Farcaster surface possible."
  • sdk.context
    • Remove from the main app
    • For the isolated surface, prefer replacing it with read-only fetched data or explicit route params
    • Remove
      context.location
      ,
      context.client
      , safe area, and other host-derived assumptions unless the user explicitly insists on preserving a host-specific page
  • sdk.actions.composeCast(...)
    • Remove from the main app
    • If the user only needs read-only, delete it entirely
    • If they insist on preserving it, keep it isolated behind a dedicated page/path and flag it as a manual follow-up rather than rebuilding it by default
  • sdk.actions.openMiniApp(...)
    • Remove from the main app
    • Only keep it in an isolated route if the user explicitly wants a Farcaster-only surface
  • notifications / haptics / host buttons
    • Remove from the main app
    • Preserve only if the isolated route truly depends on them and the user has explicitly opted into that complexity
路径B
并不意味着“重建所有功能”,而是“保持主应用简洁,保留最小的独立Farcaster功能模块”。
  • sdk.context
    • 从主应用中移除
    • 对于隔离功能模块,优先替换为只读获取的数据或显式路由参数
    • 移除
      context.location
      context.client
      、安全区域和其他宿主派生的假设,除非用户明确要求保留宿主特定页面
  • sdk.actions.composeCast(...)
    • 从主应用中移除
    • 如果用户仅需要只读功能,完全删除
    • 如果用户坚持保留,将其隔离在专用页面/路径后,并标记为手动后续任务,而非默认重建
  • sdk.actions.openMiniApp(...)
    • 从主应用中移除
    • 仅当用户明确需要Farcaster专属功能模块时,才在隔离路由中保留
  • 通知 / 触觉反馈 / 宿主按钮
    • 从主应用中移除
    • 仅当隔离路由确实依赖且用户明确选择该复杂度时才保留

2E. Optional Read-Only Farcaster Data (Path B only)

2E. 可选只读Farcaster数据(仅路径B)

If the user wants an isolated Farcaster surface, prefer read-only data first.
Create
lib/farcaster-readonly.ts
(or equivalent) only if the app needs it:
typescript
const HUB_URL = "https://hub.farcaster.xyz";

export async function getUserData(fid: number) {
  const res = await fetch(`${HUB_URL}/v1/userDataByFid?fid=${fid}`);
  if (!res.ok) throw new Error(`Hub user data fetch failed: ${res.status}`);
  return res.json();
}

export async function getCastsByFid(fid: number, pageSize = 25) {
  const res = await fetch(`${HUB_URL}/v1/castsByFid?fid=${fid}&pageSize=${pageSize}`);
  if (!res.ok) throw new Error(`Hub casts fetch failed: ${res.status}`);
  return res.json();
}
Then:
  • Keep these calls inside the isolated route/page only
  • Do not thread Farcaster data requirements through the main app shell
  • If the project already has a small isolated Neynar-based read-only integration, you may keep it only if removing it would create more churn than it saves
  • Do not add new Neynar packages for this by default
如果用户需要隔离的Farcaster功能模块,优先保留只读数据。
仅当应用需要时,创建
lib/farcaster-readonly.ts
(或等效文件):
typescript
const HUB_URL = "https://hub.farcaster.xyz";

export async function getUserData(fid: number) {
  const res = await fetch(`${HUB_URL}/v1/userDataByFid?fid=${fid}`);
  if (!res.ok) throw new Error(`Hub用户数据获取失败: ${res.status}`);
  return res.json();
}

export async function getCastsByFid(fid: number, pageSize = 25) {
  const res = await fetch(`${HUB_URL}/v1/castsByFid?fid=${fid}&pageSize=${pageSize}`);
  if (!res.ok) throw new Error(`Hub动态获取失败: ${res.status}`);
  return res.json();
}
然后:
  • 仅在隔离路由/页面内保留这些调用
  • 不要让Farcaster数据需求贯穿主应用外壳
  • 如果项目已有小型隔离的基于Neynar的只读集成,若移除会导致更多混乱,可保留
  • 默认不添加新的Neynar包

2F. Manifest Route (All Paths)

2F. 清单路由(所有路径)

Delete
.well-known/farcaster.json
route:
  • app/.well-known/farcaster.json/route.ts
  • public/.well-known/farcaster.json
  • api/farcaster-manifest.ts
    or similar helpers
If the
.well-known
directory becomes empty, delete it.
删除
.well-known/farcaster.json
路由:
  • app/.well-known/farcaster.json/route.ts
  • public/.well-known/farcaster.json
  • api/farcaster-manifest.ts
    或类似辅助文件
如果
.well-known
目录变空,删除该目录。

2G. Meta Tags (All Paths)

2G. 元标签(所有路径)

In root layout or metadata files, remove:
  • <meta>
    tags with
    property="fc:miniapp*"
    or
    property="fc:frame*"
  • Metadata.other
    entries that only exist for Farcaster tags
  • generateMetadata
    logic that only produces Mini App metadata
在根布局或元数据文件中移除:
  • 属性为
    property="fc:miniapp*"
    property="fc:frame*"
    <meta>
    标签
  • 仅为Farcaster标签存在的
    Metadata.other
    条目
  • 仅生成Mini App元数据的
    generateMetadata
    逻辑

2H. Dependencies

2H. 依赖项

All paths — remove:
  • @farcaster/miniapp-sdk
    ,
    @farcaster/miniapp-wagmi-connector
    ,
    @farcaster/miniapp-core
  • @farcaster/frame-sdk
    ,
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    ,
    @farcaster/auth-kit
Path A — also remove:
  • @neynar/nodejs-sdk
    ,
    @neynar/react
  • any other Neynar packages or helpers
Path B — remove by default:
  • @neynar/nodejs-sdk
    ,
    @neynar/react
    , and Neynar helpers unless they remain inside the intentionally isolated Farcaster surface
All paths — add only if truly needed:
  • siwe
    if SIWE auth is introduced and not already present
Do not add new Neynar packages as part of the default conversion.
所有路径 — 移除:
  • @farcaster/miniapp-sdk
    @farcaster/miniapp-wagmi-connector
    @farcaster/miniapp-core
  • @farcaster/frame-sdk
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    @farcaster/auth-kit
路径A — 额外移除:
  • @neynar/nodejs-sdk
    @neynar/react
  • 任何其他Neynar包或辅助工具
路径B — 默认移除:
  • @neynar/nodejs-sdk
    @neynar/react
    和Neynar辅助工具,除非它们仍在有意隔离的Farcaster功能模块内
所有路径 — 仅在确实需要时添加:
  • 若引入SIWE认证,添加
    siwe
默认不添加新的Neynar包作为转换的一部分。

2I. Farcaster-Specific Routes & Components

2I. Farcaster特定路由与组件

Path A:
  • Delete
    app/farcaster/
    ,
    pages/farcaster/
    , and Farcaster-only components entirely
  • Delete Farcaster-only API routes such as
    /api/farcaster/*
    and
    /api/neynar/*
  • Remove any navigation links that point to deleted routes
Path B:
  • Keep the main app route tree clean
  • Move preserved Farcaster UI behind one dedicated route/page if it is not already isolated
  • Prefer names like
    app/farcaster/
    or
    app/social/
    over spreading Farcaster logic throughout generic shared pages
  • Remove any component that has no purpose outside that isolated surface
  • Keep any remaining Neynar usage, if any, confined to that isolated route/page and its server helpers only

路径A:
  • 完全删除
    app/farcaster/
    pages/farcaster/
    和Farcaster专属组件
  • 删除Farcaster专属API路由,如
    /api/farcaster/*
    /api/neynar/*
  • 移除指向已删除路由的所有导航链接
路径B:
  • 保持主应用路由树整洁
  • 若未隔离,将保留的Farcaster UI移至一个专用路由/页面后
  • 优先使用
    app/farcaster/
    app/social/
    等名称,避免将Farcaster逻辑分散到通用共享页面
  • 移除所有在隔离功能模块外无意义的组件
  • 若保留Neynar使用,仅将其限制在该隔离路由/页面及其服务端辅助工具内

Phase 3: Cleanup

阶段3:清理

3A. Update
package.json

3A. 更新
package.json

All paths — remove Mini App packages:
  • @farcaster/miniapp-sdk
    ,
    @farcaster/miniapp-wagmi-connector
    ,
    @farcaster/miniapp-core
  • @farcaster/frame-sdk
    ,
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    ,
    @farcaster/auth-kit
Path A — also remove:
  • all
    @neynar/*
    packages
Path B — remove unless still isolated and intentionally preserved:
  • @neynar/*
All paths — add if introduced:
  • siwe
所有路径 — 移除Mini App包:
  • @farcaster/miniapp-sdk
    @farcaster/miniapp-wagmi-connector
    @farcaster/miniapp-core
  • @farcaster/frame-sdk
    @farcaster/frame-wagmi-connector
  • @farcaster/quick-auth
    @farcaster/auth-kit
路径A — 额外移除:
  • 所有
    @neynar/*
路径B — 移除,除非仍在隔离且有意保留:
  • @neynar/*
所有路径 — 若引入则添加:
  • siwe

3B. Environment Variables

3B. 环境变量

Path A — remove from all
.env*
files:
  • NEYNAR_API_KEY
  • NEXT_PUBLIC_NEYNAR_CLIENT_ID
  • FARCASTER_*
  • FC_*
  • NEXT_PUBLIC_FC_*
  • NEXT_PUBLIC_FARCASTER_*
Path B — remove from the main app by default:
  • FARCASTER_*
  • FC_*
  • NEXT_PUBLIC_FC_*
  • NEXT_PUBLIC_FARCASTER_*
Only keep
NEYNAR_*
vars if the isolated surface explicitly still depends on existing Neynar integration.
Also update env validation schemas (
env.ts
,
env.mjs
, zod schemas, etc.).
路径A — 从所有
.env*
文件中移除:
  • NEYNAR_API_KEY
  • NEXT_PUBLIC_NEYNAR_CLIENT_ID
  • FARCASTER_*
  • FC_*
  • NEXT_PUBLIC_FC_*
  • NEXT_PUBLIC_FARCASTER_*
路径B — 默认从主应用中移除:
  • FARCASTER_*
  • FC_*
  • NEXT_PUBLIC_FC_*
  • NEXT_PUBLIC_FARCASTER_*
仅当隔离功能模块明确仍依赖现有Neynar集成时,才保留
NEYNAR_*
变量。
同时更新环境变量验证 schema(
env.ts
env.mjs
、zod schema等)。

3C. Dead Code Cleanup

3C. 死代码清理

  • Remove unused imports from modified files
  • Remove unused Farcaster types and helper functions
  • Remove empty import statements
  • Remove dead hooks or API wrappers that only existed for the Mini App SDK
  • 从修改的文件中移除未使用的导入
  • 移除未使用的Farcaster类型和辅助函数
  • 移除空导入语句
  • 移除仅为Mini App SDK存在的死钩子或API包装器

3D. Tailwind Colors

3D. Tailwind颜色

If
tailwind.config.ts
or
tailwind.config.js
includes Farcaster brand colors such as
farcaster: "#8B5CF6"
, remove them unless that branding is intentionally kept inside an isolated Farcaster-only surface.
如果
tailwind.config.ts
tailwind.config.js
包含Farcaster品牌颜色,如
farcaster: "#8B5CF6"
,除非该品牌颜色有意保留在隔离的Farcaster专属功能模块内,否则将其移除。

3E. Install Dependencies

3E. 安装依赖项

Tell the user:
bash
npm install

告知用户执行:
bash
npm install

Phase 4: Verification

阶段4:验证

4A. Search for Remaining References

4A. 搜索剩余引用

All paths — search for:
@farcaster
farcasterMiniApp
miniAppConnector
sdk.actions
sdk.quickAuth
sdk.context
fc:miniapp
fc:frame
Path A — also search for:
@neynar
NEYNAR_API_KEY
NEXT_PUBLIC_NEYNAR_CLIENT_ID
api.neynar.com
Path B — if Neynar was intentionally preserved:
  • verify that remaining
    @neynar
    imports and env vars exist only inside the isolated Farcaster surface and its server helpers
Report any source matches, ignoring
node_modules
, lock files, and git history.
所有路径 — 搜索:
@farcaster
farcasterMiniApp
miniAppConnector
sdk.actions
sdk.quickAuth
sdk.context
fc:miniapp
fc:frame
路径A — 额外搜索:
@neynar
NEYNAR_API_KEY
NEXT_PUBLIC_NEYNAR_CLIENT_ID
api.neynar.com
路径B — 若有意保留Neynar:
  • 验证剩余的
    @neynar
    导入和环境变量仅存在于隔离的Farcaster功能模块及其服务端辅助工具内
报告所有源文件匹配项,忽略
node_modules
、锁文件和git历史。

4B. Type Check

4B. 类型检查

bash
npx tsc --noEmit
Report and fix type errors.
bash
npx tsc --noEmit
报告并修复类型错误。

4C. Build Check

4C. 构建检查

bash
npm run build
Report and fix build errors.
bash
npm run build
报告并修复构建错误。

4D. Conversion Summary

4D. 转换总结

undefined
undefined

Conversion Complete — Path [X]: [Name]

转换完成 — 路径[X]:[名称]

Files modified: [count] Files deleted: [count] Files created: [count, if any] Packages removed: [list] Packages added: [list, if any]
修改的文件数: [数量] 删除的文件数: [数量] 创建的文件数: [数量(如有)] 移除的包: [列表] 添加的包: [列表(如有)]

What was done

已完成操作

  • Removed Farcaster Mini App wagmi connector
  • Stubbed or removed Mini App provider/context
  • Replaced Mini App auth with normal web auth or removed it
  • Removed or replaced SDK action calls
  • Deleted manifest route
  • Removed Farcaster meta tags
  • Cleaned up dependencies and env vars

**Path B summary additionally includes:**
  • Kept the main app as a normal web app
  • Confined remaining Farcaster functionality to a dedicated route/page
  • Preferred read-only Farcaster data where possible
  • Removed Farcaster host/runtime coupling from shared app infrastructure

**All paths end with:**
  • 移除Farcaster Mini App wagmi连接器
  • 存根或移除Mini App提供者/上下文
  • 将Mini App认证替换为常规Web认证或移除
  • 移除或替换SDK操作调用
  • 删除清单路由
  • 移除Farcaster元标签
  • 清理依赖项和环境变量

**路径B总结额外包含:**
  • 将主应用保留为常规Web应用
  • 将剩余Farcaster功能限制在专用路由/页面内
  • 尽可能优先使用只读Farcaster数据
  • 从共享应用基础设施中移除Farcaster宿主/运行时耦合

**所有路径均以以下内容结尾:**

Manual steps

手动步骤

  • Run
    npm install
  • Test wallet connection flow
  • If FID migration is needed, migrate from FID-based identity to wallet address
  • If Path B preserves a Farcaster-only area, verify it stays isolated from the main app shell
  • 运行
    npm install
  • 测试钱包连接流程
  • 若需迁移FID,从基于FID的身份迁移至钱包地址
  • 若路径B保留了Farcaster专属区域,验证其与主应用外壳保持隔离

Verification

验证结果

  • TypeScript: [pass/fail]
  • Build: [pass/fail]
  • Remaining Farcaster references: [none / list]

---
  • TypeScript:[通过/失败]
  • 构建:[通过/失败]
  • 剩余Farcaster引用:[无 / 列表]

---

Edge Cases

边缘情况

No wagmi

无wagmi

Skip Phase 2A. Do not introduce wagmi unless the app actually needs wallet connectivity.
跳过阶段2A。除非应用确实需要钱包连接,否则不要引入wagmi。

No auth system

无认证系统

Skip Phase 2C. Do not add SIWE unnecessarily.
跳过阶段2C。不要不必要地添加SIWE。

@farcaster/frame-sdk
(older)

@farcaster/frame-sdk
(旧版)

Treat identically to
@farcaster/miniapp-sdk
.
@farcaster/miniapp-sdk
处理方式相同。

Monorepo

单体仓库

Ask which workspace(s) to convert. Only modify those.
询问要转换哪个工作区。仅修改指定工作区。

FID as database primary key

FID作为数据库主键

Do not change schema automatically. Flag it and warn in Phase 4.
不要自动更改schema。在阶段4中标记并警告。

Conditional
isInMiniApp
branches

条件
isInMiniApp
分支

Always keep the normal web branch and remove the Mini App branch.
始终保留常规Web分支,移除Mini App分支。

Components with no non-Farcaster purpose

仅在Farcaster内有意义的组件

Delete them entirely in
Path A
. In
Path B
, keep them only if they live inside the isolated Farcaster route/page.
路径A
中完全删除。在
路径B
中,仅当它们位于隔离的Farcaster路由/页面内时才保留。

Existing Neynar usage

现有Neynar使用

If the project already uses Neynar:
  • remove it in
    Path A
  • keep it only if it remains inside the isolated
    Path B
    surface
  • do not add more Neynar usage than already exists unless the user explicitly requests it
如果项目已使用Neynar:
  • 路径A
    中移除
  • 路径B
    中,仅当它保留在隔离功能模块内时才保留
  • 除非用户明确要求,否则不要添加更多Neynar使用

Read-only is usually enough

只读通常已足够

If the user says they want to "keep Farcaster stuff," bias toward:
  • profile links
  • read-only profile or cast display
  • a dedicated social page
Do not assume they want write access, notifications, or host/runtime behavior.
如果用户表示想“保留Farcaster相关功能”,优先偏向:
  • 个人资料链接
  • 只读个人资料或动态展示
  • 专用社交页面
不要假设用户需要写入权限、通知或宿主/运行时行为。

Quiz ambiguity

问卷歧义

If the scan and quiz conflict, point it out and ask the user to confirm the smaller keep-surface first.

如果扫描结果与问卷答案冲突,指出该问题并先请用户确认最小保留功能模块。

Security

安全

  • Validate wallet setup — ensure
    coinbaseWallet
    or the chosen wallet connector is configured correctly
  • FID-based identity — requires manual database migration if used as a primary key
  • SIWE verification — verify signatures server-side before trusting them
  • Preserved isolated surface — do not let a Farcaster-only route/page leak host/runtime assumptions into the main app shell
  • Existing Neynar usage — keep API keys server-side only, and only if that isolated surface still depends on them
  • 验证钱包配置 — 确保
    coinbaseWallet
    或所选钱包连接器配置正确
  • 基于FID的身份 — 若用作主键,需要手动数据库迁移
  • SIWE验证 — 在信任签名前,在服务端验证签名
  • 保留的隔离功能模块 — 不要让Farcaster专属路由/页面将宿主/运行时假设泄露到主应用外壳
  • 现有Neynar使用 — 仅在服务端保留API密钥,且仅当隔离功能模块仍依赖时才保留