> ## 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.

# Base44 integrations sdk: Integrations and analytics SDK (TanStack Start)

> source commit is in /SOURCE_COMMIT at the repository root. Edits here are overwritten by

> [!WARNING]
>
> This page is part of an AI coding agent skill and is written for agents, not humans. For the human-readable Base44 docs, see the [developer documentation](https://docs.base44.com/developers).

# 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>
All `base44.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>

```js theme={null}
// private end-user uploads:
const {file_uri} = await base44.integrations.Core.UploadPrivateFile({file});
const {signed_url} = await base44.integrations.Core.CreateFileSignedUrl({file_uri});

// public end-user uploads:
const {file_url} = await base44.integrations.Core.UploadPublicFile({file});
```

\<end\_user\_uploads>
Default every end-user upload to `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>\{'\$defs': \{'EmailAttachment': \{'description': 'One attachment as a caller supplies it: a name plus exactly one source.\n\nNo caller-supplied content type: the extension is already constrained to the\nallowlist, so it determines the type and the two can never disagree.', 'properties': \{'filename': \{'description': 'Name the recipient sees, with an extension from the supported set: csv, docx, gif, ics, jpeg, jpg, md, pdf, png, txt, webp, xlsx', 'title': 'Filename', 'type': 'string'}, 'file\_url': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'description': "URL or storage URI of a file THIS app already uploaded (e.g. the file\_url returned by UploadFile). Another app's files are refused.", 'title': 'File Url'}, 'content': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'description': 'Base64-encoded bytes, for a document the function generated itself. Supply either this or file\_url, never both.', 'title': 'Content'}}, 'required': \['filename'], 'title': 'EmailAttachment', 'type': 'object'}}, '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'}, 'from\_name': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'title': 'From Name'}, 'to': \{'title': 'To', 'type': 'string'}, 'subject': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'description': "Subject line. Optional with a template: it overrides the template's own \<title>.", 'title': 'Subject'}, 'body': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'title': 'Body'}, 'html': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'description': "HTML body — the same thing as 'body' under an explicit name. Set one or the other, never both.", 'title': 'Html'}, 'text': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'description': "Plain-text body. On its own, sends a plain-text email. Alongside 'body'/'html', both go out as one multipart/alternative email and the recipient's mail client renders whichever it prefers — so the two must say the same thing. Not accepted with a template: templates are HTML-only.", 'title': 'Text'}, 'template\_id': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'title': 'Template Id'}, 'template\_name': \{'anyOf': \[\{'type': 'string'}, \{'type': 'null'}], 'default': None, 'title': 'Template Name'}, 'variables': \{'anyOf': \[\{'additionalProperties': True, 'type': 'object'}, \{'type': 'null'}], 'default': None, 'title': 'Variables'}, 'attachments': \{'anyOf': \[\{'items': \{'\$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).


## Related topics

- [Introduction](https://docs.base44.com/developers/app-code/overview/introduction.md)
- [Project Structure](https://docs.base44.com/developers/app-code/overview/project-structure.md)
- [SDK overview](https://docs.base44.com/developers/references/sdk/getting-started/overview.md)
- [Base44 Developer Platform](https://docs.base44.com/developers/home.md)
- [Common SDK uses](https://docs.base44.com/developers/references/sdk/getting-started/work-with-sdk.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.