Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b311a8a
docs: fix TypeScript table count return type
clockwork-labs-bot Sep 13, 2026
b952449
Merge remote-tracking branch 'origin/master' into bot/docs-audit
clockwork-labs-bot Sep 14, 2026
80116c7
docs: clarify environment value preservation
clockwork-labs-bot Sep 14, 2026
dc5eb44
docs: fix C# auth reducer snippet
clockwork-labs-bot Sep 15, 2026
1fc5422
Merge remote-tracking branch 'origin/master' into bot/docs-audit
clockwork-labs-bot Sep 16, 2026
7dbd695
docs: clarify procedure HTTP decompression
clockwork-labs-bot Sep 16, 2026
07fe0ac
docs: fix TypeScript procedure argument type
clockwork-labs-bot Sep 17, 2026
800d06e
Merge remote-tracking branch 'origin/master' into bot/docs-audit
clockwork-labs-bot Sep 18, 2026
49aa954
Merge remote-tracking branch 'origin/master' into bot/docs-audit
clockwork-labs-bot Oct 13, 2026
399fb6f
docs: align reconnect agent skills
clockwork-labs-bot Oct 13, 2026
38ae7d8
Merge remote-tracking branch 'origin/master' into bot/docs-audit
clockwork-labs-bot Oct 14, 2026
04e088c
docs: sync reconnect fixes to Codex plugin skills
clockwork-labs-bot Oct 14, 2026
64adc56
Merge branch 'master' into bot/docs-audit
clockwork-labs-bot Nov 17, 2026
9411904
docs: cover API and tooling changes from audit catch-up
clockwork-labs-bot Nov 17, 2026
ebec967
docs: clarify receiver dependency local-source lookup
clockwork-labs-bot Nov 17, 2026
c1fc3cf
Merge current master into bot/docs-audit for November 18 audit
clockwork-labs-bot Nov 18, 2026
9003aa4
docs: clarify CLI login and PostHog integration guidance
clockwork-labs-bot Nov 18, 2026
914c545
Merge current master before continuing docs audit
clockwork-labs-bot Nov 18, 2026
67becd6
docs: complete catch-up audit for storage, modules and SDKs
clockwork-labs-bot Nov 18, 2026
5f3a9d0
docs: resolve migration guidance conflict with master
clockwork-labs-bot Nov 19, 2026
0601a44
docs: preserve compatibility note away from merge insertion
clockwork-labs-bot Nov 19, 2026
2f4d4a6
Merge master into bot/docs-audit for November 19 documentation audit
clockwork-labs-bot Nov 19, 2026
c1970ff
docs: consolidate storage policies and clarify Rust shutdown
clockwork-labs-bot Nov 19, 2026
6369937
Merge origin/master into bot/docs-audit for 2026-11-20 audit
clockwork-labs-bot Nov 20, 2026
8f227fd
Merge origin/master into bot/docs-audit for 2026-11-21 audit
clockwork-labs-bot Nov 21, 2026
6f36680
docs: add shared outbound HTTP timeout guidance
clockwork-labs-bot Nov 21, 2026
72bceee
Merge current master into bot/docs-audit for November 23 docs audit
clockwork-labs-bot Nov 23, 2026
fd1680a
docs: explain startup version checks and CPU-budget logs
clockwork-labs-bot Nov 23, 2026
4c9752a
Merge current master into bot/docs-audit for 2026-11-24 audit
clockwork-labs-bot Nov 24, 2026
993f119
docs: cover Stripe integration and recovery memory budgets
clockwork-labs-bot Nov 24, 2026
07253e5
Merge origin/master into bot/docs-audit for November 25 docs audit
clockwork-labs-bot Nov 25, 2026
62ce713
docs: clarify testing platforms, runtime limits and connection paths
clockwork-labs-bot Nov 25, 2026
6ead98a
docs: reconcile IDC language tabs before master merge
clockwork-labs-bot Nov 26, 2026
f2374c5
Merge master before November 26 documentation audit
clockwork-labs-bot Nov 26, 2026
a694122
docs: cover C# IDC, unique index accessors and SDK licenses
clockwork-labs-bot Nov 26, 2026
43f0a07
Merge current master into bot/docs-audit for November 27 audit
clockwork-labs-bot Nov 27, 2026
cb1d556
docs: explain TypeScript submodule view accessor names
clockwork-labs-bot Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ Full documentation is available at **[spacetimedb.com/docs](https://spacetimedb.

SpacetimeDB is licensed under the [Business Source License 1.1 (BSL)](LICENSE.txt). It converts to the AGPL v3.0 with a linking exception after a few years. The linking exception means you are **not** required to open-source your own code if you use SpacetimeDB. You only need to contribute back changes to SpacetimeDB itself.

The [Rust client SDK](sdks/rust/LICENSE) and the [TypeScript client SDK and module library](crates/bindings-typescript/LICENSE.txt) are licensed under [Apache 2.0](licenses/apache2.txt), rather than the server's BSL. Check each component's license file for its terms.

**Why did we choose this license?**
We chose to license SpacetimeDB under the MariaDB Business Source License for 4 years because we can't compete with AWS while also building our products for them.

Expand Down
14 changes: 12 additions & 2 deletions codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ For TypeScript client bindings, `spacetime generate --lang typescript --import-e

### Client and Module Bindings

`spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **sending database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode.
`spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **sending database module** to call reducers in another **receiving database** through asynchronous IDC. Rust, TypeScript, and C# module bindings are supported; C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode.

In `spacetime.json`, each sending database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. A direct receiving module source takes precedence. Dependencies do not themselves publish receiving databases or inherit the sending module's build settings. `generate <sending-database>` processes both its regular `generate` entries (client bindings by default) and `dependencies` (module bindings automatically); no `--bindings` flag or second `generate` entry is needed for a dependency. For dependencies, module binding language defaults to the sending module's language and Rust/TypeScript output defaults to `<sending module-path>/src/remote_bindings`. Explicit config `out-dir` is config-relative. A regular `generate` entry can select `"bindings": "module"`, but does not use dependency language or output defaults. The CLI `--bindings` override is allowed only when a single generation entry is selected.

C# dependency output defaults to `<sending module-path>/remote_bindings/<dependency name>`, with namespace `RemoteBindings.<PascalCase dependency name>`. Set `namespace` on that dependency to override it. Direct `--bindings module --lang csharp` generation without a dependency name defaults to `RemoteBindings`; client bindings still default to `SpacetimeDB.Types`. `--namespace` overrides the C# namespace. In a module-bindings namespace, later segments cannot be `System`, `SpacetimeDB`, or the first segment: for example, `RemoteBindings.System` is rejected.

`dev` generates only root dependencies before building the sending module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples.

### C# Build Modes
Expand All @@ -75,12 +77,16 @@ Use `spacetime init --lang csharp --dotnet-version 10 my-project` to select

Do not make the project permanently WASM-only to fix a managed build: keep LLVM
package references and WASM settings conditional on the RID. Let dotnet restore
when changing build modes. Managed builds alone do not enable C# module unit tests.
when changing build modes. Managed builds alone do not enable C# module unit tests:
use a separate .NET 10 test project with the matching `SpacetimeDB.Testing`
package and a supported native platform, as described in the C# server skill.

.NET 8 retains WASM/JIT by default and requires `--native-aot` to select NativeAOT
where supported. The CLI manages `SPACETIMEDB_WASM_AOT` and its legacy alias
`EXPERIMENTAL_WASM_AOT`; users do not need to set either for .NET 10.

New databases receive a server-allocated identity; a supplied identity can update an existing database, not create one. Only the registered name owner can recreate a deleted database whose name remains registered.

### Publishing & Deployment

```bash
Expand Down Expand Up @@ -180,6 +186,10 @@ spacetime server clear

### Authentication

Log in with `spacetime login` before publishing, including to local servers. Without a saved login, the browser-login prompt defaults to yes; declining it shows a server-issued identity warning and a second prompt that defaults to no. A server-issued identity works only on its issuing server, owns databases published with it, and cannot be recovered if its token is lost. A later `spacetime login` replaces that saved token.

`--yes` / `--yes=skip-login` and closed stdin can still create a server-issued identity for compatibility; they do not authenticate you with spacetimedb.com. Do not use them to bypass login setup for unattended publishing. Alert the user before intentionally creating a server-issued identity.

```bash
# Login (opens browser)
spacetime login
Expand Down
25 changes: 22 additions & 3 deletions codex-plugin/plugins/spacetimedb/skills/concepts/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ This describes Spacetime 2.x. The API changed substantially from 1.x, so older a
- **Access control.** Tables are private by default. Views expose exactly the rows and columns each client should see, including per-caller views filtered by the caller's identity. ([Access permissions](https://spacetimedb.com/docs/tables/access-permissions/))
- **Auth.** Spacetime works with any OIDC provider, such as Auth0, Clerk, Better Auth, or Firebase Auth. SpacetimeAuth is a first-party provider with magic links, social logins, and user and role management. ([Authentication](https://spacetimedb.com/docs/core-concepts/authentication/))
- **Scheduled work.** Schedule tables run reducers or procedures at a specific time or on a repeating interval. In TypeScript, the Cron module adds calendar schedules with time zones. ([Schedule tables](https://spacetimedb.com/docs/tables/schedule-tables/), [Cron module](https://spacetimedb.com/modules/cron))
- **Payments.** The TypeScript Stripe module supplies Checkout, billing portal, subscription, and signed-webhook helpers. The host application authenticates users and controls ownership and prices. Fulfill purchases from verified webhook payment state, not the browser redirect. ([Stripe module](https://github.com/clockworklabs/SpacetimeDB/tree/master/modules/spacetime-stripe-ts))
- **Ephemeral events.** Event tables broadcast rows to subscribers without storing them, for things like typing indicators. ([Event tables](https://spacetimedb.com/docs/tables/event-tables/))
- **Files.** Files can be stored as bytes in table columns, or a procedure can store large files in S3 or a similar service and keep a reference in a table. In TypeScript, the Files module handles uploads, listing and download routes. ([File storage](https://spacetimedb.com/docs/tables/file-storage/), [Files module](https://github.com/clockworklabs/SpacetimeDB/tree/master/modules/spacetime-files-ts))
- **Files.** Files can be stored as bytes in table columns, or a procedure can store large files in S3 or a similar service and keep a reference in a table. In TypeScript, the Files module handles database-backed uploads, listing and download routes; the S3 module keeps bytes in a private bucket and tracks ownership and upload state in the database. ([File storage](https://spacetimedb.com/docs/tables/file-storage/), [Files module](https://github.com/clockworklabs/SpacetimeDB/tree/master/modules/spacetime-files-ts), [S3 module](https://github.com/clockworklabs/SpacetimeDB/tree/master/modules/spacetime-s3-ts))
- **SQL and tools.** Spacetime speaks the PostgreSQL wire protocol, so PostgreSQL drivers, `psql`, and GUI clients can connect. ([PostgreSQL wire protocol](https://spacetimedb.com/docs/how-to/pg-wire/))
- **Dashboard.** On Maincloud, each database's dashboard on spacetimedb.com lets you browse, filter, edit, delete, and export table rows, call reducers, and view logs and metrics. ([Maincloud dashboard](https://spacetimedb.com/docs/how-to/deploy/maincloud/#viewing-your-database-on-the-web-dashboard))
- **Schema changes.** Compatible changes, such as adding tables or columns with defaults, migrate automatically when you republish, and incremental migrations handle the rest. ([Automatic migrations](https://spacetimedb.com/docs/databases/automatic-migrations/))
Expand Down Expand Up @@ -79,6 +80,10 @@ For questions about older articles, benchmarks, or past reviews, see [Common mis
4. Check server logs for errors (`spacetime logs <db-name>`)
5. Is the reducer actually being called from the client?

A per-call CPU-budget abort in a reducer or view produces an error-level database log containing `reached the maximum CPU usage allowed per call`, with the function name and elapsed duration, on servers containing that logging change. Check it as the database owner with `spacetime logs --level error <db-name>`; this message does not by itself mean the account balance is empty. ([Logging](https://spacetimedb.com/docs/how-to/logging/#diagnosing-cpu-budget-aborts))

For self-hosted server version changes, stop the service and back up the data directory. The updated `metadata.toml` startup check requires the same edition and, within one major version, a running minor at least as new as recorded; it ignores patch differences and minor/patch prerelease suffixes. A running `X.0.0-*` major prerelease requires an identical recorded version, except that the 1.x-data-to-2.x-server exception is checked first. The restriction is on the running version, not on a previously recorded major prerelease. The recorded version never decreases. Do not edit generated metadata to bypass the check or treat passing it as a blanket rollback guarantee. ([Version compatibility](https://spacetimedb.com/docs/how-to/deploy/self-hosting/#data-directory-version-compatibility))

---

## Tables
Expand Down Expand Up @@ -134,6 +139,10 @@ Server-side modules can be written in: Rust, C#, TypeScript, C++

Lifecycle: Write → Compile → Publish (`spacetime publish`) → Hot-swap (republish without disconnecting clients)

Scheduled functions are private, but the database owner can still call them directly. To restrict a callback to scheduler execution, compare the sender with the database identity; see the server skills for language-specific syntax.

Outbound HTTP requests from procedures default to a 30-second timeout when none is specified; the host clamps requested timeouts to a maximum of 180 seconds. See [procedure HTTP requests](https://spacetimedb.com/docs/functions/procedures#http-requests) and the language-specific server skills for request syntax.

## HTTP Handlers

A module can expose its own HTTP API. Each handler takes a request and returns a response, and one router per module binds handlers to a method and path. Requests reach them under `/v1/database/<name_or_identity>/route<path>`, so a `/say-hello` route is served at `/v1/database/my-db/route/say-hello`.
Expand All @@ -144,6 +153,12 @@ A module can expose its own HTTP API. Each handler takes a request and returns a

Use HTTP handlers for webhooks and for clients that can't use a SpacetimeDB SDK. See the language-specific server skills for syntax.

## Table Storage Policies

Tables default to keeping pages and blobs resident in memory. A cache policy can permit eviction to local disk (`required_on_disk`) or any configured tier (`no_requirement`), including remote object storage. It does not configure a backend or force eviction; actual eviction depends on server tiers and memory budgets. Any indexes on tables with non-default policies must be B-trees. The standalone server currently uses an unlimited resident-memory budget. Change a policy by republishing without deleting data; moving back to the in-memory policy requires enough memory to load and retain the table. See https://spacetimedb.com/docs/tables/storage-and-cache-policies and the language-specific table options.

Recovery temporarily suspends the storage engine's resident-memory hard limit, then re-enables it and attempts eviction before serving transactions. Required-in-memory data can leave usage above budget, so later operations can still fail for lack of memory. This does not bypass process or physical memory limits. See [storage recovery](https://spacetimedb.com/docs/tables/storage-and-cache-policies/#residency-durability-and-performance).

## Reusable Modules and Configuration

TypeScript and C# support same-language submodule composition. A namespace has a language accessor and a canonical database name; SQL, CLI calls, and HTTP calls use the canonical name. Changing the canonical namespace drops its tables and their data, so pin it when renaming an accessor. TypeScript supports nested submodules; C# composition requires 2.13+ with .NET 10/C# 14, and nested or repeated C# mounts require 2.14+. See the respective server skills for registration and helper-context rules.
Expand All @@ -154,13 +169,17 @@ Database environment values are read-only strings, including secrets, supplied a

Views can accept arguments in 2.13+ (Rust, TypeScript, C#), queried as `SELECT * FROM view_name(42)`. Use explicit queries instead of subscribe-all on that connection; subscribe-all skips these views. See server skills for definition restrictions and client skills for query/cache rules.

Rust and TypeScript provide in-memory module unit-test harnesses in 2.12+: run native `cargo test` or Vitest with the module-test plugin. These use the real datastore but do not simulate clients, subscriptions, RLS enforcement, lifecycle events, or timer execution. Test those host behaviors against a running database.
Rust and TypeScript provide in-memory module unit-test harnesses in 2.12+: run native `cargo test` or Vitest with the module-test plugin. C# also provides a managed .NET 10 harness via the separate `SpacetimeDB.Testing` package; see the C# server skill for platform and package requirements. These use the real datastore but do not simulate clients, subscriptions, RLS enforcement, lifecycle events, or timer execution. Test those host behaviors against a running database.

## Inter-Database Communication

Reducers can't make network requests, but a reducer can call a reducer in another database on the same server through an **outbox table** (async IDC). The reducer inserts a row, and after its transaction commits, the row is delivered as a reducer call to the target database exactly once, in order with other calls through the same outbox to the same database. The sending reducer doesn't wait, and the two databases don't commit together: the receiving reducer runs later in its own transaction and can fail. An optional `on_result` reducer in the sending database receives the result, so it can undo or record the work.

Use it to split an application into databases that scale and deploy independently, such as a lobby that sends players to separate game world databases. Only Rust and TypeScript modules can declare outbox tables. See the language-specific server skills for syntax.
Deliveries can be pipelined. Receiving calls and `on_result` callbacks each retain stream order, but a later receiving call need not wait for an earlier callback in the sending database. Do not use callbacks as barriers for subsequent receiving calls.

Outbox rows are insert-only for module code. The host removes them after delivery and the optional result callback; do not update or delete pending rows yourself.

Use it to split an application into databases that scale and deploy independently, such as a lobby that sends players to separate game world databases. Rust, TypeScript, and C# modules can declare outbox tables. See the language-specific server skills for syntax.

## Identity

Expand Down
Loading
Loading