Skip to main content

createClientFromRequest(request): Base44Client
Creates a Base44 client from an HTTP request. This function is designed for use in Base44-hosted backend functions. For frontends and external backends, use createClient() instead. When used in a Base44-hosted backend function, createClientFromRequest() automatically extracts authentication tokens from the request headers that Base44 injects when forwarding requests. The returned client includes service role access using base44.asServiceRole, which bypasses entity access rules and field-level security. To learn more about the Base44 client, see createClient().

Parameters

Request
obrigatório
The incoming HTTP request object containing Base44 authentication headers.

Returns

Base44Client The Base44 client instance. Provides access to all SDK modules for interacting with the app. A configured Base44 client instance with authentication from the incoming request.
AgentsModule
obrigatório
Agents module for managing AI agent conversations.
AiGatewayModule
obrigatório
AI Gateway module for connecting to the Base44 AI Gateway with your own SDK.
AnalyticsModule
obrigatório
Analytics module for tracking custom events in your app.
AppLogsModule
obrigatório
App logs module for tracking app usage.
AuthModule
obrigatório
Auth module for user authentication and management.
UserConnectorsModule
obrigatório
Connectors module for app-user OAuth flows.
EntitiesModule
obrigatório
Entities module for CRUD operations on your data models.
FunctionsModule
obrigatório
Functions module for invoking custom backend functions.
IntegrationsModule
obrigatório
Integrations module for calling pre-built integration endpoints.
() => void
obrigatório
Cleanup function to disconnect WebSocket connections. Call when you’re done with the client.
object
obrigatório
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.
AgentsModule
obrigatório
Agents module with elevated permissions.
AiGatewayModule
obrigatório
AI Gateway module with the service-role token.
AppLogsModule
obrigatório
App logs module with elevated permissions.
ConnectorsModule
obrigatório
Connectors module for OAuth token retrieval.
EntitiesModule
obrigatório
Entities module with elevated permissions.
FunctionsModule
obrigatório
Functions module with elevated permissions.
IntegrationsModule
obrigatório
Integrations module with elevated permissions.
SsoModule
obrigatório
SSO module for generating SSO tokens.
() => void
obrigatório
Cleanup function to disconnect WebSocket connections.

Examples