CarpoSDK docs

React SDK

Use Carpo services from a React application.

The React SDK combines the Carpo browser clients with a provider and TanStack Query hooks. Authentication and service requests use the Project Auth session by default. Database and Storage requests still pass through the Carpo API, where environment permissions and policies are checked.

A typical setup

  1. Create one CarpoClient for a project, database, and environment.
  2. Place QueryClientProvider above CarpoProvider in your component tree.
  3. Use the native Better Auth client for sign in and session state.
  4. Use SDK hooks for cached Database and Storage reads, mutations, and realtime invalidation.

Modules

ModuleWhat it provides
authBetter Auth React client with Carpo Project Auth plugins
databaseTyped table reads and writes through the policy checked Data API
realtimeAuthorized table change invalidations over one WebSocket per client
functionsFetch compatible calls to deployed Functions
storagePolicy checked object operations and signed R2 transfers
reactCarpoProvider, context hooks, and TanStack Query hooks

Guides

Choose a server client for trusted backend work or to retain an incoming user's identity during server requests.

On this page