@feedmepos/mf-connect
v0.1.117-dev
Published
## Project Setup
Keywords
Readme
FeedMe Connect
Project Setup
To get started with the project, run the following commands:
pnpm installCompile and Hot-Reload for Development
pnpm devType-Check, Compile and Minify for Production
pnpm buildFeature 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.
| Feature | Flagsmith key |
| ------------------- | --------------------------------------- |
| WhatsApp Bot | connect_whatsapp_bot |
| Broadcast App Inbox | connect_broadcast_app_inbox_countries |
| Broadcast Push | connect_broadcast_push_countries |
| Broadcast WhatsApp | connect_broadcast_whatsapp_countries |
WhatsApp Bot checks only whether connect_whatsapp_bot is enabled. Its remote
config value and the selected country do not affect access; no remote config
value is required.
Broadcast channel flags also check 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 loads flags on startup and when the selected business changes. Country changes re-evaluate broadcast channel flags. 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
- In https://flagsmith.feedme.farm, open organisation Feedme, project MAIN, and Development for local testing.
- Create or rename the flag to
connect_whatsapp_bot, disabled by default. - Open Connect with the desired business selected. The first flag evaluation registers that business ID as a Flagsmith identity.
- In Identities, find
business-<businessId>and enable theconnect_whatsapp_botoverride. Identity or segment overrides can enable selected businesses; no country-list value is required. - 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. Disabled, missing, 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"
}