Skip to main content
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.
Connectors are OAuth integrations that let your app connect to third-party services. Use connectors to authenticate with external APIs and make calls with your app’s credentials. After authorization, you can retrieve OAuth access tokens in your backend functions using the connectors.getAccessToken() method to make authenticated API calls to external services. Supported services:
  • Gmail
  • Google Calendar
  • Google Drive
  • Google Sheets
  • Google Docs
  • Google Slides
  • Slack
  • Notion
  • Salesforce
  • HubSpot
  • LinkedIn
  • TikTok

Create and deploy connectors

Define connectors as JSONC configuration files in your project’s connectors directory and deploy them with connectors push or deploy. By default the connectors directory is base44/connectors/, but you can customize the path in your project configuration. When you push connector configurations, the CLI prompts you to authorize each connector one by one. The CLI 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. Each connector requires a single JSONC file:
connectors
googlecalendar.jsonc
slack.jsonc
notion.jsonc

Configuration format

Connector files use JSONC format. Each file defines the integration type and the OAuth scopes required for your use case.

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. Must be one of: googlecalendar, slack, notion, gmail, googledrive, googlesheets, googledocs, googleslides, salesforce, hubspot, linkedin, or tiktok.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.

Use a connector

Once you’ve pushed your connector configurations and completed OAuth authorization, you can retrieve access tokens in your backend functions using connectors.getAccessToken(). Use these tokens to make authenticated API calls to external services.

Example

This example retrieves a Google Calendar token and fetches upcoming events:
// Get Google Calendar OAuth token
const googleToken = await base44.asServiceRole.connectors.getAccessToken('googlecalendar');

// Fetch upcoming 10 events
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 calendarResponse = await fetch(url, {
  headers: { 'Authorization': `Bearer ${googleToken}` }
});

const events = await calendarResponse.json();

See also