Vai al contenuto principale
The Base44 client is your interface to the Base44 SDK. It provides access to all SDK modules and automatically manages authentication tokens. You can use the client in two ways:
  • Inside Base44 apps: The client is automatically created and configured for you.
  • External apps: Create the client yourself to use Base44 as a backend for your own app.

Inside Base44 apps

When Base44 generates your app, the SDK client is pre-configured and ready to use.

Frontend client

In your frontend code, the client is already imported and available as base44.

Backend functions

In Base44-hosted backend functions, create the client from the incoming request. Base44 injects the necessary authentication headers automatically.

External apps

When building your own app that uses Base44 as a backend, create and configure the client yourself using createClient().

Installation

Install the SDK via npm:

Create the client

Create a client by providing your app ID, which you can find in the Base44 editor URL:

User authentication

Authenticate users with email and password or through social providers. The client automatically applies the token to subsequent requests. Social authentication is available for Google, Microsoft, Facebook, and Apple using loginWithProvider().

Service role

By default, the client operates with user-level permissions, limiting access to what the current user can see and do. The service role provides elevated permissions for backend operations and is only available in Base44-hosted backend functions.
Service role authentication is only available in Base44-hosted backend functions. External backends can’t use service role permissions.
A client with service role authentication allows backend code to:
  • Read and write any data in the app. Entity access rules and field-level security are bypassed entirely.
  • Use admin modules like the connectors module.
To use service role authentication, access modules through base44.asServiceRole instead of directly on the client. For example, base44.asServiceRole.entities.Task.list() bypasses access rules, while base44.entities.Task.list() uses the current user’s permissions. When using createClientFromRequest() in a backend function, the service role is automatically available:
Service role access skips every access rule on the entity. Use it only for trusted backend logic. If your function needs access checks, you’re responsible for enforcing them yourself.

See more

createClient()

Complete API reference

createClientFromRequest()

Backend client creation