deepspace package exposes three entry points. Each section of this reference documents the surface of one entry point, organized by feature.
Client - deepspace
Everything you import on the frontend - providers, hooks, components, and utility functions.
| Section | Covers |
|---|---|
| Auth | useAuth, useUser, AuthGate, AuthOverlay, signIn, signOut, getAuthToken |
| Records | useQuery, useMutations, RecordProvider, RecordScope, useUsers, useUserLookup |
| Messaging | useChannels, useMessages, useReactions, useChannelMembers, useReadReceipts, useConversation |
| Real-time | usePresence, usePresenceRoom, useYjsText, useYjsField, useCanvas, useGameRoom, useCronMonitor, useJobs |
| Files | useR2Files, formatFileSize, isImageFile |
| Integrations | integration.post, OAuth helpers, platform-context exports |
| Payments | useSubscription, useCheckout, PricingTable, server helpers |
| Theming | DeepSpaceThemeProvider, applyDeepSpaceTheme, getUserColor |
Worker - deepspace/worker
Everything you import inside your Cloudflare Worker - DO base classes, schemas, auth verification, AI helpers.
| Section | Covers |
|---|---|
| Rooms | RecordRoom, YjsRoom, CanvasRoom, PresenceRoom, CronRoom, GameRoom, JobRoom, enqueueJob, DOManifest |
| Schemas | CollectionSchema, RBAC types, drop-in collections, role constants |
| Server actions | ActionHandler, ActionContext, ActionTools, ActionResult |
| AI | createDeepSpaceAI, context compaction, chat history, built-in tools |
| Cron | CronTask, CronExecution, buildCronContext |
| Auth | verifyJwt, createDeepSpaceAuth, HMAC primitives |
| Bindings | runMigrations, meterAi, meterVectorize, meterUsage, manifest types |
| Proxy helpers | apiWorkerFetch, platformWorkerFetch, authWorkerFetch |
Testing - deepspace/testing
Multi-user Playwright fixture and account helpers.
- Testing reference -
test,expect,users(N),MultiplayerUser, account helpers.
TypeScript signatures
This reference shows the most common signatures and shapes. For exact type definitions - including generic constraints, optional fields, and discriminated unions - read the bundled.d.ts files:
| Module | Location |
|---|---|
deepspace | node_modules/deepspace/dist/index.d.ts |
deepspace/worker | node_modules/deepspace/dist/worker.d.ts |
deepspace/testing | node_modules/deepspace/dist/testing.d.ts |
.d.ts. Read the declaration before guessing.