Base44 integrations sdk: Integrations and analytics SDK (TanStack Start)
Integrations: function packages for external data/services, on the pre-initialized base44 client: <core_integrations_backend_functions> Allbase44.integrations.Core SDK methods except UploadPublicFile, UploadPrivateFile and CreateFileSignedUrl must run inside a server function using context.getBase44().asServiceRole.integrations.Core. Check every Core Integration call in the client code. The restricted methods cannot remain there. UploadFile is the retired spelling of UploadPublicFile and is equally client-callable.
Use a clearly named, narrow app operation, not a 1:1 Core proxy: hardcode the Core method, expose and validate only the bounded inputs the feature needs, keep privileged configuration server-side, and return only the required result. Never accept an integration name plus an arbitrary payload for forwarding.
Limit each request’s cost and scope (for example prompt/file size, item count, output count, or fixed recipients/destinations) and add feature-appropriate abuse controls when available.
Upload files directly from the client with UploadPublicFile or UploadPrivateFile. Pass the resulting file_url or file_uri to a server function for follow-on Core work such as transcription or extraction. Signing is not such work: call CreateFileSignedUrl from the client with the file_uri, rather than brokering it through a function of your own. This is the shipped default: the app profile reports core_integrations: backend_functions_only. Only on an app whose profile reports client_allowed may the client call the restricted Core methods directly.
</core_integrations_backend_functions>
UploadPrivateFile. Use UploadPublicFile only when the user asked for these files to be public, or when something outside the app must fetch the file later without signing in.
</end_user_uploads>
InvokeLLM optional model (e.g. model: “claude-sonnet-5”) for complex tasks — non-default models use more integration credits: only when needed, and tell the user. add_context_from_internet only with the models the Core InvokeLLM schema below names for web search; others raise an error. InvokeLLM is a single call with no tools — don’t chain it to simulate an agent loop; agents are covered in the base44-platform-agents skill.
SendEmail reaches registered app users normally. This app may ALSO email addresses that are not registered users, but only with a connected custom domain, on a paid plan, and subject to content screening, recipient-hygiene and anti-abuse limits that can refuse or pause sends — so never promise delivery to a non-registered address, and never route untrusted end-user input straight into the recipient. Invitations still use base44.users.inviteUser.
SendEmail optional attachments: [{filename, file_url}] for a file this app uploaded, or [{filename, content}] with base64 for one the function built. Max 5 per send, 5 MB each, 10 MB total; documents and images only (pdf, png, jpg, gif, webp, csv, txt, md, ics, xlsx, docx) — archives and executables are refused server-side, as is a payload whose bytes don’t match its extension. file_url must be this app’s own file. Never derive attachments from request input: a caller-chosen file plus a caller-chosen recipient mails the app’s own data to a stranger.
Integration packages in this app:
<integration_package>
<package_name>Core</package_name>
<package_description>Built-in integrations that are always available.</package_description>
<endpoint>
<name>InvokeLLM</name>
<description>
Generates a response from an LLM with a prompt.
Be elaborate and detailed in your prompt.
You can potentially ask the llm to output a json, in which case specify the json schema in response_json_schema.
If you need to use external knowledge, use add_context_from_internet=true. This will give the LLM context from live web search, maps and news results. That way you can fetch structured data from the web.
You can attach files (including images) for additional context to the LLM, using the file_urls parameter. This should be a list of urls after uploading them.
You can use both file_urls AND add_context_from_internet together - the system will use a model that supports both vision and web search.
You can optionally specify a model for this call. Options: ‘automatic’, ‘gemini_3_8_flash’, ‘gpt_6_luna’, ‘claude-sonnet-5’, ‘claude_opus_5_5’, ‘gpt_6_sol’, ‘gpt_6_astra’, ‘claude_fable_5_1’, ‘glm_5_2’. Defaults to automatic.
‘gemini_3_8_flash’ and ‘gpt_6_luna’ are fast; ‘claude-sonnet-5’ is balanced; ‘claude_opus_5_5’ and ‘gpt_6_sol’ are frontier models for hard reasoning; ‘claude_fable_5_1’ and ‘gpt_6_astra’ are the strongest and by far the most expensive.
All models except ‘glm_5_2’ support file_urls. Only ‘gemini_3_8_flash’ supports add_context_from_internet (web search). Using an incompatible model will raise an error.
Non-default models cost more integration credits. Only use them when the task requires higher quality.
If response_json_schema is specified, returns a dict (so no need to parse it), otherwise returns a string.
IMPORTANT: If specified, response_json_schema root object must by of type object, not array. i.e. {“type”: “object”, …}
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘prompt’: {‘title’: ‘Prompt’, ‘type’: ‘string’}, ‘add_context_from_internet’: {‘default’: False, ‘title’: ‘Add Context From Internet’, ‘type’: ‘boolean’}, ‘response_json_schema’: {‘anyOf’: [{‘additionalProperties’: True, ‘type’: ‘object’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Response Json Schema’}, ‘file_urls’: {‘anyOf’: [{‘format’: ‘binary’, ‘type’: ‘string’}, {‘items’: {‘type’: ‘string’}, ‘type’: ‘array’}, {‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘File Urls’}, ‘model’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Model’}}, ‘required’: [‘prompt’], ‘title’: ‘InvokeLLMModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>TranscribeAudio</name>
<description>
Transcribes an audio file to text using speech recognition.
First upload the audio file using the UploadPublicFile integration, then pass the resulting URL here.
Returns the transcript as a plain string.
Supported formats: ogg, oga, mp3, wav, webm, m4a, mp4, mpeg, mpga, flac. Maximum file size: 25MB.
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘audio_url’: {‘title’: ‘Audio Url’, ‘type’: ‘string’}}, ‘required’: [‘audio_url’], ‘title’: ‘TranscribeAudioModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>SendEmail</name>
<description>Sends email. Reaches registered app users always; reaching an address that is not a registered user requires a paid plan and a custom domain connected to the app. Optionally specify the sender name; otherwise the app name is used.</description>
<input_schema>{‘ref’: ’#/$defs/EmailAttachment’}, ‘type’: ‘array’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Attachments’}, ‘category’: {‘anyOf’: [{‘enum’: [‘marketing’, ‘transactional’], ‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Category’}}, ‘required’: [‘to’], ‘title’: ‘SendEmailModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>SendPushNotification</name>
<description>Sends a native mobile push notification to one app user’s phone.
Use ONLY when the user explicitly asks for mobile push notifications and the
app ships as a native iOS/Android app. This does not reach the web app, and
it is not email or an in-app notification — for those use SendEmail or build
in-app UI instead. Never reach for it to “notify a user” in general.
The app must have a native mobile build with push credentials configured;
without that the call fails at send time, so do not build a feature around it
unless the user confirmed they have a native mobile app.
Server-side only: call it from a backend function via asServiceRole (a
logged-in end user must not be able to push to other users).
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘user_id’: {‘title’: ‘User Id’, ‘type’: ‘string’}, ‘title’: {‘title’: ‘Title’, ‘type’: ‘string’}, ‘content’: {‘title’: ‘Content’, ‘type’: ‘string’}, ‘action_label’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Action Label’}, ‘action_url’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Action Url’}}, ‘required’: [‘user_id’, ‘title’, ‘content’], ‘title’: ‘SendPushNotificationModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>UploadPublicFile</name>
<description>
Uploads a file to permanent, world-readable public storage.
Returns a dict containing {“file_url”: string}
Anyone holding the url can fetch the file without signing in.
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘file’: {‘format’: ‘binary’, ‘title’: ‘File’, ‘type’: ‘string’}}, ‘required’: [‘file’], ‘title’: ‘UploadPublicFileModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>GenerateImage</name>
<description>Generate an image using AI.
Takes about 5-10 seconds to generate an image.
Be detailed in the prompt, the better the prompt, the better the image.
Optionally provide existing_image_urls as reference - for editing, style inspiration, or visual context.
The integration returns a URL to the generated image: {url: str}</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘prompt’: {‘title’: ‘Prompt’, ‘type’: ‘string’}, ‘existing_image_urls’: {‘anyOf’: [{‘items’: {‘type’: ‘string’}, ‘type’: ‘array’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘Existing Image Urls’}}, ‘required’: [‘prompt’], ‘title’: ‘GenerateImageModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>GenerateSpeech</name>
<description>Generate stored, shareable speech audio (TTS) from text. Returns an MP3 URL: {url: str}.
Multiple voices, consistent across users, high-quality multilingual (auto-detected if language_code is omitted).
For simple in-page playback, prefer the browser’s TTS API.
Spends integration credits in proportion to the length of the text.</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘text’: {‘description’: ‘Text to convert. Max 5000 chars.’, ‘title’: ‘Text’, ‘type’: ‘string’}, ‘voice’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘description’: “Optional voice (default ‘river’):\n- river: calm, neutral.\n- honey: warm, soft.\n- sunny: bright, upbeat.\n- storm: formal, authoritative.\n- spark: energetic, quick.”, ‘title’: ‘Voice’}, ‘language_code’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘description’: “Optional ISO-639-1 code (e.g. ‘en’, ‘es’). Omit to auto-detect.”, ‘title’: ‘Language Code’}}, ‘required’: [‘text’], ‘title’: ‘GenerateSpeechModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>GenerateVideo</name>
<description>Generate a video using AI.
Takes about 30-60 seconds to generate a video.
Be detailed in the prompt - the better the prompt, the better the video.
The integration returns a URL to the generated video: {url: str}
Spends integration credits in proportion to the video’s duration — prefer the shortest duration that meets the need and tell the user.
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘prompt’: {‘title’: ‘Prompt’, ‘type’: ‘string’}, ‘duration’: {‘default’: 6, ‘enum’: [4, 6, 8], ‘title’: ‘Duration’, ‘type’: ‘integer’}, ‘aspect_ratio’: {‘default’: ‘16:9’, ‘enum’: [‘16:9’, ‘9:16’], ‘title’: ‘Aspect Ratio’, ‘type’: ‘string’}, ‘generate_audio’: {‘default’: True, ‘title’: ‘Generate Audio’, ‘type’: ‘boolean’}}, ‘required’: [‘prompt’], ‘title’: ‘GenerateVideoModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>ExtractDataFromUploadedFile</name>
<description>
Extracts data from an uploaded file.
Use the UploadPublicFile integration to get the file url first.
Supports csv, xlsx, json, html, png, jpg, jpeg, and pdf files.
Useful to extract data, and potential flow - upload file, extract data, bulk insert entities into database.
Only use this integration when you know the target JSON schema of the data you’re trying to extract (if you just want the content of a file - fetch the file url).
returns the following object:
{
“status”: “success” | “error”,
“details”: “error details if error, otherwise null”,
“output”: list[dict] | dict | None (exists if status is success)
}
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘file_url’: {‘title’: ‘File Url’, ‘type’: ‘string’}, ‘json_schema’: {‘additionalProperties’: True, ‘title’: ‘Json Schema’, ‘type’: ‘object’}}, ‘required’: [‘file_url’, ‘json_schema’], ‘title’: ‘ExtractDataFromUploadedFileModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>CreateFileSignedUrl</name>
<description>
Creates a signed URL for a private file that can be used to download the file.
The file must be uploaded to the private storage.
Returns a dict containing {“signed_url”: string}
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘file_uri’: {‘title’: ‘File Uri’, ‘type’: ‘string’}, ‘expires_in’: {‘default’: 300, ‘title’: ‘Expires In’, ‘type’: ‘integer’}}, ‘required’: [‘file_uri’], ‘title’: ‘CreateFileSignedUrlModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
<endpoint>
<name>UploadPrivateFile</name>
<description>
Uploads a file to the app’s private filhes directory.
Returns a dict containing {“file_uri”: string}
You can use the file_uri later to create a signed URL for the file using the CreateFileSignedUrl integration
The file is uploaded to the private storage.
</description>
<input_schema>{‘properties’: {‘app_id’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Id’}, ‘app_owner’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘null’}], ‘default’: None, ‘title’: ‘App Owner’}, ‘file’: {‘format’: ‘binary’, ‘title’: ‘File’, ‘type’: ‘string’}}, ‘required’: [‘file’], ‘title’: ‘UploadPrivateFileModel’, ‘type’: ‘object’}</input_schema>
</endpoint>
</integration_package>
Track custom events with base44 from ’@/api/base44Client’:
base44.analytics.track({ eventName: string, properties?: Record<string, string | number | boolean | null> })
Indicative event names (e.g. “user_contact_form_submit”), minimal properties, no PII.
To opt-out, set {"analytics":{"enabled":false}} when initializing the base44 SDK (supported from 0.8.46).