Base44 Coder
Build apps on the Base44 platform using the Base44 JavaScript SDK.⚡ IMMEDIATE ACTION REQUIRED - Read This First
This skill activates on ANY mention of “base44” or when abase44/ folder exists. DO NOT read documentation files or search the web before acting.
Your first action MUST be:
- Check if
base44/config.jsoncexists in the current directory - If YES (existing project scenario):
- This skill (base44-sdk) handles the request
- Implement features using Base44 SDK
- Do NOT use base44-cli unless user explicitly requests CLI commands
- If NO (new project scenario):
- Transfer to base44-cli skill for project initialization
- This skill cannot help until project is initialized
When to Use This Skill vs base44-cli
Use base44-sdk when:- Building features in an EXISTING Base44 project
base44/config.jsoncalready exists in the project- Base44 SDK imports are present (
@base44/sdk) - Writing JavaScript/TypeScript code using Base44 SDK modules
- Implementing functionality, components, or features
- User mentions: “implement”, “build a feature”, “add functionality”, “write code for”
- User says “create a [type] app” and a Base44 project already exists
- ❌ Initializing new Base44 projects (use
base44-cliinstead) - ❌ Empty directories without Base44 configuration
- ❌ When user says “create a new Base44 project/app/site” and no project exists
- ❌ CLI commands like
npx base44 create,npx base44 deploy,npx base44 login(usebase44-cli)
base44-sdkassumes a Base44 project is already initializedbase44-cliis a prerequisite forbase44-sdkin new projects- If user wants to “create an app” and no Base44 project exists, use
base44-clifirst
- IF (user mentions “create/build app” OR “make a project”):
- IF (directory is empty OR no
base44/config.jsoncexists): → Use base44-cli (project initialization needed) - ELSE: → Use base44-sdk (project exists, build features)
- IF (directory is empty OR no
Quick Start
⚠️ CRITICAL: Do Not Hallucinate APIs
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.Authentication - WRONG vs CORRECT
Functions - WRONG vs CORRECT
Integrations - WRONG vs CORRECT
Exception: an OpenAI-compatible client (e.g. the Vercel AI SDK) is correct when pointed atbase44.aiGateway.connection()— that’s how you build code agents (agent loops with tools). UseInvokeLLMonly for a single call with no tools. See ai-gateway.md.
Entities - WRONG vs CORRECT
SDK Modules
For client setup and authentication modes, see client.md.
TypeScript and type registries
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 toEntityTypeRegistry, 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.
Installation
Install the Base44 SDK:@base44/sdk package version. Always install without a version specifier to get the latest version.
Creating a Client (External Apps)
When creating a client in external apps, ALWAYS useappId as the parameter name:
appId (string) - Your Base44 application ID
Optional parameters:
token(string) - Pre-authenticated user tokenoptions(object) - Configuration optionsoptions.onError(function) - Global error handler
Module Selection
Working with app data?- Create/read/update/delete records →
entities - Import data from file →
entities.importEntities() - Realtime updates →
entities.EntityName.subscribe()
- Login/register/logout →
auth - Get current user →
auth.me() - Update user profile →
auth.updateMe() - Invite users →
users.inviteUser()
- Chat with AI agents →
agents(requires logged-in user) - Create new conversation →
agents.createConversation() - Manage conversations →
agents.getConversations() - Generate text/JSON with AI →
integrations.Core.InvokeLLM() - Generate images →
integrations.Core.GenerateImage() - Build a custom agent with tools (backend, agent SDK on the AI gateway) →
aiGateway(see ai-gateway.md)
- Run server-side code →
functions.invoke() - Need admin access →
base44.asServiceRole.functions.invoke()
- Send emails →
integrations.Core.SendEmail() - Upload files →
integrations.Core.UploadFile() - Custom APIs →
integrations.custom.call() - App-scoped OAuth (app builder’s account) →
asServiceRole.connectors.getConnection()(backend only)
- Track custom events →
analytics.track() - Log page views/activity →
appLogs.logUserInApp()
Common Patterns
Filter and Sort Data
Protected Routes (check auth)
Backend Function Call
Service Role Access
UseasServiceRole in backend functions for admin-level operations:
Frontend vs Backend
Backend functions
export default an async request handler and use createClientFromRequest(req) to get a properly authenticated client.