State setup flow
Enable State for the service
Set
[capabilities].state = true in tovuk.toml, then run
tovuk deploy --dry-run --json so the agent can confirm State meters,
limits, and required fixes before provisioning classes.Write and inspect one object
Write one value, read it back, and list keys before relying on the object
from production traffic.
Inspect the runtime binding
Deploy the Rust worker, read
TOVUK_STATE_ROOM from the runtime
environment (TOVUK_STATE_<NAME> for other class names), and use
tovuk service show service_1 --json to verify State resources, current
usage, limits, and next actions.Dashboard
Dashboard State controls are available athttps://tovuk.com/account/resources and
https://tovuk.com/<handle>/resources. The Resources view can list State
objects, list State keys, read values, write values, delete values, read
alarms, set alarms with delay seconds, and delete alarms through the same
metered State API routes as the CLI.
Dashboard State controls can list State objects and list State keys before an
agent reads, writes, or deletes one value.
The dashboard uses these State API routes:
GET /v1/services/{service_id}/state/namespaces/{namespace}/objectsGET /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/keysGET /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/values/{key}PUT /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/values/{key}DELETE /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/values/{key}GET /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/alarmPUT /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/alarmDELETE /v1/services/{service_id}/state/namespaces/{namespace}/objects/{object_key}/alarm
CLI workflow
Runtime
Workers receive one environment variable per State class:TOVUK_RUNTIME_TOKEN from the Rust worker to call the State API for the
current service. Do not expose runtime tokens to browsers or static frontend
files.
State alarms deliver an internal worker event:
Limits
Free:100State classes.100,000State requests per day.13,000 GB-sduration per day.5 millionSQLite rows read per day.100,000SQLite rows written per day.5 GBaccount SQLite storage.1 GBSQLite storage per object. The Free account cap still stops writes when total State storage reaches5 GB.2 MiBcombined key and value payload.32 MiBWebSocket message size.15 minuteState alarm handler wall-time.
500State classes.1 millionState requests per month included.400,000 GB-sduration per month included.25 billionSQLite rows read per month included.50 millionSQLite rows written per month included.5 GBSQLite storage included, then paid storage overage.10 GBSQLite storage per object.2 MiBcombined key and value payload.32 MiBWebSocket message size.15 minuteState alarm handler wall-time.
tovuk pricing --json for current state* limit fields and pricing. Use
tovuk usage --json before load tests, then set hard caps: