Skip to main content
A space is a React app on your ontology. It gets data only from the ontology’s reads, actions, and realtime views, through a typed client Tilde generates, so the same policies govern it. People open spaces in Live, and you can embed them in your own product. See Spaces for more.

The package

spaces/ is one npm project. Each folder in it is one space, and the folder name is the space’s id.
spaces/package.json
Tilde provides @tilde/spaces (hooks and components) and @tilde/contract (your handlers, typed) at build time, so don’t list them.

A page

A space default-exports a component, and exports a title. This one lists customers, shows one, and logs a call with the setNotes action.
spaces/customers/index.tsx
  • Importing a handler that doesn’t exist is a build error.
  • When a page needs new data, add a read to the ontology in the same change.
  • Opening the space needs an openSpace policy. The open-customers policy in The ontology grants it.

Next

Add an agent that uses the same reads and actions.