Zum Hauptinhalt springen

Overview

Integrations module for calling integration methods. This module provides access to integration methods for interacting with external services. Unlike the connectors module that gives you raw OAuth tokens, integrations provide pre-built functions that Base44 executes on your behalf.

Integration Types

There are two types of integrations:
  • Built-in integrations (Core): Pre-built functions provided by Base44 for common tasks such as AI-powered text generation, image creation, file uploads, and email. Access core integration methods using:
  • Custom workspace integrations (custom): Pre-configured external APIs set up by workspace administrators. Workspace integration calls are proxied through Base44’s backend, so credentials are never exposed to the frontend. Access custom workspace integration methods using:
    To call a custom workspace integration, it must be pre-configured by a workspace administrator who imports an OpenAPI specification. Learn more about custom workspace integrations.

Authentication Modes

This module is available to use with a client in all authentication modes:
  • Anonymous or User authentication (base44.integrations): Integration methods are invoked with the current user’s permissions. Anonymous users invoke methods without authentication, while authenticated users invoke methods with their authentication context.
  • Service role authentication (base44.asServiceRole.integrations): Integration methods are invoked with the service role for backend code that needs elevated permissions.

Example

Example

Core Integrations Methods

Core package containing built-in Base44 integration functions.

InvokeLLM()

InvokeLLM(params): Promise<string | object>
Generate text or structured JSON data using AI models.

Parameters

params
InvokeLLMParams
erforderlich
Parameters for the LLM invocation
prompt
string
erforderlich
The prompt text to send to the model
model
"gpt_5_mini" | "gemini_3_flash" | "gpt_5_4" | "gpt_5_5" | "gemini_3_1_pro" | "claude_sonnet_4_6" | "claude_opus_4_6" | "claude_opus_4_7" | "claude_opus_4_8"
Optionally specify a model to override the app-level model setting for this specific call.Options: "gpt_5_mini", "gemini_3_flash", "gpt_5_4", "gpt_5_5", "gemini_3_1_pro", "claude_sonnet_4_6", "claude_opus_4_6", "claude_opus_4_7", "claude_opus_4_8"
add_context_from_internet
boolean
If set to true, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
response_json_schema
object
If you want structured data back, provide a JSON schema object here. If provided, the function returns a JSON object; otherwise, it returns a string.
file_urls
string[]
A list of file URLs (uploaded via UploadFile) to provide as context/attachments to the LLM. Do not use this together with add_context_from_internet.

Returns

Promise<string | object>
an
Promise<string | object>
erforderlich
Promise resolving to a string (when no schema provided) or an object (when schema provided).

Examples


GenerateImage()

GenerateImage(params): Promise<GenerateImageResult>
Create AI-generated images from text prompts. Images are generated as PNG files at approximately 1024px on the shorter side. The exact dimensions vary by aspect ratio. Prompts that violate the AI provider’s content policy will be refused.

Parameters

params
GenerateImageParams
erforderlich
Parameters for image generation
prompt
string
erforderlich
Description of the image to generate.

Returns

GenerateImageResult
url
string
erforderlich
URL of the generated image.

Example


UploadFile()

UploadFile(params): Promise<UploadFileResult>
Upload files to public storage and get a URL.

Parameters

params
UploadFileParams
erforderlich
Parameters for file upload
file
File
erforderlich
The file object to upload.

Returns

UploadFileResult
file_url
string
erforderlich
URL of the uploaded file.

Example


SendEmail()

SendEmail(params): Promise<any>
Send emails to registered users of your app.

Parameters

params
SendEmailParams
erforderlich
Parameters for sending email
to
string
erforderlich
Recipient email address.
subject
string
erforderlich
Email subject line.
body
string
erforderlich
Plain text email body content.
from_name
string
The name of the sender. If omitted, the app’s name will be used.

Returns

Promise<any> Promise resolving when the email is sent.

ExtractDataFromUploadedFile()

ExtractDataFromUploadedFile(params): Promise<object>
Extract structured data from uploaded files based on the specified schema. Start by uploading the file to public storage using the UploadFile() function. Then, use the file_url parameter to extract structured data from the uploaded file.

Parameters

params
ExtractDataFromUploadedFileParams
erforderlich
Parameters for data extraction
file_url
string
erforderlich
The URL of the uploaded file to extract data from.
json_schema
object
erforderlich
A JSON schema object defining what data fields you want to extract.

Returns

Promise<object> Promise resolving to the extracted data.

Examples


UploadPrivateFile()

UploadPrivateFile(params): Promise<UploadPrivateFileResult>
Upload files to private storage that requires a signed URL to access. Create a signed URL to access uploaded files using the CreateFileSignedUrl() function.

Parameters

params
UploadPrivateFileParams
erforderlich
Parameters for private file upload
file
File
erforderlich
The file object to upload.

Returns

UploadPrivateFileResult
file_uri
string
erforderlich
URI of the uploaded private file, used to create a signed URL.

Examples


CreateFileSignedUrl()

CreateFileSignedUrl(params): Promise<CreateFileSignedUrlResult>
Generate temporary access links for private files. Start by uploading the file to private storage using the UploadPrivateFile() function. Then, use the file_uri parameter to create a signed URL to access the uploaded file.

Parameters

params
CreateFileSignedUrlParams
erforderlich
Parameters for creating signed URL
file_uri
string
erforderlich
URI of the uploaded private file.
expires_in
number
How long the signed URL should be valid for, in seconds.

Returns

CreateFileSignedUrlResult
signed_url
string
erforderlich
Temporary signed URL to access the private file.

Example

Custom Integrations Methods

Module for calling custom pre-configured API integrations. Custom integrations allow workspace administrators to connect any external API by importing an OpenAPI specification. Apps in the workspace can then call these integrations using this module.

call()

call(
slug,
operationId,
params?
): Promise<CustomIntegrationCallResponse>
Call a custom integration endpoint.

Parameters

slug
string
erforderlich
The integration’s unique identifier, as defined by the workspace admin.
operationId
string
erforderlich
The endpoint in method:path format. For example, "get:/contacts", or "post:/users/{id}". The method is the HTTP verb in lowercase and the path matches the OpenAPI specification.
params
CustomIntegrationCallParams
Optional parameters including payload, pathParams, and queryParams.

Returns

Promise<CustomIntegrationCallResponse> Promise resolving to the integration call response.

Throws

If slug is not provided.

Throws

If operationId is not provided.

Throws

If the integration or operation is not found (404).

Throws

If the external API call fails (502).

Throws

If the request times out (504).

Examples

Type Definitions

Core

Core: CoreIntegrations
Core package containing built-in Base44 integration functions.

Example

custom

custom: CustomIntegrationsModule
Workspace integrations module for calling pre-configured external APIs.

Example