Skip to content

WebSocketState

type WebSocketState = unknown

Durable per-connection state: the store ws.state exposes. Get/set by TypedStateToken, values deep-frozen on write (so they stay plain + serializable - exactly what a Durable Object attachment needs). This is where per-connection state MUST live to survive a hibernation wake; closure locals and controller instance fields do not.

Learn: Connection state

Last updated: