[object Object]

← back to Norma

instagram-agent: env-configurable Graph host (IG_GRAPH_HOST) — support Facebook-Login flow (page token + IG business id) alongside Instagram-Login

05b28cde1b79531c3f1785ae3c172f6aec49f0a4 · 2026-07-14 09:13:20 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files touched

Diff

commit 05b28cde1b79531c3f1785ae3c172f6aec49f0a4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jul 14 09:13:20 2026 -0700

    instagram-agent: env-configurable Graph host (IG_GRAPH_HOST) — support Facebook-Login flow (page token + IG business id) alongside Instagram-Login
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---
 agents/instagram-agent/skills/_ig-api.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/agents/instagram-agent/skills/_ig-api.js b/agents/instagram-agent/skills/_ig-api.js
index 44defbe..ead047e 100644
--- a/agents/instagram-agent/skills/_ig-api.js
+++ b/agents/instagram-agent/skills/_ig-api.js
@@ -15,8 +15,14 @@
  *   refresh      → refreshLongLived() — call before day 60, no secret needed
  */
 
-const GRAPH = 'https://graph.instagram.com';
-const VERSION = 'v23.0';
+// Host is env-configurable so the agent can run either flow:
+//   Instagram-Login (default) → graph.instagram.com + an IG-login user token
+//   Facebook-Login            → set IG_GRAPH_HOST=https://graph.facebook.com
+//                               + a page token + the IG business-account id
+// The per-post path (createContainer/publishContainer via api()) is identical
+// on both hosts; only the token flavor + user id differ.
+const GRAPH = process.env.IG_GRAPH_HOST || 'https://graph.instagram.com';
+const VERSION = process.env.IG_GRAPH_VERSION || 'v23.0';
 
 function hasCredentials() {
   return !!(process.env.IG_USER_ID && process.env.IG_ACCESS_TOKEN);

← 68552ce instagram-agent: make reel skill account-aware (close cross-  ·  back to Norma  ·  auto-save: 2026-07-23T07:19:17 (1 files) — scripts/gmail-bac e6864e6 →