Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ For all available publishing options and flags, see the [`spacetime publish` CLI

### Environment Variables

Modules can declare environment variables for configuration and secrets. Each publish supplies the complete set of values from the target's `env` configuration and declared shell variables. Required values must be supplied on every publish; omitted optional values are removed. The module and its environment update atomically.
Modules can declare environment variables for configuration and secrets. Each publish supplies values from the target's `env` configuration and declared shell variables, then preserves unspecified stored values by default. Required values must exist in the resulting environment; optional values are removed only when you unset them explicitly or use `--replace-env`. The module and its environment update atomically.

See [Environment Variables](./00700-environment-variables.md) for declarations, reading values in module code, publishing examples, and private tables for secrets that need to change without republishing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const myTable = table(
const spacetimedb = schema({ myTable });
export default spacetimedb;

export const insertAValue = spacetimedb.procedure({ a: t.u32(), b: t.u32() }, t.unit(), (ctx, { a, b }) => {
export const insertAValue = spacetimedb.procedure({ a: t.u32(), b: t.string() }, t.unit(), (ctx, { a, b }) => {
ctx.withTx(ctx => {
ctx.db.myTable.insert({ a, b });
});
Expand Down Expand Up @@ -875,6 +875,11 @@ Procedures can't send requests at the same time as holding open a [transaction](
</TabItem>
</Tabs>

Procedure HTTP requests automatically accept gzip and Brotli responses and expose the decoded

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source for this localized docs update: #5698 enabled transparent gzip/Brotli decompression for procedure HTTP requests.

response body to module code. If you set an `Accept-Encoding` header yourself, the response body is
still decoded by the host, so do not manually decompress it in the module. Headers that describe the
compressed wire body, such as `Content-Encoding` and `Content-Length`, may be absent after decoding.

:::note
If no timeout is specified, HTTP requests default to 30 seconds. User-specified timeouts are clamped to a maximum of 180 seconds by the host.
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public static readonly List<string> OIDC_CLIENT_IDS = new()
{
"client_XXXXXXXXXXXXXXXXXXXXXX",
};
public void Connect(ReducerContext ctx)

[Reducer(ReducerKind.ClientConnected)]
public static void Connect(ReducerContext ctx)
{
var claims = ctx.SenderAuth.Jwt ?? throw new Exception("Client connected without JWT");
if (claims.Issuer != "https://auth.spacetimedb.com/oidc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ Each table or view defined by a module has an accessor method, whose name is the

```typescript
class TableHandle {
public count(): number;
public count(): bigint;
}
```

Expand Down
Loading