You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the call completed successfully, that command will have no output, but we can see the debug logs by running:
440
440
441
441
```sh
442
-
spacetime logs blackholio
442
+
spacetime logs --server localblackholio
443
443
```
444
444
445
445
You should see something like the following output:
@@ -472,7 +472,7 @@ The `client_connected` argument to the `spacetimedb::reducer` macro indicates to
472
472
473
473
> SpacetimeDB gives you the ability to define custom reducers that automatically trigger when certain events occur.
474
474
>
475
-
> -`init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish <name> --delete-data`.
475
+
> -`init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish --server local <name> --delete-data`.
476
476
> -`client_connected` - Called when a user connects to the SpacetimeDB database. Their identity can be found in the `sender` value of the `ReducerContext`.
477
477
> -`client_disconnected` - Called when a user disconnects from the SpacetimeDB database.
478
478
@@ -492,7 +492,7 @@ The `ReducerKind.ClientConnected` argument to the `SpacetimeDB.Reducer` attribut
492
492
493
493
> SpacetimeDB gives you the ability to define custom reducers that automatically trigger when certain events occur.
494
494
>
495
-
> -`ReducerKind.Init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish <name> --delete-data`.
495
+
> -`ReducerKind.Init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish --server local <name> --delete-data`.
496
496
> -`ReducerKind.ClientConnected` - Called when a user connects to the SpacetimeDB database. Their identity can be found in the `Sender` value of the `ReducerContext`.
497
497
> -`ReducerKind.ClientDisconnected` - Called when a user disconnects from the SpacetimeDB database.
498
498
@@ -690,7 +690,7 @@ Subscription applied indicates that the SpacetimeDB SDK has evaluated your subsc
690
690
We can also see that the server has logged the connection as well.
691
691
692
692
```sh
693
-
spacetime logs blackholio
693
+
spacetime logs --server localblackholio
694
694
...
695
695
2025-01-10T03:51:02.078700Z DEBUG: src/lib.rs:63: c200fb5be9524bfb8289c351516a1d9ea800f70a17a9a6937f11c0ed3854087d just connected.
If the call completed successfully, that command will have no output, but we can see the debug logs by running:
427
427
428
428
```sh
429
-
spacetime logs blackholio
429
+
spacetime logs --server localblackholio
430
430
```
431
431
432
432
You should see something like the following output:
@@ -459,7 +459,7 @@ The `client_connected` argument to the `spacetimedb::reducer` macro indicates to
459
459
460
460
> SpacetimeDB gives you the ability to define custom reducers that automatically trigger when certain events occur.
461
461
>
462
-
> -`init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish <name> --delete-data`.
462
+
> -`init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish --server local <name> --delete-data`.
463
463
> -`client_connected` - Called when a user connects to the SpacetimeDB database. Their identity can be found in the `sender` value of the `ReducerContext`.
464
464
> -`client_disconnected` - Called when a user disconnects from the SpacetimeDB database.
465
465
@@ -479,7 +479,7 @@ The `ReducerKind.ClientConnected` argument to the `SpacetimeDB.Reducer` attribut
479
479
480
480
> SpacetimeDB gives you the ability to define custom reducers that automatically trigger when certain events occur.
481
481
>
482
-
> -`ReducerKind.Init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish <name> --delete-data`.
482
+
> -`ReducerKind.Init` - Called the first time you publish your module and anytime you clear the database with `spacetime publish --server local <name> --delete-data`.
483
483
> -`ReducerKind.ClientConnected` - Called when a user connects to the SpacetimeDB database. Their identity can be found in the `Sender` value of the `ReducerContext`.
484
484
> -`ReducerKind.ClientDisconnected` - Called when a user disconnects from the SpacetimeDB database.
485
485
@@ -753,7 +753,7 @@ Subscription applied indicates that the SpacetimeDB SDK has evaluated your subsc
753
753
We can also see that the server has logged the connection as well.
754
754
755
755
```sh
756
-
spacetime logs blackholio
756
+
spacetime logs --server local blackholio
757
757
...
758
758
2025-01-10T03:51:02.078700Z DEBUG: src/lib.rs:63: c200fb5be9524bfb8289c351516a1d9ea800f70a17a9a6937f11c0ed3854087d just connected.
spacetime publish --server local --project-path spacetimedb quickstart-chat
269
269
```
270
270
271
271
Note: If the WebAssembly optimizer `wasm-opt` is installed, `spacetime publish` will automatically optimize the Web Assembly output of the published module. Instruction for installing the `wasm-opt` binary can be found in [Rust's wasm-opt documentation](https://docs.rs/wasm-opt/latest/wasm_opt/).
@@ -275,13 +275,13 @@ Note: If the WebAssembly optimizer `wasm-opt` is installed, `spacetime publish`
275
275
You can use the CLI (command line interface) to run reducers. The arguments to the reducer are passed in JSON format.
Copy file name to clipboardExpand all lines: docs/docs/06-Server Module Languages/05-typescript-quickstart.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,13 @@ Inside the `spacetimedb/` directory will be a `src/index.ts` entrypoint (require
38
38
## How to Build & Publish
39
39
40
40
> [!IMPORTANT]
41
-
> TypeScript modules are built and published with the `spacetime` CLI. `spacetime publish` will transpile and bundle your server module for you starting with the `src/index.ts` entrypoint. If you bundle your js yourself, you can specify `spacetime publish --js-path <path-to-your-bundle-file>` when publishing.
41
+
> TypeScript modules are built and published with the `spacetime` CLI. `spacetime publish` will transpile and bundle your server module for you starting with the `src/index.ts` entrypoint. If you bundle your js yourself, you can specify `spacetime publish --server local --js-path <path-to-your-bundle-file>` when publishing.
42
42
43
43
From the `spacetimedb/` directory you can lint/typecheck locally if you like, but to make the module live you’ll publish it to a database:
spacetime publish --server local --project-path spacetimedb quickstart-chat
207
207
```
208
208
209
209
You can choose any unique, URL-safe database name in place of `quickstart-chat`. The CLI will show the database **Identity** (a hex string) as well; you can use either the name or identity with CLI commands.
@@ -215,13 +215,13 @@ Use the CLI to call reducers. Arguments are passed as JSON (strings may be given
0 commit comments