Skip to content

feat: Settings Integrations tab with Google Search Console connection via Composio - #643

Merged
gkhngyk merged 1 commit into
mainfrom
feature/integrations-gsc
Aug 4, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/integrations-gsc

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the Settings → Integrations surface and the Google Search Console connection via Composio managed auth (#577, phase 1 — the connection only; property mapping and data pull follow in #642+).

Server

  • lib/composio.js — Composio helper gated by isComposioConfigured(); self-host installs without the env vars keep working (the card renders "Not configured" instead of erroring).
  • routes/integrations.js under /api/integrations:
    • POST /google-search-console/connect — admin/manager only; validates callbackUrl by origin against PUBLIC_APP_URL; returns the Composio-hosted consent redirectUrl.
    • GET /google-search-console/status — resolves live state against Composio connectedAccounts.list (not just our row) and syncs the row, so revocation on the Google side is reflected.
    • DELETE /google-search-console — deletes the Composio connected account and clears the row.
  • Entity id org_<organizationId> — one connection per organization, visible to teammates.
  • New dependency @composio/[email protected]; env: COMPOSIO_API_KEY, COMPOSIO_GSC_AUTH_CONFIG_ID (documented in .env.example). OAuth tokens live in Composio only — never in our DB.

Web

  • components/settings/integrations-section.tsx — card states: Not configured → Connect → Connecting (OAuth popup + 3s status polling with a generation counter, 2-min deadline, popup-blocked same-tab fallback) → Connected (badge + confirm-dialog Disconnect).
  • Settings page: Integrations nav entry + ?tab=integrations deep link (OAuth return lands there).
  • Server actions in lib/actions/integrations.ts following the existing bearer-token pattern.

DB

  • Migration 00045_integration_connections.sql (applied to hosted): integration_connections with UNIQUE (organization_id, provider), RLS member select + admin/manager write; types/supabase.ts synced.

Related issue

Closes #577

Type of change

  • feat — New feature

How to test

  1. Without Composio env vars: Settings → Integrations shows the card with a "Not configured" badge (no errors).
  2. With COMPOSIO_API_KEY (needs connected_accounts write) and COMPOSIO_GSC_AUTH_CONFIG_ID set: Connect opens the Google consent popup; after granting, the card flips to Connected without a reload.
  3. Reload — still Connected (state verified live against Composio).
  4. Disconnect — confirm dialog, card resets, connected account removed on Composio.
  5. As a non-admin/manager member, Connect returns a 403 message.

Manually tested end-to-end (connect → connected → reload → disconnect) against a real Composio project.

Checklist

  • Branch follows the naming convention (feature/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk
gkhngyk merged commit f04b5c5 into main Aug 4, 2026
5 checks passed
@gkhngyk
gkhngyk deleted the feature/integrations-gsc branch August 4, 2026 11:49
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.

Settings: Integrations tab + Google Search Console connection via Composio

1 participant