Skip to main content
This page is part of an AI coding agent skill and is written for agents, not humans. For the human-readable Base44 docs, see the developer documentation.

Base44 connectors: App connectors (mobile apps)

<app_connectors> App connectors allow you to integrate with external services in an easy way using OAuth. App connectors come in the following types: <connector_types>
  1. Shared connector: The app builder connects their own account. All app users share the app builder’s single connection. Backend functions call the external API on the app builder’s behalf. See <connector_workflow_rules>.
  2. App user connector: The app builder provides their OAuth app credentials (client ID, client secret). Each App User connects their own account individually. Backend functions call the external API on the app user’s behalf using the app user’s tokens. See <app_user_connectors>.
  3. BYO shared connector: A workspace admin registers their own OAuth app (a workspace connector). The app builder consents once against it; the resulting token is shared across all app users. Use when the platform doesn’t have its own OAuth app for the integration (e.g., Snowflake, Databricks) or when the workspace wants to use its own OAuth app. See <byo_shared_connectors>. </connector_types>
Backend functions MUST be enabled for each connector type. <connector_decision_flow> Connecting a connector happens outside the code: base44 connectors list-available lists the catalog, and the Base44 MCP list_connectors tool is the one source of each connector’s details for this app (description, scopes, auth status, connector_mode); connect or re-scope a shared connector with initiate_connector_connection / base44 connectors initiate passing the complete scope set (it replaces, never merges), and let the user finish OAuth in their browser. App-user and BYO-shared connectors are registered by a workspace admin in Workspace settings → Connectors. Before writing any connector code, read the connector’s connector_mode from list_connectors: app_user_only is app-user mode, shared_only is shared (connect it with initiate_connector_connection), and byo_shared_only is shared through a workspace-registered connector (see <byo_shared_connectors>; initiate_connector_connection covers platform-shared connectors only) — nothing to ask in those cases. When it allows both (all or byo_shared_and_app_user), ask the user which connection mode they want — shared (one account you connect serves every app user) or app user (each app user connects their own) — on every new request, even when a connector of that type is already registered or authorized. </connector_decision_flow> <supported_connectors> The catalog is live: list it with list_connectors (MCP) or base44 connectors list-available; each entry gives the display name and its integration_type. </supported_connectors> Use the connector’s integration_type for getConnection. Many connectors also support webhooks for real-time event notifications. Once a connector is authorized, you can create a workflow with a connector trigger to subscribe to events (see the base44-platform-workflows skill). <connector_workflow_rules> App connectors require a Builder+ subscription; the app profile reports the workspace’s entitlement. When the user asks to connect or use an external service:
  1. If the catalog has no connector for the service, do not use the connector APIs. Integrate with backend functions with secrets or direct API calls instead.
  2. Read the connector’s details (description, scopes, auth status, connection mode) with the Base44 MCP list_connectors tool (base44 connectors list-available lists the catalog only), and follow its connection mode: shared (one account serves every app user) or app user (each user connects their own).
  3. Write connector-backed code only once the connector is authorized, and read its token in server code by connection mode: shared → base44.asServiceRole.connectors.getConnection(integration_type); BYO shared → base44.asServiceRole.connectors.getWorkspaceConnection(connectorId) (see <byo_shared_connectors>); app user → base44.asServiceRole.connectors.getCurrentAppUserConnection(connectorId) for the signed-in app user, after the frontend let them consent with connectAppUser(connectorId) (see <app_user_connectors>). Never serve one app user’s data through the shared account’s token. Then make the API calls yourself. </connector_workflow_rules> </app_connectors>
