Carpo SDK documentation
Build with Carpo Auth, Database, Functions, Realtime, and Storage.
The Carpo SDK connects your application to project services through focused TypeScript clients. Use the React integration for browser sessions and cached data, or the server SDK for request scoped access and trusted backend work.
Install and connect
Install the package and connect your first project.
React SDK
Use Auth, Database, Realtime, Functions, and Storage in a React app.
Server SDK
Choose between a request scoped client and trusted server services.
Project access
Enable environment access and define service policies.
Choose a client
| Client | Use it for | Credentials |
|---|---|---|
| React client | Browser sessions, policy checked Database and Storage requests, and React Query hooks | Project Auth session or user token |
| Server request client | Server work that must act as the incoming user | Forwarded session cookie, bearer token, API key, and origin |
| Trusted server client | Direct libSQL access and privileged Storage operations | Database access token and project Storage API key |
Each client talks to the Carpo API for Auth, Functions, Database Data API, Realtime, and Storage. The trusted Database client is the exception: it connects to the managed database through the official libSQL driver.
Services in the SDK
Auth
A Better Auth client configured for Carpo Project Auth.
Database
Typed table reads and writes with environment specific permissions.
Realtime
Receive authorized table invalidations and re-read through the Data API.
Functions
Invoke deployed project Functions with Fetch request and response types.
Storage
List objects, stream downloads, upload files, and recover retained versions.
Start here
- Install the SDK and the peer packages used by your app.
- Configure your project in Carpo for the environment you will call.
- Follow the React setup or server setup for the execution surface that fits your code.
The SDK uses production by default. Set environment: 'development' when you want requests scoped to the Development Project Auth and data configuration.