Skip to main content

Integrations module for calling integration endpoints. This module provides access to integration endpoints for interacting with external services. Integrations are organized into packages. Base44 provides built-in integrations in the Core package. Unlike the connectors module that gives you raw OAuth tokens, integrations provide pre-built functions that Base44 executes on your behalf. Integration endpoints are accessed dynamically using the pattern: base44.integrations.PackageName.EndpointName(params) This module is available to use with a client in all authentication modes:
  • Anonymous or User authentication (base44.integrations): Integration endpoints are invoked with the current user’s permissions. Anonymous users invoke endpoints without authentication, while authenticated users invoke endpoints with their authentication context.
  • Service role authentication (base44.asServiceRole.integrations): Integration endpoints are invoked with elevated admin-level permissions. The endpoints execute with admin authentication context.

Indexable

[packageName: string]: IntegrationPackage Access to additional integration packages.

Example

// Access a custom integration package
base44.integrations.MyCustomPackage.MyFunction({ param: 'value' });

Type Declaration

Core

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

CoreIntegrations


Core package containing built-in Base44 integration functions.

Methods

InvokeLLM()

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

Parameters

params
InvokeLLMParams
required
Parameters for the LLM invocation
prompt
string
required
The prompt text to send to the model
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> Promise resolving to a string (when no schema provided) or an object (when schema provided).

Examples

const response = await base44.integrations.Core.InvokeLLM({
  prompt: "Write a haiku about coding."
});

GenerateImage()

GenerateImage(params): Promise<GenerateImageResult>
Create AI-generated images from text prompts.

Parameters

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

Returns

GenerateImageResult

title: “GenerateImageResult”


URL of the generated image.

Example

const {url} = await base44.integrations.Core.GenerateImage({
  prompt: "A serene mountain landscape with a lake in the foreground"
});
console.log(url); // https://...generated_image.png

UploadFile()

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

Parameters

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

Returns

UploadFileResult

title: “UploadFileResult”


URL of the uploaded file.

Example

const handleFileUpload = async (event: React.ChangeEvent<HTMLInputElement>) => {
  const file = event.target.files?.[0];
  if (!file) return;

  const { file_url } = await base44.integrations.Core.UploadFile({ file });
  console.log(file_url); // https://...uploaded_file.pdf
};

SendEmail()

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

Parameters

params
SendEmailParams
required
Parameters for sending email
to
string
required
Recipient email address.
subject
string
required
Email subject line.
body
string
required
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
required
Parameters for data extraction
file_url
string
required
The URL of the uploaded file to extract data from.
json_schema
object
required
A JSON schema object defining what data fields you want to extract.

Returns

Promise<object> Promise resolving to the extracted data.

Examples

const result = await base44.integrations.Core.ExtractDataFromUploadedFile({
  file_url: "https://example.com/files/invoice.pdf",
  json_schema: {
    type: "object",
    properties: {
      invoice_number: { type: "string" },
      total_amount: { type: "number" },
      date: { type: "string" },
      vendor_name: { type: "string" }
    }
  }
});
console.log(result); // { invoice_number: "INV-12345", total_amount: 1250.00, ... }

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
required
Parameters for private file upload
file
File
required
The file object to upload.

Returns

UploadPrivateFileResult

title: “UploadPrivateFileResult”


URI of the uploaded private file, used to create a signed URL.

Examples

const { file_uri } = await base44.integrations.Core.UploadPrivateFile({ file });
console.log(file_uri); // "private/user123/document.pdf"

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
required
Parameters for creating signed URL
file_uri
string
required
URI of the uploaded private file.
expires_in
number
How long the signed URL should be valid for, in seconds.

Returns

CreateFileSignedUrlResult

title: “CreateFileSignedUrlResult”


Temporary signed URL to access the private file.

Example

const { signed_url } = await base44.integrations.Core.CreateFileSignedUrl({
  file_uri: "private/user123/document.pdf",
  expires_in: 7200 // URL expires in 2 hours
});
console.log(signed_url); // https://...?signature=...