Commit Graph

373 Commits

Author SHA1 Message Date
clockwork-labs-bot 21b5af0610 docs: Clarify HTTP endpoint auth is optional, not required (#4562)
## Summary

All `/v1/database` routes go through `anon_auth_middleware`, which
allocates a new anonymous identity when no `Authorization` header is
provided. The docs previously marked many endpoints as requiring auth
(`Required Headers`) when they actually accept anonymous requests.

## Code audit

Traced through `anon_auth_middleware` in `crates/client-api/src/auth.rs`
and each route handler in `crates/client-api/src/routes/database.rs`:

| Route | Old docs | Actual behavior | New docs |
|---|---|---|---|
| `POST /v1/database` (publish) | Required | Optional (anon creates new
DB) | Optional + explanation |
| `PUT /v1/database/:id` (publish) | Required | Optional (ownership
checked) | Optional + explanation |
| `GET /v1/database/:id` (info) | No auth section | No auth used |
Unchanged |
| `DELETE /v1/database/:id` | Required | Optional (ownership checked) |
Optional + explanation |
| `GET .../names` | No auth section | No auth used | Unchanged |
| `POST .../names` | Required | Optional (TLD ownership checked) |
Optional + explanation |
| `PUT .../names` | Required | Optional (ownership checked) | Optional +
explanation |
| `GET .../identity` | No auth section | No auth used | Unchanged |
| `GET .../subscribe` (WS) | Optional | Optional | Unchanged (already
correct) |
| `POST .../call/:reducer` | Required | Optional (identity passed to
reducer) | Optional + explanation |
| `GET .../schema` | No auth section | No permission check | Added
Optional section |
| `GET .../logs` | Required | Optional (ownership checked) | Optional +
explanation |
| `POST .../sql` | Required | Optional (RLS enforces access) | Optional
+ explanation |

Routes that genuinely require auth (`POST /v1/identity/websocket-token`,
`GET /v1/identity/:id/verify`) use `SpacetimeAuthRequired` and are
unchanged.

## Changes

- `authorization.md`: Added paragraph explaining anonymous access for
all `/v1/database` endpoints
- `database.md`: Changed `Required Headers` to `Optional Headers` for 8
endpoints, with per-endpoint explanations of anonymous behavior
- `database.md`: Added new `Optional Headers` section to `/schema`
endpoint (previously undocumented)

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-03-06 09:15:34 +00:00
clockwork-labs-bot 214932510c docs: Audit HTTP API docs against code (#4569)
Audited all registered routes in `database.rs` and `identity.rs` against
the HTTP API documentation.

## Fixes

**database.md:**
- `/v1/database/:name_or_identity` publish: `POST` → `PUT` (code has
`db_put: put(publish::<S>)`)
- `DELETE` row in summary table: anchor pointed to POST section instead
of DELETE section
- Typo: `Updgrade` → `Upgrade` in WebSocket subscribe headers

**identity.md:**
- Removed `POST /v1/identity/:identity/set-email` — documented but has
no handler registered in `IdentityRoutes` (dead documentation)

## Routes in code but intentionally not documented (internal/unstable)

- `POST /v1/database/:noi/pre_publish`
- `PUT /v1/database/:noi/reset`
- `GET /v1/database/:noi/unstable/timestamp`

These are used internally by the CLI and are not part of the public API.

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-03-06 00:47:59 +00:00
Ben Snyder 292bda8eed docs: self-hosted prod/test/dev Azure VM guide with key rotation, Azure Key Vault workflows, and rsync data migration pattern (#4545)
## Summary

This PR creates a comprehensive self-hosted JWT key rotation how-to for
SpacetimeDB with reproducible defaults, identity-preserving rotation
guidance, and host-scoped data migration runbooks. It is written for
both operators and automation workflows, with explicit guardrails for
production-like VM environments.

## Key Changes

- Adds a top-level assumptions/risk section for a multi-host topology
(`prod`, `test`, `dev`, optional `local`) including backup prerequisites
before rotation or sync.
- Defines an opinionated, end-to-end path contract for keys:
  - host source: `./.generated/spacetimedb-keys`
  - runtime mount: `/etc/spacetimedb`
- startup args pinned to `/etc/spacetimedb/id_ecdsa` and
`/etc/spacetimedb/id_ecdsa.pub`
- Includes reproducible quickstart scaffolding:
  - OpenSSL commands for compatible ES256/P-256 key generation
  - non-container and Docker startup examples
  - rotation/verify command sequence and marker checks
- Documents one unified tooling surface around `spacetimedb-tooling.ts`
for:
  - rotate (`--dry-run`, `--yes`)
  - verify (`--verify-only`)
  - token continuity (`--resign-token-only`)
- explicit token/key path overrides (`--publisher-cli-toml-path`,
`--private-key-path`)
- Clarifies 401 vs 403 behavior and why identity drift causes publish
failures after rotation.
- Covers all rotation strategies in one place:
  - clean-slate rotation (stateless/dev)
  - identity-preserving rotation (stateful)
  - OIDC-backed identity model for production
- Adds host-scoped migration runbooks for staged sync (`prod -> test ->
dev`) with destination-side token re-signing semantics (run on
destination host context, including SSH examples).
- Explicitly separates conceptual topology guidance from currently
implemented sync primitives in reference tooling to avoid over-claiming.
- Adds operational guardrails for sync promotions:
  - `rsync --delete` is destructive
  - stop/start ordering around sync
- required acceptance gates: key parity, destination re-sign,
restart/redeploy, publish marker validation
- Expands verification and automation content:
  - PEM/parity/fingerprint/newline checks
- AI/automation contract with inputs, outputs, required command order,
and success/failure markers
- troubleshooting flow for `InvalidSignature` and ownership mismatch
errors

## Why This Matters

The most common failure mode in self-hosted fleets is identity drift:
signatures validate, but `spacetime publish` still fails with `403
Forbidden` because destination ownership no longer matches the
publishing identity after key rotation or data movement.

The updated how-to makes these operator requirements explicit:

1. preserve identity continuity across rotations and host promotions
2. re-sign destination tokens after `rsync` in destination host context
3. treat restart/redeploy and publish markers as promotion gates

Following this runbook prevents regressions where key material is
correct but publish still fails due to stale signatures or owner
mismatch state.

## Why JWT Key Rotation Is Essential for Self-Hosters

In self-hosted deployments, operators are the signing authority.
Rotation is both a security control and an operational correctness
requirement.

### Security value

- reduces exposure window for compromised private keys
- invalidates old/stolen tokens after rotation
- mitigates risk from snapshots, backups, clones, and long-lived VM
access

### Operational value

- keeps key material consistent across multi-VM environments
- reduces publish outages after promotion/sync operations
- prevents avoidable `401`/`403` failures in routine release workflows

## Scope

- docs-only change
- public-safe examples only (no internal org names, private vault IDs,
or private secret prefixes)
- includes non-container and Docker workflows, self-publish/versioning
guidance, and marker-based validation (`PUBLISH_SUCCESS`,
`PUBLISH_FAILED`)
- includes data migration workflow guidance (`rsync` + destination
re-sign + restart/redeploy + publish checks)

---------

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-03-05 02:55:57 +00:00
clockwork-labs-bot cacfd73865 docs: fix TS index definition nameaccessor (#4537)
The TypeScript table index definition uses `accessor` not `name` for the
index identifier. Fixes three instances:

- `docs/docs/.../indexes.md`: two occurrences (`idx_age`,
`by_player_and_level`)
- `docs/docs/.../constraints.md`: one occurrence (`by_user_item`)

```diff
-{ name: 'by_player_and_level', algorithm: 'btree', columns: ['player_id', 'level'] }
+{ accessor: 'by_player_and_level', algorithm: 'btree', columns: ['player_id', 'level'] }
```

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-03-04 11:06:17 +00:00
clockwork-labs-bot 7470eb23d3 Add --level flag to spacetime logs for filtering by log level (#4362)
Fixes #1972

Adds client-side log level filtering to `spacetime logs`:

- `--level <LEVEL>` / `-l <LEVEL>`: Show only logs at the specified
severity or higher. Valid values: `trace`, `debug`, `info`, `warn`,
`error`, `panic`. Default: show all logs (no filtering).
- `--level-exact`: When combined with `--level`, show only logs at
exactly the specified level.

Severity order (most to least): panic > error > warn > info > debug >
trace.

Examples:
```
spacetime logs mydb --level warn                # Show only warn, error, and panic
spacetime logs mydb --level info                 # Show info and above
spacetime logs mydb --level error --level-exact  # Show only errors
```

Filtering is done client-side.

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-03-03 07:02:46 +00:00
Zeke Foppa 923dfe28c6 Fix a misprint in the self-hosting docs (#4524)
# Description of Changes

Closes https://github.com/clockworklabs/SpacetimeDB/issues/4496.

The docs refer to a block mentioning `/v1/publish` but we don't have
such a block in our example config. What we actually have is:
```
    # Block all other routes explicitly. Only localhost can use these routes. If you want to open your
    # server up so that anyone can publish to it you should comment this section out.
    location / {
        allow 127.0.0.1;
        deny all;
    }
```

# API and ABI breaking changes

None.

# Expected complexity level and risk

1.

# Testing

None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-03-02 21:23:04 +00:00
Ryan c323bdf0dc [docs] Corrected call case and updated out-dir to match part 3 (#4513)
# Description of Changes

Contains 2 changes to documentation:
* Updates Unity Client Blackholio tutorial, part 2, with a corrected
`call` command. `Debug` became `debug` to match the automatic case
conversion that now occurs. Originally found and reported by discord
user `chrispavs`
* Updates Unity Client Blackholio tutorial, part 2, with the `out-dir`
path to match the path given in the [Entering the
Game](https://spacetimedb.com/docs/tutorials/unity/part-3#entering-the-game)
of `step 3`.

# API and ABI breaking changes

None

# Expected complexity level and risk

1 - Docs correction

# Testing

- [X] Tested all `blackholio` tutorial steps using C# server and Unity
client
2026-03-02 19:06:28 +00:00
clockwork-labs-bot b322348f41 docs: document how to access module owner via init reducer (#4315)
In the `init` reducer, `ctx.sender` is the **module owner** — the
identity of the user who published the database. This is the only
lifecycle reducer where the owner identity is automatically provided.

Added a tip to the lifecycle docs showing:
- That `ctx.sender` in `init` is the owner
- How to store it in a table for later authorization checks
- Examples in TypeScript, C#, and Rust

Closes #3229

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-03-01 20:45:54 +00:00
clockwork-labs-bot 5d9eb7c705 Add missing TypeScript example in migration guide (#4508)
The 'Option 2: overwrite the name of individual tables' section of the
2.0 migration guide had an empty TypeScript tab. Adds a complete example
using `table()` with an explicit `name` property to preserve the
pre-conversion table name.

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-03-01 16:02:30 +00:00
bradleyshep efa6f382b1 LLM benchmark tool updates (#4413)
# Description of Changes

LLM benchmark updates for local development:

- **Local SDK paths**: Templates use relative paths to workspace crates
(`crates/bindings`, `crates/bindings-csharp`,
`crates/bindings-typescript`) instead of published packages, so the
bench runs against local SDK changes.
- **NODEJS_DIR support**: On Windows (e.g. nvm4w), if `pnpm` is not on
PATH, the bench uses `NODEJS_DIR` to locate `pnpm` and prepends it to
PATH for subprocesses.
- **Refactor**: Extracted `relative_to_workspace()` in `templates.rs`
and removed noisy `NODEJS_DIR` logging in `publishers.rs`.
- **Benchmark results**: Updated `docs/llms/llm-comparison-details.json`
and `docs/llms/llm-comparison-summary.json`.

# API and ABI breaking changes

None.

# Expected complexity level and risk

**2** — Local-only changes to the benchmark tool. Templates now require
local SDKs to be built (especially TypeScript: `pnpm build` in
`crates/bindings-typescript`). No impact on published SDKs or runtime.

# Testing

- [ ] Run `cargo llm run --lang rust --modes docs --providers openai`
from repo root
- [ ] Run TypeScript benchmarks with `pnpm build` in
`crates/bindings-typescript` first
- [ ] On Windows with nvm4w, set `NODEJS_DIR` if `pnpm` is not on PATH
and run TypeScript benchmarks

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-03-01 02:22:59 +00:00
clockwork-labs-bot 1aff83da93 Fix missing word 'time' in ScheduleAt tutorial docs (#4490)
Fixes a missing word in the Unity and Unreal tutorial part-3 docs.

**Before:** `specify a specific at which to call a reducer once`
**After:** `specify a specific **time** at which to call a reducer once`

Fixed in 4 files (current docs + v1.12.0 versioned docs), 6 occurrences
total.

Spotted by Tyler.

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-02-27 18:22:46 +00:00
Tao Tien 824c993fae Remove security warning from 00500-schedule-tables.md (#4463)
Now that scheduled reducers are private, this warning is no longer
necessary.

# Description of Changes

- removed Security Considerations section from Schedule Tables
documentation

Signed-off-by: Tao Tien <29749622+taotien@users.noreply.github.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2026-02-26 21:57:22 +00:00
clockwork-tien 5764ade224 fix(docs): Rename spacerace to referrals for nav item (#4477)
# Description of Changes
- Rename `Spacerace` to `Referrals` for docs nav item to align with
updated naming

<!-- Please describe your change, mention any related tickets, and so on
here. -->

# Screenshots
- After:
<img width="1510" height="49" alt="image"
src="https://github.com/user-attachments/assets/3bdbe6ec-8a51-4686-9292-28c38b6d14d9"
/>

- Before:
<img width="1460" height="47" alt="image"
src="https://github.com/user-attachments/assets/5c70b0ef-d5fc-42fa-9dc9-5fd4f034d415"
/>


# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk
1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Docs displays correctly
2026-02-26 11:06:16 +00:00
Boegie19 42097c3ff4 Add schedule name correction for LLMs (#4370)
# Description of Changes
This change is needed since the AI halicunates that the name is schedule
for some dam reason every time in the llm tests. while it is scheduled

https://github.com/clockworklabs/SpacetimeDB/blob/e2f8a607593f8e2e446df06d84b21e26af2bfc68/docs/llms/docs-benchmark-details.json#L90
# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk
1
<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] Run the LLM benchmark and see if this fixes it

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-02-26 00:25:53 +00:00
Phoebe Goldman 3a850743f5 Correct unique indexes in cheat sheet to use filter, not find (#4452)
# Description of Changes

Some examples in our cheat-sheet incorrectly used a `filter` method on a
unique index. Unique indexes expose `find`, and non-unique indexes
expose `find`. This commit updates the cheatsheet to use the appropriate
index seek methods.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

N/a

# Testing

N/a

# Reviewers

Does the C++ code work as written, or do you have to do something
horrible to do with ranges?
2026-02-26 00:14:37 +00:00
Ryan f8ee1194fd [Docs] [C#] Update docs with List<T> returns and IEnumerable<T> tests (#4392)
# Description of Changes

* Updates `00500-views.md` with:
* Changes returned value to a nullable value, to match the return type
defintion.
* Wraps sample code in `public partial class Module` so pasting it in to
IDE will not return errors.
* Updates `00500-cheat-sheet.md` with:
* Changes reducer names to not start with `On` to avoid error `STDB0010:
Reducer method OnConnect starts with 'On', which is a reserved prefix.`
  * Adds `Accessor` values to views.
* Updates `Filter()` returned value to use `.ToList()` and the return
type to use `List<Player>` rather than `IEnumerable<Player>` to avoid
error, due to needing a return type to be `Vec<T>` or `Option<T>`.
* Updated `Coddgen.Test` to include tests verifying current behavior of
`IEnumerable<T>`, to aid in future update to allow a return type of
`IEnumerable<T>` to be allowed and converted internally to the required
type.

# API and ABI breaking changes

None

# Expected complexity level and risk

1 – documentation-only edits with no behavioral impact.

# Testing

- [X] Changed code blocks tested locally to ensure formatting resolved
in IDE.
2026-02-25 22:50:48 +00:00
John Detter 611be36278 Fix spacerace button in docs (#4458)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

- Right now if you go to the docs https://spacetimedb.com/docs/ and you
click on spacerace in the upper right it will 404. This PR fixes this
issue.

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1 - just a docs update

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

```
cd docs
npm install
npm run dev
```

- [x] spacerace button works in docs
2026-02-25 21:49:06 +00:00
Knut Egil V. Nygård 5fcd934d34 Correct "table" to "view" in 00250-zen-of-spacetimedb.md (#4434)
# Description of Changes

Corrected the wording from `a table` to `a view` where the documentation
links to the "Views" feature page.

---------

Signed-off-by: Knut Egil V. Nygård <86576502+knut-egil@users.noreply.github.com>
Signed-off-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2026-02-25 01:12:20 +00:00
Julien Lavocat bce97d45ac Fix AI assistant rules links in llms.txt (#4430)
# Description of Changes

Fix AI assistant rules links in llms.txt, they were missing a `/docs`

# API and ABI breaking changes

None.

# Expected complexity level and risk

0.0001

# Testing

Clicked the link
2026-02-24 22:42:59 +00:00
Tyler Cloutier a4d29daec8 Fix spacetime dev template issues and clean up CLI (#4396)
## Summary

Multiple fixes and improvements to `spacetime dev`, `spacetime publish`,
`spacetime init`, and templates:

### CLI fixes
- **Fix `spacetime dev` watch path and .env.local handling** for
templates with a `spacetimedb/` subdirectory
- **Validate package manager availability** before installing
dependencies — re-prompts if the selected PM isn't on PATH
- **Remove JS/TS beta warning** from `spacetime publish`
- **Remove unstable warning** from `spacetime init`
- **Remove unused `spacetime energy` command** (can be re-added later
when properly implemented)
- **Fix `tsc` detection on Windows** — `set_extension(".cmd")` produced
`tsc..cmd` (double dot); fixed to `set_extension("cmd")`
- **Add `typescript` as devDependency** to all server template
`spacetimedb/package.json` files so `tsc` is available during build
- **Strip `\?\` extended-length path prefix** from user-facing output in
both `dev` and `publish` commands (produced by `fs::canonicalize()` on
Windows)
- **Fix publish reporting success when user declines** non-local server
prompt — changed `return Ok(())` to `bail!()` consistent with other
abort cases
- **Forward stdin to client process** in `spacetime dev` so interactive
CLI templates work

### Template fixes
- **Fix Angular template environment variables** — Angular's esbuild
builder doesn't support `import.meta.env`, so we use a dev script to
generate `environment.local.ts` with Angular's native `fileReplacements`
pattern
- **Fix TanStack Start template** — rename `createRouter` to `getRouter`
(v1.121+ breaking change), upgrade to React 19, and add
`@vitejs/plugin-react` for automatic JSX runtime support
- **Fix `moduleResolution` in remix-ts and nextjs-ts** server tsconfigs
— change from `"node"` to `"bundler"` to support subpath exports like
`spacetimedb/server`
- **Fix browser-ts template** — convert from static HTML + IIFE bundle
to standard Vite dev server app so it works with `spacetime dev` and
reads env vars from `.env.local`
- **Add `deno` as devDependency** to deno-ts template (matches how
bun-ts includes bun)
- **Convert basic-ts from empty web app to CLI app** matching basic-rs —
connect, subscribe to person table, print on insert

## Test plan

- [x] `cargo test -p spacetimedb-cli` — all 133 tests pass
- [ ] `spacetime dev --template angular-ts` — verify Angular app
connects with correct database name
- [ ] `spacetime dev --template react-ts` — verify React template still
works
- [ ] `spacetime dev --template tanstack-ts` — verify TanStack Start
template loads without errors
- [ ] `spacetime dev --template remix-ts` — verify Remix template builds
and runs
- [ ] `spacetime dev --template nextjs-ts` — verify Next.js template
still works
- [ ] `spacetime dev --template browser-ts` — verify Vite dev server
starts and app connects
- [ ] `spacetime dev --template bun-ts` — verify Bun CLI template runs
interactively
- [ ] `spacetime dev --template basic-ts` — verify CLI connects and
prints on insert
- [ ] Verify no `\?\` prefix in any displayed paths on Windows
- [ ] Verify no `tsc not found` warning when building server modules
- [ ] Select unavailable package manager at init prompt — verify
re-prompt
- [ ] Decline non-local server prompt — verify clean error instead of
"Published successfully!"

---------

Co-authored-by: Piotr Sarnacki <drogus@gmail.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
2026-02-24 02:39:42 -05:00
bradleyshep c37b7912b3 LLM Benchmark docs updates from testings (#4416)
# Description of Changes

Documentation updates from llm-benchmark testing. Includes:

- **Core concepts**: Tables, column types, auto-increment, indexes,
access permissions, schedule tables, event tables, performance
- **Client references**: C# and TypeScript reference updates
- **Migration guide**: 2.0 migration docs
- **AI rules**: `spacetimedb-csharp.mdc`, `spacetimedb-typescript.mdc`,
new `spacetimedb-migration-2.0.mdc`
- **Cheat sheet**: Database cheat sheet updates
- **Reducers, procedures, reducer context**: Small fixes and
clarifications
- **llms.md**: LLM-related doc updates

# API and ABI breaking changes

None. Documentation only.

# Expected complexity level and risk

**Complexity: 2** — Broad docs changes but no code. Risk is limited to
incorrect or misleading docs.

# Testing

- [ ] Build docs site and confirm it renders
- [ ] Spot-check updated pages (tables, schedule tables, cheat sheet,
client references)
- [ ] Confirm C# tutorial examples use `nameof(...)` and snake_case

---------

Signed-off-by: bradleyshep <148254416+bradleyshep@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2026-02-23 21:09:14 -08:00
clockwork-labs-bot b002158db8 Enable confirmed reads by default (#4390)
## Summary

Enable confirmed reads by default for all WebSocket subscriptions and
SQL queries. This is a 2.0 breaking change that improves data integrity.

### What changed

Previously, subscription updates and SQL results were sent to clients
immediately, before the transaction was confirmed durable. A server
crash could cause clients to have observed data that was lost.

Now the server defaults to `confirmed=true`. Clients receive updates
only after durability is confirmed. This adds a small latency cost but
guarantees that any data a client receives will survive a server
restart.

### Changes

**Server (2 files, 2 lines each):**
- `subscribe.rs`: `SubscribeQueryParams.confirmed` defaults to `true`
- `database.rs`: `SqlQueryParams.confirmed` defaults to `true`

**Documentation:**
- Migration guide updated with "Confirmed Reads Enabled by Default"
section
- Added to overview list and quick migration checklist

### Opt-out

Clients can opt out by explicitly passing `?confirmed=false` in the
WebSocket URL or using `.withConfirmedReads(false)` /
`.WithConfirmedReads(false)` / `.with_confirmed_reads(false)` in SDKs.

### Smoketest impact

Smoketests that don't explicitly pass `--confirmed` will now get
confirmed reads via the server default. This should not cause failures
-- confirmed reads only add a small wait for durability confirmation
before sending results. The `confirmed_reads.py` smoketest explicitly
passes `--confirmed` and continues to work as before.

### SDK impact

No SDK changes needed. SDKs only send the `confirmed` query parameter
when explicitly set by the user. When not set, the server default
applies -- which is now `true`.

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-02-24 02:27:42 +00:00
bradleyshep 55c1b815d4 LLM Benchmark Results - Feb 26 (#4388)
# Description of Changes

- Update llm benchmark results based on latest testing
- Clean up details file to remove old models
- Regenerated the summary file

# API and ABI breaking changes

- None

# Expected complexity level and risk

- 1

# Testing

- Verify the new summary file loads correctly on the website.
2026-02-23 23:15:39 +00:00
Ryan 92e9767a81 [Docs] Updates to 00600-c-sharp.md to work in 2.0 (#4415)
# Description of Changes

* Updates directory tree to reflect the actual results of running
`spacetime dev --template basic-cs my-spacetime-app` with no additional
arguments.
* Updates the `Add` -> `add` reducer call to use lower-case to match the
default when no override is specified.
* Updates the `SayHello` -> `say_hello` reducer call to use lower-case
to match the default when no override is specified.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [X] Walked through every step with a local server to test behavior.
This involved.
* Cleared all local cache and rebuilding the CLI.
* Rebuilding the DLLs
* From my test project directory, running:
`D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe
dev --template basic-cs my-spacetime-app` and selecting the default
values.
* This threw an error because, I believe, it was not using the local
DLLs.
* Going into each `.csproj` to ensure they are using the local versions
of the files.
* Running the remaining commands, while targeting the local CLI
executables:
  * Note: `local` server is mapped to `127.0.0.1:3000`
```
D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe publish -s local my-spacetime-app
D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe call -s local my-spacetime-app add Alice
D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe sql -s local my-spacetime-app "SELECT * FROM Person"
D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe call -s local my-spacetime-app say_hello
D:\Projects\ClockworkLabs\SpacetimeDB\target\debug\spacetimedb-cli.exe logs -s local my-spacetime-app
```
2026-02-23 23:11:39 +00:00
Jeffrey Dallatezza 7923d6f64b Update default doc version to 2.0.0 (#4411)
# Description of Changes

Docs will now go to version 2.0.0 by default, and there is a banner with
a link to the newer docs if someone is viewing the v1 docs.

# Expected complexity level and risk

1. Biggest risk here is breaking links.

# Testing

I tested this locally, and checked that links are working.

There is also a broken link checker in the CI.
2026-02-23 23:09:42 +00:00
joshua-spacetime 6298e0a4e0 Remove query builder's .build() from llm docs (#4398)
# Description of Changes

Removes left over references to the query builder's `.build()` method as
well as some stale C# references from `llms.md`.

Only rust and C# docs needed updating.

# API and ABI breaking changes

None

# Expected complexity level and risk

1. Small docs update

# Testing

N/A
2026-02-23 19:19:52 +00:00
Tyler Cloutier d3deaeec08 Docs: Add links to all quickstart guides on Getting Started page (#4395)
## Summary
- Update the `QuickstartLinks` component on the Getting Started
(`/docs`) page to show all 16 quickstart guides instead of just 4
(TypeScript, C#, Rust, React)
- The component now uses `useDocsVersion()` to filter items based on the
active doc version, so v1.12 only shows quickstarts that exist in that
version while v2.0 shows all 16
- Add new SVG logos for Vue, Nuxt, Svelte, Angular, TanStack Start,
Deno, and C++
- Replace existing logos (React, Next.js, Node.js, Bun, Remix, HTML5)
with consistent monochrome `currentColor` versions sourced from the
spacetime-web homepage
- Fix Rust logo visibility in dark mode by removing hardcoded
`style="color: black;"`

## Test plan
- [ ] Verify the Getting Started page on v2.0.0-rc1 shows all 16
quickstart cards
- [ ] Verify the Getting Started page on v1.12.0 shows only the
quickstarts that exist in that version (react, vue, svelte, typescript,
rust, c-sharp)
- [ ] Verify all card links navigate to the correct quickstart page
- [ ] Verify logos are visible in both light and dark mode
2026-02-23 18:49:34 +00:00
bradleyshep c14c8d15b0 TS quickstart template fixes (nextjs + nodejs) (#4380)
# Description of Changes

- Node.js: Use esbuild instead of tsx 
- Node.js: Remove interactive CLI since it doesn't work with `spacetime
dev`
- Next.js: Fix onError callback to use single argument (ctx) and use
ctx.event for the error.
- Next.js: Replace lint-disable comment with `_connection` for the
unused variable.
- Updated quickstart docs to use proper `withDatabaseName`

# API and ABI breaking changes

None.

# Expected complexity level and risk

**Complexity: 1–2.** Small tooling, type, and lint tweaks. Low risk.

# Testing

- [ ] Build affected templates (e.g. `pnpm build` in nextjs-ts).
- [ ] Lint passes.
2026-02-22 11:05:56 +00:00
Phoebe Goldman 2d4395c76d Docs: SpacetimeDB 2.0 migration guide (#4383)
# Description of Changes

Expanded and reorganized the 2.0 migration guide, and also deleted a
file that was in the wrong place. (The word "migration" is
overloaded...)

# API and ABI breaking changes

N/a

# Expected complexity level and risk

Like, 1 I guess, since this isn't code? But we should be careful to get
this right.

# Testing

- [x] Pasted all 2.0 Rust examples into a project based on the
`basic-rs` template and got 'em to build.
- This required filling in some code outside the examples (defining
`play_damage_animation`, binding `target` and `amount`), and changing
one table name that was used in two examples, but otherwise everything
is valid.
  - I didn't test the 1.0 examples.

---------

Co-authored-by: Jason Larabie <jason@clockworklabs.io>
Co-authored-by: = <cloutiertyler@gmail.com>
2026-02-21 03:29:39 +00:00
Jeffrey Dallatezza bddfc19725 Add doc versioning (#4381)
# Description of Changes

This change cuts a version of the docs from 1.12.0
(e45cf891c2), and saves it under
`docs/versioned_docs/version-1.12.0`.

If you go to the docs page, it will redirect to the 1.12.0 docs, which
has a banner at the top for trying the prerelease docs:
<img width="1027" height="283" alt="Screenshot 2026-02-20 at 12 07
39 PM"
src="https://github.com/user-attachments/assets/8ff3d622-b693-469a-980a-01c34d0506b8"
/>

If you select the prelease docs, there is a warning banner at the top:
<img width="886" height="299" alt="Screenshot 2026-02-20 at 12 08 52 PM"
src="https://github.com/user-attachments/assets/5508a635-765e-40cc-ad2a-cbbed7f779dd"
/>


# Expected complexity level and risk

This only changes docs.

# Testing

I've testing by running this locally.
2026-02-20 22:41:39 +00:00
bradleyshep e256ceff33 Change deno quickstart to use package.json instead of deno.json (#4374)
# Description of Changes

Deno quickstart template now uses `package.json` instead of `deno.json`
so `spacetime dev` can run it. Added `templates/deno-ts/package.json`,
removed `deno.json`, and updated the Deno quickstart doc.

# API and ABI breaking changes

None.

# Expected complexity level and risk

**1** — Template and docs only.

# Testing

- [ ] `spacetime dev --template deno-ts` and confirm client runs.
- [ ] Spot-check updated Deno quickstart doc.
2026-02-20 19:05:59 +00:00
Piotr Sarnacki 19cc87ebfa Allow skipping DB if the config file is available (#4358)
# Description of Changes

This PR introduces a possibility to skip passing a DB name to various
commands if there is a config file with one database defined

# API and ABI breaking changes

This changes the behaviour of several CLI commands:

  1. call
  2. subscribe
  3. sql
  4. describe
  5. logs
  6. delete

# Expected complexity level and risk

4 - it's tricky to get all of the combinations of CLI arguments right

# Testing

I've tested the simplest cases manually.

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: = <cloutiertyler@gmail.com>
2026-02-20 17:48:54 +00:00
Shubham Mishra e2f8a60759 Case conversion (#4263)
# Description of Changes

Update the Default casing policy to `snake_case` for `RawModuleDefV10`.

Messy PR contains changes at different places, so that CI can pass:

Here are the main changes as follows:
- `bindings-macro` & `bindings` crate: `name` macro in Indexes for
canonical name and supply it to `RawModuleDefV10` via `ExplicitNames`.
- `bindings-typescript`: 
- Changes has been reviewed through this PR -
https://github.com/clockworklabs/SpacetimeDB/pull/4308.
   
- `binding-csharp`: a single line change to pass `sourceName` of index
instead of null.
- `codegen`:
  
- Changes has been merged from branch -
https://github.com/clockworklabs/SpacetimeDB/pull/4337.
  
- Except a fix in rust codegen to use canonical name in Query buillder
instead of accessor.
  
- `lib/db/raw_def`: Extends `RawDefModuleV10` structure to support case
conversion.
  
- `schema` crate:
- `validate/v9` - Nothing itself should change or changes in v9
validation logic but the file contains a `CoreValidator` which is shared
with `validate/v10`. No test have t be updated to `validate/v9` which
ensures we aren't regressing it.
- `validate/v10`: This is the main meat, look at the new tests added in
bottom to understand what it does.
     
   -  Rest of the files are either test updates or module bindings. 
     
    ## Testing:
1. Extensive unit tests have been added to verify generated `ModuleDef`
is correct.
2. I have done some e2e testing to verify rust codegen with rust and
typescript modules.
3. I would have like to do more testing for other codegens , I am
continue doing .

I have removed `sql.py` smoketest, as that seems to be already migated
in new framework and was headache to update.

## Expected complexity level and risk
4, It could have side-effect which aren't easily visible.


 
 
 
 
 
 -  -  -

---------

Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: Noa <coolreader18@gmail.com>
Co-authored-by: = <cloutiertyler@gmail.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@clockworklabs.io>
Co-authored-by: Jason Larabie <jason@clockworklabs.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2026-02-20 10:44:29 +00:00
Tyler Cloutier b2bb2180c5 Fix spacetime dev watch filtering and improve quickstart copy-paste experience (#4317)
## Summary
- Fix `spacetime dev` failing on C# projects by watching the module
directory itself instead of hardcoded `spacetimedb_dir/src/` (which
doesn't exist for C# templates)
- Add layered file-watch filtering to avoid triggering rebuilds on build
artifacts:
1. Always-ignore dirs (`target/`, `bin/`, `obj/`, `node_modules/`, etc.)
  2. Always-watch exceptions (`.env.local`, `spacetime.*.local.json`)
  3. `.gitignore` rules from global, project, and module levels
- Suppress init's generic "Next steps" message when called from
`spacetime dev`, print a dev-appropriate `cd` hint instead when a new
project is created in a subdirectory
- Update 12 quickstart docs to tell users to open a new terminal and `cd
my-spacetime-app` before running CLI commands

## Test plan
- [x] `cargo build -p spacetimedb-cli` compiles successfully
- [ ] `spacetime dev --template basic-cs` no longer errors with "Input
watch path is neither a file nor a directory"
- [ ] Modifying a `.cs` file in `spacetimedb/` triggers a rebuild
- [ ] Build artifacts in `obj/`/`bin/` do not trigger rebuilds
- [ ] Rust projects (`spacetimedb/src/` exists) continue to work as
before
- [ ] `spacetime dev --template basic-cs` from a non-project directory
prints the "Tip: cd" hint, not the generic "Next steps"
- [ ] `spacetime init` standalone still prints "Next steps" as before

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-02-19 23:12:34 +00:00
John Detter 27bb9f8edf Remove database names in quickstarts (#4354)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

- For the quickstarts we don't want to pass a database name during
`spacetime dev --template ...`

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None - this is just docs

# Expected complexity level and risk

None - this is just docs

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] All quickstarts no longer pass a database name during `spacetime
dev --template ...`
2026-02-19 21:18:29 +00:00
doug ae8c9159b3 Add ConnectionManager for robust React lifecycle handling (#4028)
## Summary
- Add `ConnectionManager` singleton that uses reference counting and
deferred cleanup to handle React StrictMode's double-mount behavior
- Implement TanStack Query-style pattern: `retain()` / `release()`
instead of direct connect/disconnect
- Use `useSyncExternalStore` for tear-free state reads in React

## Changes
- **New:** `src/sdk/connection_manager.ts` - Core ConnectionManager
implementation
- **Modified:** `src/react/SpacetimeDBProvider.ts` - Now uses
ConnectionManager
- **Modified:** `src/react/connection_state.ts` - Simplified type,
imports from ConnectionManager
- **Modified:** `src/sdk/db_connection_builder.ts` - Added `getUri()`
and `getModuleName()` methods
- **Modified:** `src/sdk/db_connection_impl.ts` - Minor type updates for
ConnectionManager integration
- **New:** `tests/connection_manager.test.ts` - 33 unit tests
- **Docs:** Added React Integration section to TypeScript reference
- **Docs:** Added StrictMode compatibility note to README

## Test plan
- [x] `pnpm test` passes (104 tests)
- [x] `pnpm build` passes
- [x] Manual browser test with React StrictMode - single WebSocket
connection

---

## Motivation

### The Problem

React StrictMode double-mounts components in development to help catch
bugs:

1. Mount → creates WebSocket connection
2. Unmount → destroys WebSocket connection
3. Remount → creates **another** WebSocket connection

Without ConnectionManager, you get either:
- **Two connections** (if you don't clean up on unmount)
- **Broken connection** (if you clean up on unmount, the remount races
with cleanup)

### Why ConnectionManager? (vs alternatives)

| Alternative | Problem |
|-------------|---------|
| Don't clean up on unmount | Leaks connections, memory leaks, stale
subscriptions |
| Disable StrictMode | Hides real bugs, production still has edge cases
|
| Connection in module scope | React can't react to state changes, no
`useSyncExternalStore` |

**ConnectionManager approach** (TanStack Query pattern):
- Reference counting: multiple components share one connection
- Deferred cleanup: `setTimeout(0)` lets StrictMode remount cancel
cleanup
- External store: connection state lives outside React but syncs
properly

---

## Why Two `useSyncExternalStore` Usages?

The SDK now has two places using `useSyncExternalStore`. They solve
different problems:

| | `useTable` | `ConnectionManager` |
|---|---|---|
| **Subscribes to** | Table row changes | Connection state changes |
| **External store** | `DbConnection.db.tableName` callbacks |
`ConnectionManager` singleton |
| **Re-renders when** | Row inserted/deleted/updated | `isActive`,
`identity`, `error` change |
| **Manages lifecycle?** |  No - assumes connection exists |  Yes -
owns connect/disconnect |

### `useTable` assumes a connection exists

```tsx
// useTable.ts - subscribes to TABLE DATA
useEffect(() => {
  const connection = connectionState.getConnection()!;  // assumes this exists
  if (connectionState.isActive && connection) {
    const cancel = connection.subscriptionBuilder().subscribe(query);
    return () => cancel.unsubscribe();
  }
}, [...]);
```

### `ConnectionManager` manages WHEN the connection exists

```tsx
// OLD SpacetimeDBProvider - broken with StrictMode
useEffect(() => {
  const conn = builder.build();    // Creates WebSocket
  return () => conn.disconnect();  // Destroys WebSocket
}, [builder]);
// StrictMode: build → disconnect → build = TWO CONNECTIONS RACING

// NEW SpacetimeDBProvider - works with StrictMode  
useEffect(() => {
  ConnectionManager.retain(key, builder);   // refCount++, maybe create
  return () => ConnectionManager.release(key); // refCount--, deferred cleanup
}, [key, builder]);
// StrictMode: retain(1) → release(0, schedule) → retain(1, cancel) = ONE CONNECTION
```

### The Layered Architecture

```
ConnectionManager (lifecycle: retain/release, deferred cleanup)
    ↓
SpacetimeDBProvider (React context + useSyncExternalStore for connection state)
    ↓
useTable (useSyncExternalStore for table data)
```

- `useTable` syncs **data** from an existing connection
- `ConnectionManager` syncs **connection state** AND manages **when the
connection exists**

---------

Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2026-02-19 16:21:19 +00:00
joshua-spacetime 41cfbbc7e0 Update subscription and query builder docs (#4329)
# Description of Changes

This patch does the following:

- Adds api reference docs for the module-side query builder in the view
docs
- Merges the client sdk and subscription docs pages
- Keeps subscription and client overview docs high-level (moved all api
docs to the language reference docs)
- Replaces SQL examples in the docs with the query builder
- Replaces SQL subscriptions in the templates with the query builder

Note, the last commit in this patch set transitions the templates over
to use the query builder instead of SQL subscriptions. This will break
them temporarily until #4000 merges.

Also note, a lot of this was AI assisted. It can still be improved upon,
but it's in a better state than it was.

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1

# Testing

N/A

---------

Signed-off-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2026-02-19 03:59:33 +00:00
Jason Larabie 34aa9654fd Docs - add shared C++ version notice inside first C++ tab across docs (#4348)
# Description of Changes
- Added a shared component with a message for C++ on the version pinning
- Updated every doc that has a C++ tab to include the new message

# API and ABI breaking changes

N/A

# Expected complexity level and risk

2 - Small document change but used a shared component

# Testing
- [x] Tested locally with pnpm dev
- [x] Hosted on my personal site to double check the shared component
2026-02-19 00:20:47 +00:00
Noa ea0e01edb7 Fixes for procedure example in docs (#4346)
# Description of Changes

The maximum http timeout (500ms) was too low for the OpenAI API to have
time to respond, so I raised it, and verified that the rust and
typescript examples work. Csharp wasn't building at all for some reason
(`Workload installation failed: Unable to load the service index for
source https://api.nuget.org/v3/index.json.`?)

# Expected complexity level and risk

1

# Testing

- [x] Manually tested these changes
2026-02-18 23:21:23 +00:00
Jason Larabie 0590ab00f8 Rust docs updated for name to accessor (#4344)
# Description of Changes

- Updated all markdown files that call out `#[spacetimedb::table(name`
to `#[spacetimedb::table(accessor`
- Updated the LLM details on the same change

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1 - Small rework in documentation to use the new 

# Testing

- [x] Did a small double check on name vs accessor locally
- [x] Codex tested all the LLM answers
2026-02-18 23:06:09 +00:00
Jason Larabie f9d4d2748d Small fixes for the Blackholio tutorial (#4343)
# Description of Changes
- Updated the tutorials to use `accessor` in place of `name` for Rust
table definitions
- Removed incorrect file listings for Connect reducer as it's now
private
- Fixed a bug in the Unreal tutorial to bind to correct method for error
handling

# API and ABI breaking changes

N/A

# Expected complexity level and risk
1- Documentation update only

# Testing
- [x] Tested the connect error build for Unreal
- [x] Discovered these issues through manual test of the tutorials
2026-02-18 19:45:16 +00:00
Ryan fc6e8fd21d [Docs] Revisions to Chat App doc for 2.0 release (#4335)
# Description of Changes

Updates the Chat App tutorial
`docs/docs/00100-intro/00300-tutorials/00100-chat-app.md`

* TypeScript (React) code snippet fixes
* Updated the initial `App.tsx` snippet to use `import type * as Types
from './module_bindings/types'` and type `systemMessages` as
`Types.Message[]`, matching the current template-generated bindings.
* Updated the placeholder `onlineUsers` / `offlineUsers` types in the
initial snippet to `Types.User[]`.
* Updated the `main.tsx` connection snippet with the template behavior
by sourcing `HOST` / `DB_NAME` from
`import.meta.env.VITE_SPACETIMEDB_HOST` / `VITE_SPACETIMEDB_DB_NAME` if
available.
* Removed an TypeScript example that referenced reducer event wiring
(`conn.reducers.onSendMessage(...)`) that doesn’t exist in the current
TS generated bindings.
* Updated the follow-up instruction text so the “replace `const
onlineUsers: ...`” and “replace `const offlineUsers: ...`” guidance
matches the updated `Types.User[]` placeholders in the earlier snippet.
* The tutorial section says arguments are JSON; the CLI will auto-quote
string args based on reducer parameter types, so the simple form
`send_message 'Hello, World!'` remains valid and is kept.
* Added C# Client SDK step to update `.csproj` file with `net8.0` and a
filter for code in the `spacetimedb` (server module) subdirectory.

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1

# Testing

- [x] Performed documented operations locally.
2026-02-18 18:21:55 +00:00
Jason Larabie 96ba4ea742 Pinning C++ and Unreal to 1.12.0 (#4328)
# Description of Changes
A few small changes to pin the version:
- Updated the CMakeLists back from 2.0.0 to 1.12.0
- Updated the Unreal Blackholio tutorial documentation to target the
1.12.0 branch and not master
- Updated the Unreal Blackholio tutorial to call out 2.0 is coming soon
- Disabled the upgrade-version tool code path for C++ upgrades, but left
logic in place for the near future

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1 - Docs change, config change, and blocking update path for C++

# Testing

- [x] Reviewed the docs
- [x] Tested update command locally
- [x] Tested `spacetime init` for `basic-cpp` and successfully built
2026-02-18 02:46:24 +00:00
Phoebe Goldman f33188ab1b Minor fixes to examples in event tables document (#4322)
# Description of Changes

Use `accessor =` rather than `name =` in Rust code snippet which defines
event table.

Add `schema` call and `export default` to TypeScript code snippet which
defines event table. I'm not sure this is better, and it's certainly
more cluttered, but the example as written you can't just copy/paste
into your module code.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

Docs only

# Testing

Described elsewhere.
2026-02-17 21:33:31 +00:00
clockwork-labs-bot 3e71f4decf Docs: Expand FAQ for 2.0 launch (#4314)
Rewrites the FAQ from 5 basic questions to a comprehensive guide
covering:

- **General** — What is SpacetimeDB, is it only for games, is it
blockchain, licensing, self-hosting
- **Comparisons** — vs Mirror/Photon/networking libs, vs
Firebase/Supabase, vs PostgreSQL
- **Architecture** — Data persistence, real-time sync, reducers vs REST,
module languages, views, procedures
- **Development** — Getting started, `spacetime dev`, SQL usage,
Unity/Unreal/React/framework support, auth
- **Deployment** — Production publishing, hot-swapping modules, schema
migrations, size limits, pricing
- **Troubleshooting** — Global database names (401/403), confusing
generate errors, resetting databases

Content drawn from README, architecture docs, Zen of SpacetimeDB, and
common user questions from GitHub issues and Discord.

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-02-17 05:56:47 +00:00
clockwork-labs-bot 8a2208bbcf docs: expand Maincloud deployment page (#4316)
Rewrites the Maincloud deployment guide from a bare-bones stub into a
comprehensive page. Addresses all three points from #3108 plus a
community request for the connection URI.

**New content:**

1. **Finding your module on the dashboard** - Direct URL
(`spacetimedb.com/my-module`) and profile page navigation
2. **Database lifecycle** - Running vs suspended states, automatic
suspension after inactivity, automatic resumption on first request
3. **Next steps section** - Links to dashboard, SpacetimeAuth setup,
quickstart guides, and usage monitoring

**Also added:**
- Prerequisites section (CLI install + `spacetime login` to link web
account)
- Publishing workflow (initial publish, hot-swap updates,
`--delete-data`)
- Client connection code examples for TypeScript, C#, Rust, and C++ with
the Maincloud host URL (`https://maincloud.spacetimedb.com`) - per
community request in #3108
- Database deletion instructions
- Link to pricing page

Closes #3108

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-02-17 05:14:35 +00:00
Ryan e03b7d7516 Updated C# Name attribute to Accessor (#4306)
# Description of Changes

Implementation of #4295

Convert existing `Name` attribute to `Accessor` to support new Canonical
Case conversation of 2.0

# API and ABI breaking changes

Yes, in C# modules, we no longer use the attribute name `Name`, it
should now be `Accessor`

# Expected complexity level and risk

1

# Testing

- [X] Build and tested locally
- [X] Ran regression tests locally
2026-02-17 01:16:16 +00:00
Jeffrey Dallatezza 08ff1e1c11 TS Quickstart: Store different auth tokens for different servers/modules (#3252)
# Description of Changes

In the typescript quickstart example, this includes the server and
module name in the local storage variable name that we use for the auth
token.

This fixes an otherwise annoying issue people run into if they start
running the quickstart locally, then try to run it on maincloud. If they
have already run the app with a local server, their browser will store
the locally signed token, which will get rejected by maincloud.

# Expected complexity level and risk

1.

# Testing

I was able to connect to my local quickstart, then change the variables
to point to a module on maincloud, and I didn't get any errors.

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-02-16 16:34:46 +00:00
Shubham Mishra e4098f98d9 Rust: macro change name -> accessor (#4264)
## Description of Changes

This PR primarily affects the `bindings-macro` and `schema` crates to
review:

### Core changes

1. Replaces the `name` macro with `accessor` for **Tables, Views,
Procedures, and Reducers** in Rust modules.
2. Extends `RawModuleDefV10` with a new section for:

   * case conversion policies
   * explicit names
    New sections are not validated in this PR so not functional.
3. Updates index behavior:

* Index names are now always **system-generated** for clients. Which
will be fixed in follow-up PR when we start validating RawModuleDef with
explicit names.
   * The `accessor` name for an index is used only inside the module.


## Breaking changes (API/ABI)

1. **Rust modules**

   * The `name` macro must be replaced with `accessor`.

2. **Client bindings (all languages)**

* Index names are now system-generated instead of using explicitly
provided names.


**Complexity:** 3

A follow-up PR will reintroduce explicit names with support for case
conversion.

---------

Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
2026-02-16 15:23:50 +00:00
Julien Lavocat 83851fe9df Add Angular integration (#4139)
# Description of Changes

- Add Angular integration
- Add Angular quickstart chat template

# API and ABI breaking changes

None.

# Expected complexity level and risk

2

# Testing

Ran the template

---------

Co-authored-by: Tien Pham <tien@clockworklabs.io>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-02-16 02:21:52 +00:00