/base44-sandbox:base44-sdkfrom base44-sandbox
Provides guidance on using the Base44 JavaScript SDK for building apps on the Base44 platform, including CRUD operations, realtime actors, AI agents, and backend functions. Activates when a Base44 project is detected.
Ships in base44-sandbox. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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}) |
Exception: an OpenAI-compatible client (e.g. the Vercel AI SDK or the
openaiSDK) is correct when pointed atbase44.asServiceRole.aiGateway.connection()— that's how you build code agents (agent loops with tools) and call the gateway's image, video, and speech endpoints. UseInvokeLLMonly for a single call with no tools. See ai-gateway.md.
| ❌ WRONG (hallucinated) | ✅ CORRECT |
|---|---|
actors.connect('ChatRoom', roomId) | actors.ChatRoom(roomId).connect() |
actors.ChatRoom.connect(roomId) | actors.ChatRoom(roomId).connect() |
actors.ChatRoom(roomId).subscribe(cb) | subscribe on the connection: const conn = actors.ChatRoom(roomId).connect(); conn.subscribe(cb) |
room.on('message', cb) | room.subscribe(cb) (one callback receives every message) |
room.emit(data) | room.send(data) |
new WebSocket(...) for app realtime | base44.actors.<Name>(id).connect() |
const unsub = room.subscribe(cb); unsub() | const sub = room.subscribe(cb); sub.unsubscribe() |
The two
subscribe()methods return different shapes.Connection.subscribe()(actors) returns an object —sub.unsubscribe().entities.<Name>.subscribe()returns the unsubscribe function itself —unsub(). Don't carry one convention to the other.
| ❌ 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 |
actors | Realtime rooms over WebSockets (multiplayer, collaboration, presence) | actors.md |
integrations | AI, email, file uploads, custom APIs | integrations.md |
aiGateway | Base44's AI gateway: code agents, images, videos, speech, and structured evaluations (Jev) | ai-gateway.md |
payments / asServiceRole.payments | Checkouts, purchases, refunds, and subscriptions (Stripe/PayPal/Base44 Payments) | payments.md |
analytics | Track custom events and user activity | analytics.md |
appLogs | Log user activity in app | app-logs.md |
app | Read the app's own public settings (visibility) | app.md |
users | Invite users to the app | users.md |
connectors | App user OAuth flows (start/disconnect the current user's own connection) | connectors.md |
asServiceRole.connectors | Shared/app-scoped OAuth tokens and metered connector calls (service role only) | connectors.md |
asServiceRole.sso | SSO token generation (service role only) | sso.md |
asServiceRole.browser | Remote browser automation sessions (service role only) | browser.md |
asServiceRole.voice | Live voice sessions, beta (service role only) | voice.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, actors, and agents: The Base44 CLI generates types from your project resources (entities, functions, actors, agents), including augmentations to EntityTypeRegistry, FunctionNameRegistry, ActorNameRegistry, 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, actors.md, and base44-agents.md. Actor message types are always hand-authored — augment ActorRegistry so the actor and its clients share one definition.
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()aiGateway images (see ai-gateway.md)integrations.Core.GenerateVideo(); model choice, references, or frames → aiGateway videos, an async job (see ai-gateway.md)aiGateway with provider: "typesafe" (Jev), not InvokeLLM with a JSON schema (see ai-gateway.md)aiGateway (see ai-gateway.md)Custom backend logic?
functions.invoke()base44.asServiceRole.functions.invoke()Realtime shared session?
actors.<Name>(roomId).connect() (see actors.md)entities.EntityName.subscribe(), not an actorExternal services?
integrations.Core.SendEmail()integrations.Core.UploadFile()integrations.custom.call()asServiceRole.connectors.getConnection() (backend only)connectors.connectAppUser() (frontend) + asServiceRole.connectors.getCurrentAppUserConnection() (backend)asServiceRole.connectors.callApi() (backend only)asServiceRole.browser.getSession() (backend only)Payments?
asServiceRole.payments.createCheckout() (backend, creates it) + payments.mountCheckout() (frontend, renders it) — see payments.mdpayments.listPurchases()asServiceRole.payments.refund() / cancelSubscription() / pauseSubscription() / resumeSubscription() (backend only)Live voice?
asServiceRole.voice.createSession() (backend only, beta) — see voice.mdTracking and analytics?
analytics.track()appLogs.logUserInApp()app.getPublicSettings()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
// ⚠️ invoke() returns the RAW axios response — your function's JSON is on `.data`,
// NOT the top-level object. It also THROWS on non-2xx (error body at err.response.data).
const res = await base44.functions.invoke("processOrder", {
orderId: "123",
action: "ship"
});
const result = res.data; // ✅ e.g. res.data.success (res itself is { data, status, headers, … })
// Backend function
import { createClientFromRequest } from "npm:@base44/sdk";
export default async function (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 });
}
// Frontend — connect inside useEffect and always clean up
useEffect(() => {
const room = base44.actors.ChatRoom(roomId).connect();
const sub = room.subscribe((msg) => {
if (msg.type === "message") setMessages((prev) => [...prev, msg]); // switch on type; drop unknowns
});
return () => { sub.unsubscribe(); room.close(); }; // NOTE: actors return { unsubscribe() },
}, [roomId]); // entities.subscribe() returns the function itself
// Actor — base44/actors/ChatRoom/entry.ts
import { Actor } from "base44:runtime/actors";
export default class ChatRoom extends Actor {
handleConnect(conn) { conn.send({ type: "welcome" }); } // one client
handleMessage(conn, msg) {
// Always validate: the payload is attacker-controlled and msg can even be null.
if (msg?.type !== "message" || typeof msg.text !== "string") return;
this.broadcast({ type: "message", text: msg.text.slice(0, 2000) }); // everyone
}
handleClose(conn) {}
}
Use asServiceRole in backend functions for admin-level operations. Actors expose this.client.asServiceRole for validated, room-owned work such as persisting canonical results; use verified conn.identity.userId from an authenticated connection for explicit user attribution. See actors.md.
// 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 |
actors (connect to a room) | Yes | No — the actor is the server side |
integrations | Yes | Yes |
aiGateway | No | Yes |
payments (preload/mount/complete/list own purchases) | Yes | No |
asServiceRole.payments (create checkout/refund/subscriptions) | No | Yes |
analytics | Yes | Yes |
appLogs | Yes | Yes |
app (read public settings) | Yes | Yes |
users | Yes | Yes |
connectors (app user OAuth: connect/disconnect) | Yes | No |
asServiceRole.* | No | Yes |
asServiceRole.connectors (shared/app OAuth, metered calls) | No | Yes |
asServiceRole.sso | No | Yes |
asServiceRole.browser | No | Yes |
asServiceRole.voice (beta) | No | Yes |
Backend functions export default an async request handler and use createClientFromRequest(req) to get a properly authenticated client.
references/QUICK_REFERENCE.md (opens in a new tab)references/actors.md (opens in a new tab)references/ai-gateway.md (opens in a new tab)references/analytics.md (opens in a new tab)references/app-logs.md (opens in a new tab)references/app.md (opens in a new tab)references/auth.md (opens in a new tab)references/base44-agents.md (opens in a new tab)references/browser.md (opens in a new tab)references/client.md (opens in a new tab)references/connectors.md (opens in a new tab)references/entities.md (opens in a new tab)references/functions.md (opens in a new tab)references/integrations.md (opens in a new tab)references/payments.md (opens in a new tab)references/sso.md (opens in a new tab)references/users.md (opens in a new tab)references/voice.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub base44/skills --plugin base44-sandbox14 skills in this plugin
/base44-cliThe base44 CLI is used for EVERYTHING related to base44 projects: resource configuration (entities, backend functions, realtime actors, ai agents), initialization and actions (resource creation, deployment), and any other operation on an existing app or workspace through the Base44 public API (settings, domains, users, members, source export). This skill is the place for learning about how to configure resources, including actors — the realtime/WebSocket primitive behind multiplayer, collaborative boards, presence and live cursors, in-room chat, and live auctions. When you plan or implement a feature, you must learn this skill/base44-platform-actorsBase44 realtime actors: stateful server rooms over WebSockets (Durable Objects) under base44/actors/<Name>/entry.ts for multiplayer, collaborative boards, presence, live cursors, chat rooms and auctions, with the actor contract, rules and the React client. Use when users interact live in one shared session./base44-platform-agentsBase44 in-app AI agents: JSON agent configs under base44/agents/ with entity, backend-function or server-route tools, WhatsApp and Telegram channels, the agents SDK for conversation UIs, and code agents (an agent loop the app runs on the AI gateway). Use when the app needs a conversational assistant or programmable AI./base44-platform-backend-functionsBase44 server-side code: backend functions (HTTP handlers in base44/functions/<name>/entry.ts on Cloudflare Workers) for Vite SPA apps, or TanStack Start server functions and server routes. Secrets, the Base44 SDK on the server, auth and service role, webhooks, admin-only handlers, frontend invocation, testing, and the InvokeLLM model table. Use when the app needs external APIs, privileged logic or scheduled work./base44-platform-connectorsBase44 app connectors: OAuth integrations with external services (Google, Slack, GitHub and more) in shared, app-user and BYO-shared modes, how to connect one from an external agent, and how server code reads the token with getConnection. Use when the app must act on a user's or the builder's account at a third-party service./base44-platform-entitiesBase44 entities: the JSON-schema data models under base44/entities/, the entity SDK, and row-level security (RLS) rules. Use when adding or changing stored data, queries, or per-user access rules in a Base44 app.Other plugins' skills for the same job