Facebook App Setup for Instagram Permissions
⚠️ Important: Instagram Permissions Require Special Setup
The error you're seeing:
Invalid Scopes: instagram_basic, instagram_content_publish
This means Instagram permissions are not available by default. They require special configuration in your Facebook App.
🎯 Two Approaches
Option 1: Development Mode (Recommended for Testing)
Use this for development and testing. No app review needed.
Option 2: Production Mode
Requires Facebook App Review. Use this when ready to launch.
📋 Option 1: Development Mode Setup (Quick Start)
Step 1: Add Instagram Test Users
- Go to Facebook Developers
- Select your app
- Go to Roles → Roles (left sidebar)
- Click Add Testers
- Add the Facebook account that owns the Instagram Business account
- The user will receive a notification to accept
Step 2: Accept Test User Invitation
- The invited user goes to Facebook Developers
- Clicks on their profile (top right)
- Goes to Invitations
- Accepts the test user invitation
Step 3: Configure App for Instagram
- In your Facebook App Dashboard
- Go to Use Cases (left sidebar)
- Click Customize next to "Authenticate and request data from users"
- Under Permissions, add:
instagram_basicinstagram_content_publishpages_show_listpages_manage_postspages_read_engagement
Step 4: Test Authentication
Now when you authenticate with the test user account, Instagram permissions will work!
Important: Only test users can use Instagram permissions in Development mode.
📋 Option 2: Production Mode Setup (For Launch)
Step 1: Add Instagram Product
- Go to your Facebook App Dashboard
- Click Add Product (left sidebar)
- Find Instagram and click Set Up
Step 2: Configure Instagram Basic Display
- Go to Instagram → Basic Display
- Click Create New App
- Fill in the required fields:
- Display Name: Your app name
- Valid OAuth Redirect URIs:
http://localhost:9000/app/settings/external-platforms/oauth-callback/facebook/callback
https://yourdomain.com/app/settings/external-platforms/oauth-callback/facebook/callback - Deauthorize Callback URL: (optional)
- Data Deletion Request URL: (optional)
Step 3: Submit for App Review
-
Go to App Review → Permissions and Features
-
Request these permissions:
instagram_basicinstagram_content_publishpages_show_listpages_manage_postspages_read_engagement
-
For each permission, provide:
- Detailed Description: Explain how you'll use it
- Screen Recording: Show the OAuth flow and feature usage
- Test User Credentials: Provide test account details
-
Submit for review (usually takes 1-3 business days)
Step 4: Switch to Live Mode
Once approved:
- Go to Settings → Basic
- Toggle App Mode from Development to Live
- Your app can now request Instagram permissions from any user!
🔧 Alternative: Use Only Facebook Permissions (Workaround)
If you want to test immediately without Instagram permissions, you can:
Update the Scope to Remove Instagram Permissions
File: src/modules/social-provider/facebook-service.ts
// Remove Instagram permissions temporarily
const defaultScope = "pages_show_list,pages_manage_posts,pages_read_engagement";
Limitation: This will only fetch Facebook Pages, not Instagram accounts.
🎯 Recommended Approach for Your Situation
Based on your error, here's what I recommend:
For Immediate Testing:
- Add yourself as a test user (Steps above in Option 1)
- Keep the Instagram permissions in the code
- Authenticate with your test user account
- Instagram permissions will work for test users!
Configuration:
Your .env file:
FACEBOOK_CLIENT_ID=YOUR_FACEBOOK_APP_ID
FACEBOOK_CLIENT_SECRET=YOUR_FACEBOOK_APP_SECRET
FACEBOOK_REDIRECT_URI=http://localhost:9000/app/settings/external-platforms/oauth-callback/facebook/callback
App Dashboard Settings:
- Go to https://developers.facebook.com/apps/YOUR_FACEBOOK_APP_ID/
- Add yourself as a Tester under Roles
- Add Instagram permissions under Use Cases
- Authenticate with your test account
📊 Permissions Breakdown
| Permission | Purpose | Requires Review? |
|---|---|---|
pages_show_list | List Facebook Pages | No (Standard) |
pages_manage_posts | Publish to Pages | No (Standard) |
pages_read_engagement | Read Page metrics | No (Standard) |
instagram_basic | Access IG account info | Yes (or Test User) |
instagram_content_publish | Publish to Instagram | Yes (or Test User) |
🐛 Troubleshooting
Error: "Invalid Scopes: instagram_basic, instagram_content_publish"
Cause: Your Facebook account is not a test user, and the app hasn't been approved.
Solutions:
- Add yourself as a test user (Option 1 above)
- OR remove Instagram permissions temporarily
- OR submit app for review (Option 2 above)
Error: "This app is in Development Mode"
Cause: App is in development mode and you're not a test user.
Solution: Add yourself as a test user in App Dashboard → Roles
Instagram Accounts Still Not Showing
After adding test user:
- Make sure Instagram account is Business type
- Make sure Instagram is linked to Facebook Page
- Re-authenticate with the test user account
- Check server logs for Instagram accounts fetched
📝 Quick Checklist
Before authenticating:
- Facebook app created
- Instagram product added (or test user added)
- Instagram permissions configured in Use Cases
- You're added as a test user (for development)
- Instagram account is Business/Creator type
- Instagram account is linked to Facebook Page
- Environment variables configured
🎉 Expected Flow After Setup
- Add yourself as test user in Facebook App Dashboard
- Accept invitation (check Facebook notifications)
- Authenticate FBINSTA platform with your account
- Grant Instagram permissions (will now appear in OAuth dialog)
- Instagram accounts fetched and stored in platform metadata
- Create posts with both Facebook and Instagram!
🔗 Helpful Links
- Facebook App Dashboard
- Instagram Basic Display API
- Instagram Content Publishing
- App Review Process
- Test Users Guide
💡 Pro Tips
- Start with test users - Fastest way to test Instagram features
- Document your use case - Makes app review easier later
- Test thoroughly - Before submitting for review
- Keep test users - Even after going live, for testing updates
- Monitor permissions - Facebook may revoke unused permissions
Summary
The Instagram permissions error is expected behavior for apps in development mode.
Quick Fix:
- Go to your Facebook App Dashboard
- Add yourself as a Test User under Roles
- Accept the invitation
- Re-authenticate FBINSTA platform
- Instagram permissions will now work! ✅
No app review needed for testing with test users!