State Storage

There's nothing to set up here. Interlace keeps each component's state in the page itself, signed so the server rejects any tampering, and posts it back on each interaction. The server stays stateless, so scaling out to more machines stays simple. It just works, no configuration.

This page exists for one reason: to be clear about what that means for sensitive data.

State travels in the page

Between requests a component's public property values live in the page as a signed snapshot and are posted back on each interaction. The signature makes the snapshot tamper-proof, the server rejects a modified snapshot, but it does not make it secret: the values are readable in the page source. A model property, for example, serializes to its primary key.

Never put secrets in a public property

Because the snapshot is readable (and the rendered HTML is public anyway), don't place anything you can't show the user in a public property. Instead:

  • Derive it with a @computed rather than storing it. Computed values are recomputed server-side and aren't part of the snapshot (though if you render one, that output is in the HTML like anything else).

  • For a value that must never reach the browser at all, use an underscore-prefixed (private) attribute (_token): never serialized, never sent, never bindable, and don't render it.

To limit which model fields the client may write, see Models.

View this page as markdown - handy as context for your AI tools. Full index at /llms.txt.

Theme
Accent
Ink