# SDK overview

> The browser SDK every app ships with, and how to import it.


Every app includes `lib/draftship.ts`, a dependency-free client for its backend.

```ts
"use client";
import { ds } from "@/lib/draftship";
```

| Module | What it does |
|---|---|
| `ds.entities.<Name>` | Create, read, update, delete and subscribe to records. |
| `ds.auth` | Sign up, sign in, current user, profile, sign out. |
| `ds.functions` | Call your backend functions. |
| `ds.agents` | Chat with in-app AI agents. |
| `ds.integrations.Core` | AI, images, uploads and email. |
| `ds.analytics` | Track custom events. |

Rules of thumb:

- Use it in **client components** only, typically inside `useEffect` or event handlers.
- Every call is async and throws `DraftshipError` (with `.status` and a readable `.message`) on failure.
- Inside the app it talks to `/_ds/...` on the same origin. Exported apps use `NEXT_PUBLIC_DRAFTSHIP_API`, set automatically when exporting.

For server code use the [server SDK](/docs/developers/backend/functions).
