Skip to content

Instagram step 1: turn on Instagram for a website's Page (ADR-0028) - #211

Merged
yatping merged 3 commits into
adr-0028-instagramfrom
instagram-step-1
Dec 3, 2026
Merged

yatping merged 3 commits into
adr-0028-instagramfrom
instagram-step-1

Conversation

@yatping

@yatping yatping commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Step 1 of ADR-0028 (#210), stacked on it.

  • Migration 0042 (expand only): instagram_account_id (unique), instagram_username, instagram_enabled on messenger_connections.
  • API minor 11: PUT …/messenger takes instagram: true|false. Turning it on asks Meta for the Page's instagram_business_account and makes one conversations?platform=instagram call, which proves instagram_manage_messages and "Allow access to messages" (and is the one call Meta asks creator accounts to make before webhooks flow). The view gains instagram: { accountId, username, enabled } | null.
  • Webhook: the same /api/v1/messenger/webhook/{id} accepts object: "instagram" for the connection's account and only logs counts by kind (instagram_webhook_message, _echo, _read, …). There are no IDs or text in the logs, and nothing is stored.
  • Dashboard: the tab is now "Messenger & Instagram", with an Instagram section and a Turn on/off button. The text is in 11 languages and machine-translated.
  • Docs: the guide's "Connecting Instagram", the data model and known issues.

pnpm verify passes locally.

Still to do before this step is done: a real-Cloudflare test with OpenChat's Page and a linked Instagram professional account, to check whether a DM from someone with no role on the app arrives without App Review.

Cloud's private org-admin.ts reuses the same contract routes and saveMessenger, so it gets Instagram from a submodule bump. Migration 0042 must be applied there first, since cloud deploy does not apply migrations.

🤖 Generated with Claude Code

yatping and others added 3 commits December 1, 2026 20:32
- Migration 0042: instagram_account_id (unique), instagram_username and
  instagram_enabled on messenger_connections, expand only.
- saveMessenger takes `instagram`: OpenChat asks Meta for the account
  linked to the Page and proves the token can read its messages with
  one Conversations API call. Errors: instagram_not_linked,
  instagram_permission_missing, instagram_account_taken,
  instagram_needs_messenger. API minor 11.
- The Messenger webhook accepts object 'instagram' for the connection's
  account and only logs counts by kind; nothing is stored yet.
- Dashboard: the tab becomes "Messenger & Instagram" with an Instagram
  section, in 11 languages (machine-translated).
- Guide, data model and known issues updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Patrick Ng <yatping0617@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Patrick Ng <yatping0617@gmail.com>
…real test)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Patrick Ng <yatping0617@gmail.com>
@yatping
yatping merged commit d0f5d81 into adr-0028-instagram Dec 3, 2026
4 checks passed
yatping added a commit that referenced this pull request Dec 3, 2026
…214)

Same content as #211, which was merged into its stacked base branch by mistake instead of main.

Signed-off-by: yatping <yatping0617@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant