CarpoSDK docs
Reference

Entry points

Import only the Carpo SDK modules your application uses.

The package provides focused export paths so browser code can avoid server dependencies and service only apps do not need to load React.

ImportMain exportsUse it for
@carpodev/carpo-sdkcreateCarpoClient, service clients, shared types, CarpoApiErrorCombined browser client
@carpodev/carpo-sdk/authcreateCarpoAuthClientStandalone Better Auth React client
@carpodev/carpo-sdk/databasecreateCarpoDatabaseClient, Database types, CarpoApiErrorPolicy checked Database Data API
@carpodev/carpo-sdk/functionscreateCarpoFunctionsClientDeployed Function invocation
@carpodev/carpo-sdk/realtimecreateCarpoRealtimeClient, Realtime typesDatabase change subscriptions
@carpodev/carpo-sdk/storagecreateCarpoStorageClient, Storage types and errorsPolicy checked bucket operations
@carpodev/carpo-sdk/reactCarpoProvider, React hooksReact context and TanStack Query
@carpodev/carpo-sdk/servercreateCarpoServerClient, server service factoriesCombined server client
@carpodev/carpo-sdk/server/authcreateCarpoServerAuthClientBetter Auth server client
@carpodev/carpo-sdk/server/databasecreateCarpoServerDatabaseClientNative @libsql/client connection
@carpodev/carpo-sdk/server/storagecreateCarpoServerStorageClientServer key Storage client and usage
@carpodev/carpo-sdk/server/requestcreateCarpoServerRequestClientRequest scoped Auth, Data API, Storage, and Functions

The package root does not export React hooks. Import those from /react. The server Database driver is available only from /server or /server/database; browser entry points do not connect directly to Turso.

Client factories

FactoryRequired configurationReturned services
createCarpoClient()apiUrl, projectId, databaseIdAuth, Database, Functions, optional Storage
createCarpoAuthClient()apiUrl, projectIdBetter Auth React client
createCarpoDatabaseClient()apiUrl, projectId, databaseIdDatabase Data API and Realtime
createCarpoFunctionsClient()apiUrl, projectIdFunctions
createCarpoRealtimeClient()apiUrl, projectId, databaseIdDatabase Realtime subscriptions
createCarpoStorageClient()apiUrl, projectId, bucketIdStorage API
createCarpoServerClient()apiUrl, projectIdAuth and Functions, optional Database and Storage
createCarpoServerRequestClient()request, apiUrl, projectIdAuth and Functions, optional policy checked Database and Storage

All clients that accept an environment use production or development. The default is production.

On this page