feat: add Apollo.io OAuth integration#142
Merged
Merged
Conversation
b8a1ad8 to
7bbc6a2
Compare
Rishavraaj
requested changes
May 28, 2026
Rishavraaj
reviewed
May 28, 2026
78c43bb to
b7eab0b
Compare
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>
b7eab0b to
5cc9f29
Compare
Rishavraaj
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
token refresh on expiry, revocation on disconnect
and Gather integrations)
Next.js callback route), DELETE /disconnect
Frontend:
redirect, calls backend /exchange, and sets a short-lived _apollo_flash cookie
and clears it — URL stays clean after OAuth redirect
actions; Connected By shows the email of the connecting user
Database:
provider — with access_token, refresh_token, token_expires_at,
connected_by_id, connected_at
Tests & CI:
redirect, and flash cookie success/error toasts