<byo_shared_connectors> A workspace-registered OAuth app (a workspace connector) that the app builder consents once against. The resulting token is shared across all app users — same semantics as a SHARED connector, but the OAuth credentials come from the workspace admin (not the platform) and so the connection is keyed by connectorId rather than integration_type. Prerequisite — the workspace connector must already exist. A workspace admin registers it in workspace settings → Connectors with the OAuth client_id, client_secret and any integration-specific config such as a Snowflake subdomain; its id is the connectorId below. If none exists for the integration the user needs, tell the user to have their admin register one, then retry. Consent is given once from the Base44 chat assistant in the app’s builder: tell the user to open the app in Base44 and ask the assistant to connect the workspace connector; the MCP initiate_connector_connection tool connects platform-shared connectors by integration type only. No frontend code is generated for this mode — consent is a one-time build-time action, not a runtime action in the published app. Unlike APP_USER, there is no connectAppUser call. Backend function — use getWorkspaceConnection(connectorId):
Differences from SHARED code-gen:
  • A dedicated getWorkspaceConnection(connectorId) method is called with the connector’s id as a string — NOT getConnection, which is reserved for platform-shared connectors keyed by "<integration_type>".
  • connectionConfig is sourced from the workspace admin’s connector registration, not per-app — so whatever the admin configured at registration time is what you get at runtime. </byo_shared_connectors>
<app_user_connectors> App-user connectors are registered per workspace (workspace settings → Connectors); each has an id, the connectorId below. If one is already registered for that integration type, use its id — do not register another. Register a second connector of the same type only when the user asks for a separate one (a different account or OAuth app); when that is unclear, ask which they want instead of registering. When none is registered yet, the user registers one there with the integration type, a name no existing connector uses, a description and the minimal scopes the request needs — suggest those from the provider’s OAuth documentation. When implementing app-user connector functionality:
  1. Connector: Use the connector already registered for that integration type; the user registers a new one only when none exists.
  2. Backend function: Reuse an existing backend function when it already provides the requested connector-backed behavior. If no suitable function exists, create or edit one that uses base44.asServiceRole.connectors.getCurrentAppUserConnection(connectorId) to get the current app user’s connection (access token + connection config) and call the external API.
  3. Frontend: Generate the connect/disconnect UI and data fetching, following the three rules in <app_user_connector_frontend_rules>. Use the connector’s id as the connectorId.
  4. In-app agents: If a specific agent should use this functionality, add the backend function to its tool_configs. Give it app-user connector permission only when it should help app users connect or reconnect that account: in the agent’s config, app_user_connector_configs takes the exact connector id as connector_id; do not pass the integration type or connector name.
<app_user_connector_sdk> APP_USER mode — requires BOTH frontend code (to let each app user consent) AND a backend function (to use the current app user’s token). All APP_USER SDK methods are keyed on connectorId (the connector’s id in the dashboard) — NOT the integration type. SDK methods:
  • connectAppUser(connectorId) — returns a URL string. Open it so the app user can complete OAuth consent.
  • disconnectAppUser(connectorId) — revokes the OAuth connection server-side, returns nothing.
  • getCurrentAppUserConnection(connectorId) — returns a connection object { accessToken, connectionConfig } for the app user’s OAuth connection (not the builder’s). Destructure accessToken and optionally connectionConfig (e.g. const { accessToken, connectionConfig } = await ...getCurrentAppUserConnection(connectorId)). connectionConfig may contain connector-specific parameters (e.g. subdomain, workspace URL) — it holds the admin-entered fields (connection_config_fields from list_connectors names them) plus any the provider returned at connection time, such as an API host or instance URL — when the provider’s API is per-account, take the host from it instead of hardcoding the default.
Backend function example:
</app_user_connector_sdk> <app_user_connector_frontend_rules> Three rules you MUST follow when generating frontend code that uses app user connectors. Design the page UI however fits the app — but always apply these rules: Rule 1 — Auth gate: connectAppUser() will fail if the app user is not signed in. Use base44.auth.isAuthenticated() to check before rendering any connector UI (Connect button, data that depends on the connector). If not authenticated, show a login button that calls base44.auth.redirectToLogin(). Rule 2 — Connection status via data fetch: There is no separate “check connection” API. Instead, call the backend function that uses the connector on page load inside a try/catch. If it succeeds → user is connected (and you already have the data). If it throws → user is not connected, show the Connect button. Extract this fetch as a reusable function — you will call it again in Rule 3. Rule 3 — Auto-refresh after OAuth: The OAuth flow opens in the device browser. When the user finishes and comes back, the screen doesn’t know. To fix this: open the URL with Linking.openURL (expo-linking) and subscribe to AppState (react-native) — when it becomes active, call the reusable fetch from Rule 2 to refresh data automatically. How the three rules connect (hooks/handlers skeleton):
</app_user_connector_frontend_rules> </app_user_connectors>