plugins/base44/skills/base44-sdk/SKILL.md
The base44 SDK is the library to communicate with base44 services. In projects, you use it to communicate with remote resources (entities, backend functions, ai agents) and to write backend functions. This skill is the place for learning about available modules and types. When you plan or implement a feature, you must learn this skill
npx skillsauth add openai/plugins base44-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build apps on the Base44 platform using the Base44 JavaScript SDK.
This skill activates on ANY mention of "base44" or when a base44/ folder exists. DO NOT read documentation files or search the web before acting.
Your first action MUST be:
base44/config.jsonc exists in the current directoryUse base44-sdk when:
base44/config.jsonc already exists in the project@base44/sdk)DO NOT USE base44-sdk for:
base44-cli instead)npx base44 create, npx base44 deploy, npx base44 login (use base44-cli)Skill Dependencies:
base44-sdk assumes a Base44 project is already initializedbase44-cli is a prerequisite for base44-sdk in new projectsbase44-cli firstState Check Logic: Before selecting this skill, verify:
base44/config.jsonc exists):
→ Use base44-cli (project initialization needed)// In Base44-generated apps, base44 client is pre-configured and available
// CRUD operations
const task = await base44.entities.Task.create({ title: "New task", status: "pending" });
const tasks = await base44.entities.Task.list();
await base44.entities.Task.update(task.id, { status: "done" });
// Get current user
const user = await base44.auth.me();
// External apps
import { createClient } from "@base44/sdk";
// IMPORTANT: Use 'appId' (NOT 'clientId' or 'id')
const base44 = createClient({ appId: "your-app-id" });
await base44.auth.loginViaEmailPassword("[email protected]", "password");
Before writing ANY Base44 code, verify method names against this table or QUICK_REFERENCE.md.
Base44 SDK has unique method names. Do NOT assume patterns from Firebase, Supabase, or other SDKs.
| ❌ WRONG (hallucinated) | ✅ CORRECT |
|------------------------|-----------|
| signInWithGoogle() | loginWithProvider('google') |
| signInWithProvider('google') | loginWithProvider('google') |
| auth.google() | loginWithProvider('google') |
| signInWithEmailAndPassword(email, pw) | loginViaEmailPassword(email, pw) |
| signIn(email, pw) | loginViaEmailPassword(email, pw) |
| createUser() / signUp() | register({email, password}) |
| onAuthStateChanged() | me() (no listener, call when needed) |
| currentUser | await auth.me() |
| ❌ WRONG (hallucinated) | ✅ CORRECT |
|------------------------|-----------|
| functions.call('name', data) | functions.invoke('name', data) |
| functions.run('name', data) | functions.invoke('name', data) |
| callFunction('name', data) | functions.invoke('name', data) |
| httpsCallable('name')(data) | functions.invoke('name', data) |
| ❌ WRONG (hallucinated) | ✅ CORRECT |
|------------------------|-----------|
| ai.generate(prompt) | integrations.Core.InvokeLLM({prompt}) |
| openai.chat(prompt) | integrations.Core.InvokeLLM({prompt}) |
| llm(prompt) | integrations.Core.InvokeLLM({prompt}) |
| sendEmail(to, subject, body) | integrations.Core.SendEmail({to, subject, body}) |
| email.send() | integrations.Core.SendEmail({to, subject, body}) |
| uploadFile(file) | integrations.Core.UploadFile({file}) |
| storage.upload(file) | integrations.Core.UploadFile({file}) |
| ❌ WRONG (hallucinated) | ✅ CORRECT |
|------------------------|-----------|
| entities.Task.find({...}) | entities.Task.filter({...}) |
| entities.Task.findOne(id) | entities.Task.get(id) |
| entities.Task.insert(data) | entities.Task.create(data) |
| entities.Task.remove(id) | entities.Task.delete(id) |
| entities.Task.onChange(cb) | entities.Task.subscribe(cb) |
| Module | Purpose | Reference |
|--------|---------|-----------|
| entities | CRUD operations on data models | entities.md |
| auth | Login, register, user management | auth.md |
| agents | AI conversations and messages | base44-agents.md |
| functions | Backend function invocation | functions.md |
| integrations | AI, email, file uploads, custom APIs | integrations.md |
| analytics | Track custom events and user activity | analytics.md |
| appLogs | Log user activity in app | app-logs.md |
| users | Invite users to the app | users.md |
| asServiceRole.connectors | App-scoped OAuth tokens (service role only) | connectors.md |
| asServiceRole.sso | SSO token generation (service role only) | sso.md |
For client setup and authentication modes, see client.md.
Each reference file includes a "Type Definitions" section with TypeScript interfaces and types for the module's methods, parameters, and return values.
Getting typed entities, functions, and agents: The Base44 CLI generates types from your project resources (entities, functions, agents), including augmentations to EntityTypeRegistry, FunctionNameRegistry, and AgentNameRegistry, and wires them into your project so you get autocomplete and type checking without manual setup. For how to generate types, use the base44-cli skill.
Manual augmentation: You can instead augment the registries yourself in a .d.ts file; see the Type Definitions sections in entities.md, functions.md, and base44-agents.md.
Install the Base44 SDK:
npm install @base44/sdk
Important: Never assume or hardcode the @base44/sdk package version. Always install without a version specifier to get the latest version.
When creating a client in external apps, ALWAYS use appId as the parameter name:
import { createClient } from "@base44/sdk";
// ✅ CORRECT
const base44 = createClient({ appId: "your-app-id" });
// ❌ WRONG - Do NOT use these:
// const base44 = createClient({ clientId: "your-app-id" }); // WRONG
// const base44 = createClient({ id: "your-app-id" }); // WRONG
Required parameter: appId (string) - Your Base44 application ID
Optional parameters:
token (string) - Pre-authenticated user tokenoptions (object) - Configuration options
options.onError (function) - Global error handlerExample with error handler:
const base44 = createClient({
appId: "your-app-id",
options: {
onError: (error) => {
console.error("Base44 error:", error);
}
}
});
Working with app data?
entitiesentities.importEntities()entities.EntityName.subscribe()User management?
authauth.me()auth.updateMe()users.inviteUser()AI features?
agents (requires logged-in user)agents.createConversation()agents.getConversations()integrations.Core.InvokeLLM()integrations.Core.GenerateImage()Custom backend logic?
functions.invoke()base44.asServiceRole.functions.invoke()External services?
integrations.Core.SendEmail()integrations.Core.UploadFile()integrations.custom.call()asServiceRole.connectors.getConnection() (backend only)Tracking and analytics?
analytics.track()appLogs.logUserInApp()const pendingTasks = await base44.entities.Task.filter(
{ status: "pending", assignedTo: userId }, // query
"-created_date", // sort (descending)
10, // limit
0 // skip
);
const user = await base44.auth.me();
if (!user) {
// Navigate to your custom login page
navigate('/login', { state: { returnTo: window.location.pathname } });
return;
}
// Frontend
const result = await base44.functions.invoke("processOrder", {
orderId: "123",
action: "ship"
});
// Backend function (Deno)
import { createClientFromRequest } from "npm:@base44/sdk";
Deno.serve(async (req) => {
const base44 = createClientFromRequest(req);
const { orderId, action } = await req.json();
// Process with service role for admin access
const order = await base44.asServiceRole.entities.Orders.get(orderId);
return Response.json({ success: true });
});
Use asServiceRole in backend functions for admin-level operations:
// User mode - respects permissions
const myTasks = await base44.entities.Task.list();
// Service role - full access (backend only)
const allTasks = await base44.asServiceRole.entities.Task.list();
const token = await base44.asServiceRole.connectors.getAccessToken("slack");
| Capability | Frontend | Backend |
|------------|----------|---------|
| entities (user's data) | Yes | Yes |
| auth | Yes | Yes |
| agents | Yes | Yes |
| functions.invoke() | Yes | Yes |
| functions.fetch() | Yes | Yes |
| integrations | Yes | Yes |
| analytics | Yes | Yes |
| appLogs | Yes | Yes |
| users | Yes | Yes |
| asServiceRole.* | No | Yes |
| asServiceRole.connectors (app OAuth) | No | Yes |
| asServiceRole.sso | No | Yes |
Backend functions use Deno.serve() and createClientFromRequest(req) to get a properly authenticated client.
tools
Top-level workflow skill for USD performance diagnosis and optimization. Use for slow loading, high memory, low FPS, or 'optimize my scene' requests; delegates auth/runtime setup to Phase 0 owners.
data-ai
Use when the user mentions MagicPath, designs, UI components, themes, canvas selections, or repo-to-canvas UI work; run magicpath-ai to search, inspect, install, or author components.
documentation
Use as the top-level router for Omniverse Realtime Viewer USD app requests and focused viewer reference documents.
tools
Turn Notion specs into implementation plans, tasks, and progress tracking; use when implementing PRDs/feature specs and creating Notion plans + tasks from them.