Installation
Install the Carpo TypeScript SDK and the peer packages for your entry points.
The SDK package is installed from its Git repository and is not published to npm. Install it in the application that will use Carpo.
npm install git+https://github.com/carpodev/carpo-sdk.gitThe SDK declares its integrations as optional peer dependencies. Add the packages required by your selected SDK surface.
React applications
For the combined client and React hooks, install Better Auth, Carpo's Better Auth plugins, React, and TanStack Query:
npm install better-auth @better-auth/api-key @better-auth/passkey react @tanstack/react-queryReact hooks require React 18 or later and TanStack Query 5. The Auth client uses Better Auth 1.7 or later, with the API key and passkey plugins from the same 1.x line.
Server applications
The server entry uses Better Auth's framework agnostic client. Install Better Auth and the Carpo plugins:
npm install better-auth @better-auth/api-key @better-auth/passkeyIf you will connect to a managed database with the native libSQL client, install its driver too:
npm install @libsql/clientThe Server Database entry requires @libsql/client 0.18 or later. You do not need React or TanStack Query for the server entry.
Install only what you use
The service entry points keep unrelated integrations out of your import graph. @libsql/client is only needed for direct server Database access. React and TanStack Query are only needed for the React hooks and provider. Auth requires the Better Auth package and the API key and passkey client plugins used by the SDK.
| Entry point | Required peer packages |
|---|---|
@carpodev/carpo-sdk and @carpodev/carpo-sdk/react | better-auth, @better-auth/api-key, @better-auth/passkey, react, @tanstack/react-query |
@carpodev/carpo-sdk/auth | better-auth, @better-auth/api-key, @better-auth/passkey, react |
@carpodev/carpo-sdk/server | better-auth, @better-auth/api-key, @better-auth/passkey |
@carpodev/carpo-sdk/server/database | @libsql/client |
The standalone database, functions, realtime, storage, and server/storage entry points do not require a React import. See Entry points for the module map.
Verify the package
import { createCarpoClient } from '@carpodev/carpo-sdk'
import { createCarpoServerClient } from '@carpodev/carpo-sdk/server'Both imports should resolve in their respective browser or server build. Keep server-only modules in server code, and do not import server credentials into a browser bundle.