Skip to main content
Documentation

SDK reference

Every export from the deepspace package, with signatures and examples.

On this page

The deepspace package exposes three entry points. Each section of this reference documents the surface of one entry point, organized by feature.

import { ... } from 'deepspace'          // React client SDK
import { ... } from 'deepspace/worker'   // Cloudflare Worker runtime
import { ... } from 'deepspace/testing'  // Playwright fixture (test files only)

Client - deepspace#

Everything you import on the frontend - providers, hooks, components, and utility functions.

SectionCovers
AuthuseAuth, useUser, AuthGate, AuthOverlay, signIn, signOut, getAuthToken
RecordsuseQuery, useMutations, RecordProvider, RecordScope, useUsers, useUserLookup
MessaginguseChannels, useMessages, useReactions, useChannelMembers, useReadReceipts, useConversation
Real-timeusePresence, usePresenceRoom, useYjsText, useYjsField, useCanvas, useGameRoom, useCronMonitor, useJobs
FilesuseR2Files, formatFileSize, isImageFile
Integrationsintegration.post, OAuth helpers, platform-context exports
PaymentsuseSubscription, useCheckout, PricingTable, server helpers
ThemingDeepSpaceThemeProvider, applyDeepSpaceTheme, getUserColor

Worker - deepspace/worker#

Everything you import inside your Cloudflare Worker - DO base classes, schemas, auth verification, AI helpers.

SectionCovers
RoomsRecordRoom, YjsRoom, CanvasRoom, PresenceRoom, CronRoom, GameRoom, JobRoom, enqueueJob, DOManifest
SchemasCollectionSchema, RBAC types, drop-in collections, role constants
Server actionsActionHandler, ActionContext, ActionTools, ActionResult
AIcreateDeepSpaceAI, context compaction, chat history, built-in tools
CronCronTask, CronExecution, buildCronContext
AuthverifyJwt, createDeepSpaceAuth, HMAC primitives
BindingsrunMigrations, meterAi, meterVectorize, meterUsage, manifest types
Proxy helpersapiWorkerFetch, platformWorkerFetch, authWorkerFetch

Testing - deepspace/testing#

Multi-user Playwright fixture and 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:

ModuleLocation
deepspacenode_modules/deepspace/dist/index.d.ts
deepspace/workernode_modules/deepspace/dist/worker.d.ts
deepspace/testingnode_modules/deepspace/dist/testing.d.ts

If a hook or type isn't documented in this reference, it probably exists in the .d.ts. Read the declaration before guessing.