+
+
+
diff --git a/templates/nuxt-ts/env.d.ts b/templates/nuxt-ts/env.d.ts
new file mode 100644
index 00000000000..5c930383177
--- /dev/null
+++ b/templates/nuxt-ts/env.d.ts
@@ -0,0 +1,10 @@
+///
+
+interface ImportMetaEnv {
+ readonly VITE_SPACETIMEDB_HOST: string;
+ readonly VITE_SPACETIMEDB_DB_NAME: string;
+}
+
+interface ImportMeta {
+ readonly env: ImportMetaEnv;
+}
diff --git a/templates/nuxt-ts/module_bindings/add_reducer.ts b/templates/nuxt-ts/module_bindings/add_reducer.ts
new file mode 100644
index 00000000000..85081559c7d
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/add_reducer.ts
@@ -0,0 +1,15 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default {
+ name: __t.string(),
+};
diff --git a/templates/nuxt-ts/module_bindings/add_type.ts b/templates/nuxt-ts/module_bindings/add_type.ts
new file mode 100644
index 00000000000..638f62cea39
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/add_type.ts
@@ -0,0 +1,15 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('Add', {
+ name: __t.string(),
+});
diff --git a/templates/nuxt-ts/module_bindings/index.ts b/templates/nuxt-ts/module_bindings/index.ts
new file mode 100644
index 00000000000..d726335a186
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/index.ts
@@ -0,0 +1,145 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+// This was generated using spacetimedb cli version 1.11.3 (commit 02449737ca3b29e7e39679fccbef541a50f32094).
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ DbConnectionBuilder as __DbConnectionBuilder,
+ DbConnectionImpl as __DbConnectionImpl,
+ SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
+ TypeBuilder as __TypeBuilder,
+ Uuid as __Uuid,
+ convertToAccessorMap as __convertToAccessorMap,
+ procedureSchema as __procedureSchema,
+ procedures as __procedures,
+ reducerSchema as __reducerSchema,
+ reducers as __reducers,
+ schema as __schema,
+ t as __t,
+ table as __table,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type DbConnectionConfig as __DbConnectionConfig,
+ type ErrorContextInterface as __ErrorContextInterface,
+ type Event as __Event,
+ type EventContextInterface as __EventContextInterface,
+ type Infer as __Infer,
+ type ReducerEventContextInterface as __ReducerEventContextInterface,
+ type RemoteModule as __RemoteModule,
+ type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
+ type SubscriptionHandleImpl as __SubscriptionHandleImpl,
+} from 'spacetimedb';
+
+// Import and reexport all reducer arg types
+import OnConnectReducer from './on_connect_reducer';
+export { OnConnectReducer };
+import OnDisconnectReducer from './on_disconnect_reducer';
+export { OnDisconnectReducer };
+import AddReducer from './add_reducer';
+export { AddReducer };
+import SayHelloReducer from './say_hello_reducer';
+export { SayHelloReducer };
+
+// Import and reexport all procedure arg types
+
+// Import and reexport all table handle types
+import PersonRow from './person_table';
+export { PersonRow };
+
+// Import and reexport all types
+import Add from './add_type';
+export { Add };
+import Init from './init_type';
+export { Init };
+import OnConnect from './on_connect_type';
+export { OnConnect };
+import OnDisconnect from './on_disconnect_type';
+export { OnDisconnect };
+import Person from './person_type';
+export { Person };
+import SayHello from './say_hello_type';
+export { SayHello };
+
+/** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */
+const tablesSchema = __schema(
+ __table(
+ {
+ name: 'person',
+ indexes: [],
+ constraints: [],
+ },
+ PersonRow
+ )
+);
+
+/** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
+const reducersSchema = __reducers(
+ __reducerSchema('add', AddReducer),
+ __reducerSchema('say_hello', SayHelloReducer)
+);
+
+/** The schema information for all procedures in this module. This is defined the same way as the procedures would have been defined in the server. */
+const proceduresSchema = __procedures();
+
+/** The remote SpacetimeDB module schema, both runtime and type information. */
+const REMOTE_MODULE = {
+ versionInfo: {
+ cliVersion: '1.11.3' as const,
+ },
+ tables: tablesSchema.schemaType.tables,
+ reducers: reducersSchema.reducersType.reducers,
+ ...proceduresSchema,
+} satisfies __RemoteModule<
+ typeof tablesSchema.schemaType,
+ typeof reducersSchema.reducersType,
+ typeof proceduresSchema
+>;
+
+/** The tables available in this remote SpacetimeDB module. */
+export const tables = __convertToAccessorMap(tablesSchema.schemaType.tables);
+
+/** The reducers available in this remote SpacetimeDB module. */
+export const reducers = __convertToAccessorMap(
+ reducersSchema.reducersType.reducers
+);
+
+/** The context type returned in callbacks for all possible events. */
+export type EventContext = __EventContextInterface;
+/** The context type returned in callbacks for reducer events. */
+export type ReducerEventContext = __ReducerEventContextInterface<
+ typeof REMOTE_MODULE
+>;
+/** The context type returned in callbacks for subscription events. */
+export type SubscriptionEventContext = __SubscriptionEventContextInterface<
+ typeof REMOTE_MODULE
+>;
+/** The context type returned in callbacks for error events. */
+export type ErrorContext = __ErrorContextInterface;
+/** The subscription handle type to manage active subscriptions created from a {@link SubscriptionBuilder}. */
+export type SubscriptionHandle = __SubscriptionHandleImpl;
+
+/** Builder class to configure a new subscription to the remote SpacetimeDB instance. */
+export class SubscriptionBuilder extends __SubscriptionBuilderImpl<
+ typeof REMOTE_MODULE
+> {}
+
+/** Builder class to configure a new database connection to the remote SpacetimeDB instance. */
+export class DbConnectionBuilder extends __DbConnectionBuilder {}
+
+/** The typed database connection to manage connections to the remote SpacetimeDB instance. This class has type information specific to the generated module. */
+export class DbConnection extends __DbConnectionImpl {
+ /** Creates a new {@link DbConnectionBuilder} to configure and connect to the remote SpacetimeDB instance. */
+ static builder = (): DbConnectionBuilder => {
+ return new DbConnectionBuilder(
+ REMOTE_MODULE,
+ (config: __DbConnectionConfig) =>
+ new DbConnection(config)
+ );
+ };
+
+ /** Creates a new {@link SubscriptionBuilder} to configure a subscription to the remote SpacetimeDB instance. */
+ override subscriptionBuilder = (): SubscriptionBuilder => {
+ return new SubscriptionBuilder(this);
+ };
+}
diff --git a/templates/nuxt-ts/module_bindings/init_type.ts b/templates/nuxt-ts/module_bindings/init_type.ts
new file mode 100644
index 00000000000..52ed691ed94
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/init_type.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('Init', {});
diff --git a/templates/nuxt-ts/module_bindings/on_connect_reducer.ts b/templates/nuxt-ts/module_bindings/on_connect_reducer.ts
new file mode 100644
index 00000000000..2ca99c88fea
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/on_connect_reducer.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default {};
diff --git a/templates/nuxt-ts/module_bindings/on_connect_type.ts b/templates/nuxt-ts/module_bindings/on_connect_type.ts
new file mode 100644
index 00000000000..d36362515de
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/on_connect_type.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('OnConnect', {});
diff --git a/templates/nuxt-ts/module_bindings/on_disconnect_reducer.ts b/templates/nuxt-ts/module_bindings/on_disconnect_reducer.ts
new file mode 100644
index 00000000000..2ca99c88fea
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/on_disconnect_reducer.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default {};
diff --git a/templates/nuxt-ts/module_bindings/on_disconnect_type.ts b/templates/nuxt-ts/module_bindings/on_disconnect_type.ts
new file mode 100644
index 00000000000..efda71ebcfd
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/on_disconnect_type.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('OnDisconnect', {});
diff --git a/templates/nuxt-ts/module_bindings/person_table.ts b/templates/nuxt-ts/module_bindings/person_table.ts
new file mode 100644
index 00000000000..0f70f74f617
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/person_table.ts
@@ -0,0 +1,15 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.row({
+ name: __t.string(),
+});
diff --git a/templates/nuxt-ts/module_bindings/person_type.ts b/templates/nuxt-ts/module_bindings/person_type.ts
new file mode 100644
index 00000000000..1156775a3cf
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/person_type.ts
@@ -0,0 +1,15 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('Person', {
+ name: __t.string(),
+});
diff --git a/templates/nuxt-ts/module_bindings/say_hello_reducer.ts b/templates/nuxt-ts/module_bindings/say_hello_reducer.ts
new file mode 100644
index 00000000000..2ca99c88fea
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/say_hello_reducer.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default {};
diff --git a/templates/nuxt-ts/module_bindings/say_hello_type.ts b/templates/nuxt-ts/module_bindings/say_hello_type.ts
new file mode 100644
index 00000000000..6293ca6bd09
--- /dev/null
+++ b/templates/nuxt-ts/module_bindings/say_hello_type.ts
@@ -0,0 +1,13 @@
+// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
+// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
+
+/* eslint-disable */
+/* tslint:disable */
+import {
+ TypeBuilder as __TypeBuilder,
+ t as __t,
+ type AlgebraicTypeType as __AlgebraicTypeType,
+ type Infer as __Infer,
+} from 'spacetimedb';
+
+export default __t.object('SayHello', {});
diff --git a/templates/nuxt-ts/nuxt.config.ts b/templates/nuxt-ts/nuxt.config.ts
new file mode 100644
index 00000000000..aca3f03e10e
--- /dev/null
+++ b/templates/nuxt-ts/nuxt.config.ts
@@ -0,0 +1,7 @@
+export default defineNuxtConfig({
+ compatibilityDate: '2025-01-01',
+ ssr: false,
+ devServer: {
+ port: 5173,
+ },
+});
diff --git a/templates/nuxt-ts/package.json b/templates/nuxt-ts/package.json
new file mode 100644
index 00000000000..fa5ad151031
--- /dev/null
+++ b/templates/nuxt-ts/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "@clockworklabs/nuxt-ts",
+ "private": true,
+ "version": "0.0.1",
+ "type": "module",
+ "scripts": {
+ "dev": "nuxt dev",
+ "build": "nuxt build",
+ "preview": "nuxt preview",
+ "generate": "pnpm --dir spacetimedb install --ignore-workspace && cargo run -p gen-bindings -- --out-dir module_bindings --project-path spacetimedb && prettier --write module_bindings",
+ "spacetime:generate": "spacetime generate --lang typescript --out-dir module_bindings --project-path spacetimedb",
+ "spacetime:publish:local": "spacetime publish --project-path spacetimedb --server local",
+ "spacetime:publish": "spacetime publish --project-path spacetimedb --server maincloud"
+ },
+ "dependencies": {
+ "spacetimedb": "workspace:*",
+ "nuxt": "~3.16.0",
+ "vue": "^3.5.13"
+ },
+ "devDependencies": {
+ "typescript": "~5.6.2"
+ }
+}
diff --git a/templates/nuxt-ts/spacetimedb/package.json b/templates/nuxt-ts/spacetimedb/package.json
new file mode 100644
index 00000000000..214ccc569bf
--- /dev/null
+++ b/templates/nuxt-ts/spacetimedb/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "spacetime-module",
+ "version": "1.0.0",
+ "description": "",
+ "scripts": {
+ "build": "spacetime build",
+ "publish": "spacetime publish"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "spacetimedb": "1.*"
+ }
+}
diff --git a/templates/nuxt-ts/spacetimedb/src/index.ts b/templates/nuxt-ts/spacetimedb/src/index.ts
new file mode 100644
index 00000000000..900cb1bf2e9
--- /dev/null
+++ b/templates/nuxt-ts/spacetimedb/src/index.ts
@@ -0,0 +1,33 @@
+import { schema, table, t } from 'spacetimedb/server';
+
+export const spacetimedb = schema(
+ table(
+ { name: 'person', public: true },
+ {
+ name: t.string(),
+ }
+ )
+);
+
+spacetimedb.init((_ctx) => {
+ // Called when the module is initially published
+});
+
+spacetimedb.clientConnected((_ctx) => {
+ // Called every time a new client connects
+});
+
+spacetimedb.clientDisconnected((_ctx) => {
+ // Called every time a client disconnects
+});
+
+spacetimedb.reducer('add', { name: t.string() }, (ctx, { name }) => {
+ ctx.db.person.insert({ name });
+});
+
+spacetimedb.reducer('say_hello', (ctx) => {
+ for (const person of ctx.db.person.iter()) {
+ console.info(`Hello, ${person.name}!`);
+ }
+ console.info('Hello, World!');
+});
diff --git a/templates/nuxt-ts/spacetimedb/tsconfig.json b/templates/nuxt-ts/spacetimedb/tsconfig.json
new file mode 100644
index 00000000000..c97c980cf80
--- /dev/null
+++ b/templates/nuxt-ts/spacetimedb/tsconfig.json
@@ -0,0 +1,23 @@
+
+/*
+ * This tsconfig is used for TypeScript projects created with `spacetimedb init
+ * --lang typescript`. You can modify it as needed for your project, although
+ * some options are required by SpacetimeDB.
+ */
+{
+ "compilerOptions": {
+ "strict": true,
+ "skipLibCheck": true,
+ "moduleResolution": "bundler",
+
+ /* The following options are required by SpacetimeDB
+ * and should not be modified
+ */
+ "target": "ESNext",
+ "lib": ["ES2021", "dom"],
+ "module": "ESNext",
+ "isolatedModules": true,
+ "noEmit": true
+ },
+ "include": ["./**/*"]
+}
diff --git a/templates/nuxt-ts/tsconfig.json b/templates/nuxt-ts/tsconfig.json
new file mode 100644
index 00000000000..4b34df1571f
--- /dev/null
+++ b/templates/nuxt-ts/tsconfig.json
@@ -0,0 +1,3 @@
+{
+ "extends": "./.nuxt/tsconfig.json"
+}