Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.base44.com/llms.txt

Use this file to discover all available pages before exploring further.

You’re viewing developer documentation
This documentation is for developers working with the Base44 developer platform. For information about connectors in the app editor, see Using Connectors.
A shared connector connects one account for the whole app. All app users share the same OAuth token. Use this for service accounts, like posting to a company Slack channel, reading from a shared Google Calendar, or querying a shared Notion workspace. To set up a shared connector:
  1. Configure a JSONC file for each service you need
  2. Deploy and authorize via the CLI
  3. Use in backend functions by calling getConnection() for OAuth connectors, or using the Stripe REST API directly for payments

Configure

Each connector is a JSONC file in your project’s connectors directory. The file defines the integration type and the scopes your app needs. By default the directory is base44/connectors/, but you can customize the path in your project configuration.
connectors
googlecalendar.jsonc
slack.jsonc
slackbot.jsonc
notion.jsonc

Example

This example configures a Google Calendar connector with read and event management scopes:
{
  "type": "googlecalendar",
  "scopes": [
    "https://www.googleapis.com/auth/calendar.readonly",
    "https://www.googleapis.com/auth/calendar.events",
  ],
}

Field reference

type
string
required
The integration type identifier. See the supported services table for the full list of accepted values.Each connector type can only be defined once in your project.
scopes
array
required
Array of OAuth scopes required for your integration. The specific scopes depend on the external service and what operations your app needs to perform. See the connector permissions and scopes documentation for available scopes for each service.

Deploy and authorize

Deploy connectors with connectors push or deploy. To download existing connectors from Base44, use connectors pull. When you push, the CLI handles each connector based on its type:
  • OAuth connectors: The CLI prompts you to authorize each connector one by one. It suggests opening your browser automatically, and if you accept, it iterates through each integration’s authorization page sequentially. After authorization completes, your OAuth tokens are stored securely and you can retrieve them using the SDK.
  • Stripe: The CLI provisions a Stripe sandbox for your app and returns a claim URL to complete onboarding. No OAuth flow is needed.

Use in backend functions

Once deployed and authorized, use the connector in your backend functions. The approach depends on the connector’s auth model:
Call connectors.getConnection() with the connector type to retrieve an accessToken for making authenticated API calls. Some connectors also return a connectionConfig with additional parameters (e.g. a subdomain or account ID).This example retrieves a Google Calendar connection and fetches upcoming events:
const { accessToken } =
  await base44.asServiceRole.connectors.getConnection("googlecalendar");

const timeMin = new Date().toISOString();
const url = `https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=10&orderBy=startTime&singleEvents=true&timeMin=${timeMin}`;

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${accessToken}` },
});

const events = await response.json();

Connector automations

Connector automations let your backend functions respond to events from connected services in real time. For example, you can run a function when a new email arrives in Gmail or a file changes in Google Drive. Configure connector automations in your function.jsonc file alongside your other automations. See Connector automations for the full field reference, supported events, and payload documentation.

See also