@feedmepos/mf-connect

中文文档
0.1.130-prod发布于 2026/11/13UNLICENSEDTypeScriptES Module近 30 天下载 8111

Project Setup

原始使用文档
文档目录5 节
  1. Project Setup
  2. Compile and Hot-Reload for Development
  3. Type-Check, Compile and Minify for Production
  4. Feature Flags
  5. Formatting is with prettier, set default formatter to Prett…

FeedMe Connect

Project Setup

To get started with the project, run the following commands:

pnpm install

Compile and Hot-Reload for Development

pnpm dev

Type-Check, Compile and Minify for Production

pnpm build

Feature Flags

Connect uses @feedmepos/feature-flag directly in the frontend. WhatsApp Bot shares the business flag loading used by broadcast channels in src/feature-flag.ts and uses the connect_whatsapp_bot flag.

FeatureFlagsmith key
WhatsApp Botconnect_whatsapp_bot
Broadcast App Inboxconnect_broadcast_app_inbox_countries
Broadcast Pushconnect_broadcast_push_countries
Broadcast WhatsAppconnect_broadcast_whatsapp_countries

WhatsApp Bot and broadcast channel flags must be enabled and allow the current business country. Their values are comma-separated country codes, such as MY,SG; an empty value or * allows every country. Country codes are case-insensitive.

Connect checks country lists locally; it does not send country traits to Flagsmith. To enable WhatsApp Bot for Malaysia, enable connect_whatsapp_bot at the environment level and set its value to MY. Use MY,SG for both countries. Country segment rules are not needed for this setup.

Connect loads flags on startup and when the selected business changes. Country changes re-evaluate the country checks locally. The WhatsApp sidebar entry stays hidden and WhatsApp views stay unmounted while flags load. Direct links show a loading screen until the check finishes; disabled or failed checks redirect to analytics.

Local setup

Set the frontend Flagsmith API key in Connect's local environment, then restart the Vite dev server:

FEATURE_FLAG_API_KEY=<Development environment client key>

This is the same frontend configuration used by broadcast channel flags.

Enable selected businesses

  1. In https://flagsmith.feedme.farm, open organisation Feedme, project MAIN, and Development for local testing.
  2. Create or rename the flag to connect_whatsapp_bot, disabled by default.
  3. Open Connect with the desired business selected. The first flag evaluation registers that business ID as a Flagsmith identity.
  4. In Identities, find business-<businessId> and enable the connect_whatsapp_bot override. Identity or segment overrides can enable selected businesses. Set the effective value to the allowed countries, such as MY,SG, or * for every country; enabling an override still applies this country check.
  5. Reload Connect, then open /whatsapp. To revoke access, disable the override and reload.

Configure Production separately with its frontend API key. This flag controls page visibility; existing WhatsApp API permissions continue to apply.

Verify locally

With Connect signed in, inspect the browser's Network tab for the frontend Flagsmith request using identity business-<businessId>. Verify the WhatsApp Bot navigation entry and /whatsapp are available only when connect_whatsapp_bot is enabled and its value allows the selected country. Disabled, missing, country-excluded, or failed flag checks keep the entry hidden and redirect direct links to analytics.

Formatting is with prettier, set default formatter to Prettier

"[typescript]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

版本与发布记录

@feedmepos/mf-connect 共发布 523 个版本,首次发布于 2024/09/26;过去 12 个月发布了 255 个版本。

版本发布日期距今
0.1.130-prodlatest2026/11/131 天前
0.1.129-prod2026/11/104 天前
0.1.128-devdev2026/11/104 天前
0.1.128-prod2026/11/104 天前
0.1.127-dev2026/11/104 天前
0.1.127-prod2026/11/104 天前

关于 @feedmepos/mf-connect 的常见问题

@feedmepos/mf-connect 是什么?

Project Setup

如何安装 @feedmepos/mf-connect?

在项目目录运行 npm install @feedmepos/mf-connect,或使用 pnpm add / yarn add / bun add。

@feedmepos/mf-connect 支持 TypeScript 吗?

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

@feedmepos/mf-connect 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@feedmepos/mf-connect 可以商用吗?

@feedmepos/mf-connect 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@feedmepos/mf-connect 的下载量有多少?

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

@feedmepos/mf-connect 还在维护吗?

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