spacetimedb-typescript

Generate type-safe SpacetimeDB clients for TypeScript and React with WebSocket connections.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/lioartoil/claude-code-handbook --skill spacetimedb-typescript-lioartoil
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spacetimedb-typescript
Source: https://github.com/lioartoil/claude-code-handbook/tree/main/skills/spacetimedb-typescript
Command: npx skills add https://github.com/lioartoil/claude-code-handbook --skill spacetimedb-typescript-lioartoil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers building TypeScript and React applications often struggle to wire up real-time SpacetimeDB clients with strong typing, reliable connection management, and React-friendly access patterns.

Core Features & Use Cases

  • WebSocket-based data channel with typed models generated from the server module
  • Subscriptions with local cache and reducer-driven updates
  • React integration via first-party hooks and a provider
  • Token-based authentication and reconnection support

Quick Start

Install the SDK, generate client types from your server module, and initialize a connection using the SpacetimeDB builder.

Frequently Asked Questions about spacetimedb-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a TypeScript React app to SpacetimeDB?▼

To connect a TypeScript React app to SpacetimeDB, you use a builder to initialize a WebSocket connection, generate typed client models from the server module, and wrap your app in a React provider for real-time data access.

Does SpacetimeDB provide type-safe client generation for TypeScript?▼

Yes, SpacetimeDB provides type-safe client generation for TypeScript by generating typed models directly from the server module, ensuring reliable type checking for subscriptions, reducers, and connection handling.

Can I manage SpacetimeDB authentication and reconnection in React?▼

Yes, you can manage SpacetimeDB authentication and reconnection in React using built-in token management features and first-party React hooks designed to handle connection drops and maintain authentication state.

What is the best way to handle SpacetimeDB subscriptions in TypeScript?▼

The best way to handle SpacetimeDB subscriptions in TypeScript is by using the local cache mechanism to manage reducer-driven updates, ensuring your application maintains real-time data consistency across components.

How do I invoke SpacetimeDB reducers from a TypeScript client?▼

You invoke SpacetimeDB reducers from a TypeScript client by calling methods on the generated typed client models, which provide a type-safe interface for executing server-side logic over the established WebSocket connection.