Skip to main content
Beyond data management, the Base44 SDK provides modules for authentication, integrations, custom backend functions, and more. This guide covers common patterns for working with these features.

Authentication

The auth module provides methods for working with user authentication. The most common use case is getting information about the currently authenticated user.
const user = await base44.auth.me();
console.log(user.email, user.name, user.role);

Core integrations

Base44 provides built-in integrations for common tasks like working with AI, sending emails, and handling files. Access these through the integrations.Core module.
const response = await base44.integrations.Core.InvokeLLM({
  prompt: "Write a welcome email for a new user",
  responseFormat: "text",
});

Backend functions

The functions module lets you invoke custom backend functions defined in your app. Pass any data your function needs as parameters.
const result = await base44.functions.invoke("processOrder", {
  orderId: "123",
  action: "fulfill",
});

Error handling

All SDK errors are instances of Base44Error, which includes the HTTP status code and error details. Use this to handle different error scenarios gracefully.
import { Base44Error } from "@base44/sdk";

try {
  const result = await base44.entities.Task.list();
} catch (error) {
  if (error instanceof Base44Error) {
    console.error(`Status: ${error.status}`);
    console.error(`Message: ${error.message}`);
    console.error(`Code: ${error.code}`);
  } else {
    console.error("Unexpected error:", error);
  }
}

See more