Skip to content

feat: add Apollo.io OAuth integration#142

Merged
Rishavraaj merged 1 commit into
mainfrom
apollo-io-auth-integration
May 28, 2026
Merged

feat: add Apollo.io OAuth integration#142
Rishavraaj merged 1 commit into
mainfrom
apollo-io-auth-integration

Conversation

@anujeet98
Copy link
Copy Markdown
Contributor

@anujeet98 anujeet98 commented May 26, 2026

Implements org-level Apollo.io connection via OAuth 2.0 with PKCE so users
can connect their Apollo account from Settings → Connections and use it to
power the upcoming ICP Manager feature.

Backend:

  • New ApolloIntegrationModule with controller, service, and repository
  • OAuth 2.0 + PKCE: authorization URL generation, code/token exchange,
    token refresh on expiry, revocation on disconnect
  • Tokens stored plaintext (consistent with existing better-auth accounts
    and Gather integrations)
  • Endpoints: GET /status, GET /authorize, POST /exchange (called by
    Next.js callback route), DELETE /disconnect
  • New env vars: APOLLO_CLIENT_ID, APOLLO_CLIENT_SECRET, APOLLO_REDIRECT_URI

Frontend:

  • Next.js API route at /api/integrations/apollo/callback handles the OAuth
    redirect, calls backend /exchange, and sets a short-lived _apollo_flash cookie
  • Settings page reads the flash cookie on mount, shows success/error toast,
    and clears it — URL stays clean after OAuth redirect
  • Apollo.io row in Settings → Connections with connect/reconnect/disconnect
    actions; Connected By shows the email of the connecting user
  • Apollo.io SVG icon added to public/icons

Database:

  • New connection table (@@Map("connection")) — one record per org per
    provider — with access_token, refresh_token, token_expires_at,
    connected_by_id, connected_at
  • Migration: 20260526085548_add_organization_integration

Tests & CI:

  • E2E spec covering unauthenticated redirect, connections tab, OAuth screen
    redirect, and flash cookie success/error toasts
  • APOLLO_CLIENT_ID, APOLLO_CLIENT_SECRET, APOLLO_REDIRECT_URI added to CI

@anujeet98 anujeet98 force-pushed the apollo-io-auth-integration branch 8 times, most recently from b8a1ad8 to 7bbc6a2 Compare May 28, 2026 07:23
Comment thread apps/backend/src/app/integrations/apollo/apollo-integration.controller.ts Outdated
Comment thread apps/backend/.env.example Outdated
@anujeet98 anujeet98 force-pushed the apollo-io-auth-integration branch 2 times, most recently from 78c43bb to b7eab0b Compare May 28, 2026 09:40
Implements org-level Apollo.io connection via OAuth 2.0 with PKCE so users
can connect their Apollo account from Settings → Connections and use it to
power the upcoming ICP Manager feature.

Backend:
- New ApolloIntegrationModule with controller, service, and repository
- OAuth 2.0 + PKCE: authorization URL generation, code/token exchange,
  token refresh on expiry, revocation on disconnect
- Tokens stored plaintext (consistent with existing better-auth accounts
  and Gather integrations)
- Endpoints: GET /status, GET /authorize, POST /exchange (called by
  Next.js callback route), DELETE /disconnect
- New env vars: APOLLO_CLIENT_ID, APOLLO_CLIENT_SECRET, APOLLO_REDIRECT_URI

Frontend:
- Next.js API route at /api/integrations/apollo/callback handles the OAuth
  redirect, calls backend /exchange, and sets a short-lived _apollo_flash cookie
- Settings page reads the flash cookie on mount, shows success/error toast,
  and clears it — URL stays clean after OAuth redirect
- Apollo.io row in Settings → Connections with connect/reconnect/disconnect
  actions; Connected By shows the email of the connecting user
- Apollo.io SVG icon added to public/icons

Database:
- New connection table (@@Map("connection")) — one record per org per
  provider — with access_token, refresh_token, token_expires_at,
  connected_by_id, connected_at
- Migration: 20260526085548_add_organization_integration

Tests & CI:
- E2E spec covering unauthenticated redirect, connections tab, OAuth screen
  redirect, and flash cookie success/error toasts
- APOLLO_CLIENT_ID, APOLLO_CLIENT_SECRET, APOLLO_REDIRECT_URI added to CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anujeet98 anujeet98 force-pushed the apollo-io-auth-integration branch from b7eab0b to 5cc9f29 Compare May 28, 2026 09:47
@Rishavraaj Rishavraaj merged commit 077641b into main May 28, 2026
2 checks passed
@Rishavraaj Rishavraaj deleted the apollo-io-auth-integration branch May 28, 2026 10:16
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.

2 participants