Connectors Module
OAuth token management for external services, giving you raw tokens to call external APIs directly (unlikeintegrations, which wraps pre-built calls).
base44.connectors— App user OAuth flows: start/disconnect the current user’s own connection (frontend).base44.asServiceRole.connectors— Retrieve tokens and call metered connectors (backend/service role only).
- Shared connectors: One OAuth token shared by all app users (e.g. posting to a company Slack channel). Two forms: platform connectors (connected from the app’s Integration settings, identified by an integration type string, retrieved with
getConnection()) and workspace-registered connectors (your own OAuth app, registered in Workspace Settings, identified by a connector ID, retrieved withgetWorkspaceConnection()— e.g. Databricks, Snowflake). - App user connectors: Each signed-in app user has their own token (e.g. sending from their own Gmail). Start the flow from the frontend with
connectAppUser(), then retrieve the token in a backend function withgetCurrentAppUserConnection().
Contents
- App User Connectors (
base44.connectors) - Service Role Connectors (
base44.asServiceRole.connectors) - Metered Connectors
- Available Connectors
- Type Definitions
App User Connectors (base44.connectors)
Frontend methods for the current app user’s own OAuth connection. Keyed by connector ID (a workspace-registered connector), not integration type.
Methods
getCurrentAppUserConnection() (below).
Service Role Connectors (base44.asServiceRole.connectors)
Backend/service role only.
Methods
getConnection(integrationType)
Shared OAuth token and config for a platform connector (one connected from the app’s Integration settings), identified by integration type. All app users share this token.getWorkspaceConnection(connectorId)
Shared OAuth token and config for a workspace-registered connector (your own OAuth app, registered once in Workspace Settings and consented to by the app builder) — e.g. Databricks, Snowflake. Shared-token counterpart ofgetCurrentAppUserConnection(). Identified by connector ID (from the connector’s settings page in Workspace Settings), not integration type.
getCurrentAppUserConnection(connectorId)
Per-app-user OAuth token and config for an app user connector. Requires a client built withcreateClientFromRequest(req) so the runtime knows which app user’s connection to resolve. The connector must be registered in Workspace Settings, and the app user must have completed connectAppUser() first.
Metered Connectors
A few platform connectors are backed by paid third-party APIs that charge Base44 per call. For those, the OAuth token isn’t available to your code —getConnection() rejects with a permission error. Call them with callApi() instead; Base44 attaches the credential server-side, forwards the request, and charges your workspace’s credits. This applies to platform connectors only — workspace-registered and app user connectors run on your own OAuth app and keep normal token access.
callApi(integrationType, request)
Returns:
Promise<ConnectorApiResponse>. Provider and transport outcomes come back in the response (success, phase, status), not thrown — only Base44-side failures (auth, quota, invalid proxy request) reject the promise. Only phase: 'not_sent' proves the provider never executed the request; 'timed_out'/'sent_unconfirmed' may have executed upstream, so don’t blindly retry non-idempotent calls on those.
creditsCharged.
Available Connectors
Use the integration type withgetConnection()/callApi() for platform connectors, or the connector ID with getWorkspaceConnection()/getCurrentAppUserConnection() for workspace-registered/app user connectors.
Run
npx base44 connectors list-available from the CLI to see all available types.
Setup Requirements
- Builder plan or higher
- Backend functions enabled (for service role connectors)
- Connector configured in Base44 dashboard (OAuth flow completed), or registered in Workspace Settings for workspace-registered/app user connectors
Important Notes
- Shared (service role) connectors: One account per connector per app — all users share the same connected account.
- App user connectors: Each app user has their own token; start with
base44.connectors.connectAppUser(), retrieve with the service role’sgetCurrentAppUserConnection(). - You handle the API calls: for non-metered connectors, Base44 provides the token; you make the actual API requests. For metered connectors, use
callApi()instead — you never see the token. - Token refresh: Base44 handles token refresh automatically.