Unified login (new Meta apps)
Set up a Meta app created since late October 2026, which can only use Unified login (Facebook Login for Business with a configuration id).
Meta stopped offering Instagram Login to new apps in late October 2026. A new app's Use cases → Instagram API page shows only API setup with Facebook login, which Meta calls Unified login: Facebook Login for Business, driven by a configuration. The bot supports both. Setting the META_LOGIN_CONFIG_ID secret switches it to Unified login.
What changes with Unified login:
- Logging in goes through
facebook.com/dialog/oauthwith your configuration id, and Graph calls go tograph.facebook.com. - The token is a system-user access token that doesn't expire, so there's no 60-day refresh to miss.
- The connected account comes from
/me/assigned_instagram_accounts, so the configuration must include your Instagram account as an asset. - One App secret both exchanges the login code and signs webhooks.
1. Create the app
- Open developers.facebook.com/apps and click Create app.
- Pick the Instagram use case (it may read "Manage messaging & content on Instagram").
- Connect a business portfolio. Meta requires one for this use case. If you don't have one, create it from the same screen.
- Finish creating the app.
2. Create the login configuration
- Open Facebook Login for Business → Configurations and click Create configuration.
- For Login variation, choose General. For Access token, choose System-user access token, with the expiry set to Never.
- For Assets, pick Instagram accounts only. The bot doesn't need Pages or ad accounts, and skipping ad accounts keeps it away from anything that spends money.
- For Permissions, add
instagram_basic,instagram_manage_commentsandinstagram_manage_messages. - Save, and copy the configuration id: a long number.
3. Copy the values
| Secret | Where it is |
|---|---|
META_LOGIN_CONFIG_ID | The configuration id from step 2 |
META_APP_ID | The App ID at the top of the app dashboard |
META_APP_SECRET | App settings → Basic → App secret → Show |
FACEBOOK_APP_SECRET | The same App secret. npm run setup fills it in for you |
Run npm run setup, choose 1. Unified login and paste them in. Already deployed? Set them by hand:
npx wrangler secret put META_LOGIN_CONFIG_ID
npx wrangler secret put META_APP_ID
npx wrangler secret put META_APP_SECRET
npx wrangler secret put FACEBOOK_APP_SECRET4. Point Meta at your Worker
- Facebook Login for Business → Settings → Valid OAuth Redirect URIs: add
https://<your-worker>/connect/callbackand the same line with a trailing slash. - Webhook:
npm run setupsets this up for you through Meta's API. If it says it couldn't, go to Use cases → Instagram API → API setup with Facebook login → Configure webhooks, set the callback URL tohttps://<your-worker>/webhookwith your verify token, and subscribe to comments. - App settings → Basic: fill in the privacy policy, terms and data-deletion URLs that
npm run setupprinted, then Publish the app. Meta delivers real comment webhooks only once the app is Live.
5. Connect
Open your admin URL, log in and click Connect. Meta shows the configuration's consent screen. Choose your Instagram account, approve, and you're returned to the dashboard with the account connected. The Worker then subscribes the account to comment webhooks by itself.
Turn off every other comment automation on the same account first, including Meta Business Suite's own. Instagram allows one private reply per comment. Whichever tool answers first wins, and the bot then shows the comment as "Answered earlier".