mcpbeat Sign in

Base44 SDK Skill for Codex

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

26k tokens
context cost
the whole folder, loaded on every use
14
files
instructions only
0
copies elsewhere
how many repositories repackaged it
4915
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/openai/plugins --skill base44-sdk

What comes with it

91 296 bytes besides the instruction
agents/openai.yaml
references/QUICK_REFERENCE.md
references/analytics.md
references/app-logs.md
references/auth.md
references/base44-agents.md
references/client.md
references/connectors.md
references/entities.md
references/functions.md
references/integrations.md
references/sso.md
references/users.md

The instruction itself

20 sections, as written by the author

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 a base44/ folder exists. DO NOT read documentation files or search the web before acting.

Your first action MUST be:

  • Check if base44/config.jsonc exists 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.jsonc already 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

DO NOT USE base44-sdk for:

  • ❌ Initializing new Base44 projects (use base44-cli instead)
  • ❌ 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 (use base44-cli)

Skill Dependencies:

  • base44-sdk assumes a Base44 project is already initialized
  • base44-cli is a prerequisite for base44-sdk in new projects
  • If user wants to "create an app" and no Base44 project exists, use base44-cli first

State Check Logic:

Before selecting this skill, verify:

  • IF (user mentions "create/build app" OR "make a project"):
  • IF (directory is empty OR no base44/config.jsonc exists):

→ Use base44-cli (project initialization needed)

  • ELSE:

→ Use base44-sdk (project exists, build features)

Quick Start

// 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");

⚠️ 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

| ❌ 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() |

Functions - WRONG vs CORRECT

| ❌ 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) |

Integrations - WRONG vs CORRECT

| ❌ 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}) |

Entities - WRONG vs CORRECT

| ❌ 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) |

SDK Modules

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

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

Installation

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.

Creating a Client (External Apps)

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 token
  • options (object) - Configuration options
  • options.onError (function) - Global error handler

Example with error handler:

const base44 = createClient({
  appId: "your-app-id",
  options: {
    onError: (error) => {
      console.error("Base44 error:", error);
    }
  }
});

Module Selection

Working with app data?

  • Create/read/update/delete records → entities
  • Import data from file → entities.importEntities()
  • Realtime updates → entities.EntityName.subscribe()

User management?

  • Login/register/logout → auth
  • Get current user → auth.me()
  • Update user profile → auth.updateMe()
  • Invite users → users.inviteUser()

AI features?

  • 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()

Custom backend logic?

  • Run server-side code → functions.invoke()
  • Need admin access → base44.asServiceRole.functions.invoke()

External services?

  • 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)

Tracking and analytics?

  • Track custom events → analytics.track()
  • Log page views/activity → appLogs.logUserInApp()

Common Patterns

Filter and Sort Data

const pendingTasks = await base44.entities.Task.filter(
  { status: "pending", assignedTo: userId },  // query
  "-created_date",                             // sort (descending)
  10,                                          // limit
  0                                            // skip
);

Protected Routes (check auth)

const user = await base44.auth.me();
if (!user) {
  // Navigate to your custom login page
  navigate('/login', { state: { returnTo: window.location.pathname } });
  return;
}

Backend Function Call

// 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 });
});

Service Role Access

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");

Frontend vs Backend

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

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take openai/base44-sdk from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm, npx. Without those the skill loads but fails at the first command.