Skip to content

feat(connectors): add OAuth flow handling with browser redirect and polling#192

Merged
Paveltarno merged 2 commits intopavelta-connectors-push-logicfrom
pavelta-connectors-4
Feb 8, 2026
Merged

feat(connectors): add OAuth flow handling with browser redirect and polling#192
Paveltarno merged 2 commits intopavelta-connectors-push-logicfrom
pavelta-connectors-4

Conversation

@Paveltarno
Copy link
Contributor

@Paveltarno Paveltarno commented Feb 4, 2026

Note

Description

This PR adds a complete connectors management system to the Base44 CLI, enabling users to configure and push OAuth-based integrations (Google Calendar, Slack, Notion, etc.) to their Base44 apps. It includes the new base44 connectors push command with interactive OAuth flow handling that opens the user's browser and polls for authorization completion.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

CLI Layer:

  • Added src/cli/commands/connectors/index.ts - Parent command for connector management
  • Added src/cli/commands/connectors/push.ts - Push command with OAuth flow orchestration, user prompts, and summary output
  • Registered connectors command in program.ts

Core Layer:

  • Created src/core/resources/connector/oauth.ts - runOAuthFlow() function that opens browser and polls OAuth status (2-minute timeout)
  • Updated src/core/resources/connector/api.ts - Renamed syncConnector to setConnector, changed endpoint from POST /sync to PUT /integrations/{type}
  • Updated src/core/resources/connector/push.ts - Adapted to new API endpoint and response format
  • Updated src/core/resources/connector/schema.ts - Renamed OAuthPollingStatus to ConnectorOAuthStatus, updated connector status values to lowercase, made error fields nullable
  • Simplified src/core/resources/connector/config.ts - Removed filename-type validation (no longer required)
  • Integrated connectors into project config loading (project/config.ts, project/schema.ts, project/types.ts)

Tests:

  • Added tests/cli/connectors_push.spec.ts - CLI integration tests covering push scenarios, OAuth flows, and error cases
  • Updated tests/core/connectors.spec.ts - Unit tests for OAuth flow with polling behavior
  • Added connector-related mocks to tests/cli/testkit/Base44APIMock.ts
  • Removed obsolete connector-type-mismatch fixture

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

  • The OAuth flow automatically skips in CI environments to avoid blocking automated tests
  • Users can authorize connectors later by re-running base44 connectors push
  • The command syncs local connectors, updates scopes, and removes unlisted remote connectors
  • Error handling is per-connector, so one failing connector doesn't block others
  • Uses p-wait-for with TimeoutError for clean timeout handling (2-minute polling window)

🤖 Generated by Claude | 2026-02-08 15:47 UTC

…olling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Paveltarno Paveltarno changed the title feat(connectors): add OAuth flow handling with browser redirect and p… feat(connectors): add OAuth flow handling with browser redirect and polling Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.28-pr.192.83d7b55

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.28-pr.192.83d7b55"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.28-pr.192.83d7b55"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 4, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


@kfirstri kfirstri moved this from Backlog to In progress in CLI Development Feb 5, 2026
* final connector work sofi 1

* scopes
@Paveltarno Paveltarno merged commit 28ddeee into pavelta-connectors-push-logic Feb 8, 2026
3 checks passed
@Paveltarno Paveltarno deleted the pavelta-connectors-4 branch February 8, 2026 15:35
@github-project-automation github-project-automation bot moved this from In progress to Done in CLI Development Feb 8, 2026
Paveltarno added a commit that referenced this pull request Feb 8, 2026
…olling (#192)

* feat(connectors): add OAuth flow handling with browser redirect and polling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

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

* connectors: base44 connectors push (#194)

* final connector work sofi 1

* scopes

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Paveltarno added a commit that referenced this pull request Feb 8, 2026
* feat(connectors): implement push logic for syncing connectors

Add pushConnectors function that:
- Syncs all local connectors via /sync endpoint
- Removes upstream-only connectors not in local config
- Returns typed results (synced, removed, needs_oauth, error)

Includes unit tests covering all scenarios.

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

* feat(connectors): add OAuth flow handling with browser redirect and polling (#192)

* feat(connectors): add OAuth flow handling with browser redirect and polling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

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

* connectors: base44 connectors push (#194)

* final connector work sofi 1

* scopes

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Paveltarno added a commit that referenced this pull request Feb 8, 2026
* feat(connectors): implement push logic for syncing connectors

Add pushConnectors function that:
- Syncs all local connectors via /sync endpoint
- Removes upstream-only connectors not in local config
- Returns typed results (synced, removed, needs_oauth, error)

Includes unit tests covering all scenarios.

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

* feat(connectors): add OAuth flow handling with browser redirect and polling (#192)

* feat(connectors): add OAuth flow handling with browser redirect and polling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

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

* connectors: base44 connectors push (#194)

* final connector work sofi 1

* scopes

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.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

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant