createClient(Creates a Base44 client. This is the main entry point for the Base44 SDK. It creates a client that provides access to the SDK’s modules, such asconfig):Base44Client
entities, auth, and functions.
How you get a client depends on your context:
- Inside a Base44 app: The client is automatically created and configured for you. Import it from
@/api/base44Client. - External app using Base44 as a backend: Call
createClient()directly in your code to create and configure the client.
- Anonymous: Access modules without authentication using
base44.moduleName. Operations are scoped to public data and permissions. - User authentication: Access modules with user-level permissions using
base44.moduleName. Operations are scoped to the authenticated user’s data and permissions. Usebase44.auth.loginViaEmailPassword()or other auth methods to get a token. - Service role authentication: Access modules with elevated permissions using
base44.asServiceRole.moduleName. Operations bypass entity access rules and field-level security, giving full read and write access to all of the app’s data. Only available in Base44-hosted backend functions. Create a client with service role authentication usingcreateClientFromRequest().
entities module:
- Anonymous: Can only read public data.
- User authentication: Can access the current user’s data.
- Service role authentication: Can read and write any record, bypassing access rules.
Parameters
Properties
Properties
The Base44 server URL.You don’t need to set this for production use. The SDK defaults to
https://base44.app.Set this when using a local development server to point SDK requests at your local machine instead of the hosted backend.The Base44 app ID.You can find the
appId in the browser URL when you’re in the app editor.
It’s the string between /apps/ and /editor/.Controls app analytics for this client.Omit this option to preserve the default analytics behavior.
User authentication token. Used to authenticate as a specific user.Inside Base44 apps, the token is managed automatically. For external apps, use auth methods like loginViaEmailPassword() which set the token automatically.
Additional client options.
Properties
Properties
Optional error handler that the SDK calls when:
- An API request fails.
- A client can’t connect to an actor.
error.status for the HTTP status code. Returns undefined for network errors.Returns
Base44Client
A configured Base44 client instance with access to all SDK modules.
Properties
Properties
Agents module for managing AI agent conversations.
AI Gateway module for connecting to the Base44 AI Gateway with your own SDK.
Analytics module for tracking custom events in your app.
App logs module for tracking app usage.
App module for reading the app’s own public configuration.
Actors module for connecting to actor sessions and exchanging messages with actors.
Auth module for user authentication and management.
Connectors module for app-user OAuth flows.
Entities module for CRUD operations on your data models.
Functions module for invoking custom backend functions.
Integrations module for calling pre-built integration endpoints.
Payments module for checkouts and purchases.
Cleanup function to disconnect WebSocket connections. Call when you’re done with the client.
Provides access to supported modules with elevated permissions.Service role authentication provides elevated permissions for backend operations. Unlike user authentication, which is scoped to a specific user’s permissions, service role authentication bypasses entity access rules and field-level security entirely, giving full read and write access to all of the app’s data.
Properties
Properties
Actors module for calling methods on actor sessions as the app’s server code.
Agents module with elevated permissions.
AI Gateway module with the service-role token.
App logs module with elevated permissions.
Browser module for remote browser sessions.
Connectors module for OAuth token retrieval.
Entities module with elevated permissions.
Functions module with elevated permissions.
Integrations module with elevated permissions.
Payments module for creating checkouts, refunds, and subscription changes.
SSO module for generating SSO tokens.