Skip to content

App Interconnect

app-interconnect-model.md and realm-interop-mapping.md describe how apps connect into Realm and how the realm primitive interoperability mapping works. This page is the reader's view of how an app crosses into Realm.

How Apps Connect To Realm

PathPurpose
RESTTyped Realm reads / mutations under admitted contracts
WebSocketRealtime delivery of canonical events

Apps connect to Realm through admitted REST + WS surfaces; they do not invent their own protocols. Authorization is bearer token issued under admitted token issuance flow.

App Modes And Realm Authority

A render-app reads Realm; an extension-app reads and writes Realm within its admitted binding scope.

ModeRealm readRealm writeConcurrent count per world
render-appyesnomany
extension-appyesyesat most one active per world

A world's at-most-one-active-extension-app rule comes from this: if two extension-apps could both write Realm canonical state for the same world simultaneously, the canonical state would race.

Interop Mapping

Realm interop mapping translates Realm concepts to / from external open-spec anchors (cross-protocol mappings). It bridges:

BridgePurpose
World state contract ↔ external state representationsWhen a Realm world's state needs to be visible externally
World history contract ↔ external history representationsCross-platform history compatibility
Runtime memory ↔ Realm memoryReplication semantics
Runtime agent ↔ Realm agentIdentity bridging
Transit contract ↔ external transit shapesCross-protocol transit compatibility

The interop mapping is the formal translation layer. It doesn't mutate Realm; it projects Realm into shapes that other systems can consume.

Reader Scenario: An App Reads Then Acts

A render-app wants to display a world; later, the user upgrades to an extension-app that mutates state.

  1. Render-app starts. App reads Realm under render mode.
  2. User wants more. User upgrades the relationship to extension-app mode.
  3. App-world binding. The extension-app binds to the world (one active at a time).
  4. Mutation. The extension-app submits typed commit envelopes for state mutations.
  5. Realm admits. Each mutation passes admitted authorization matrix.
  6. Audit lineage. Each mutation recorded.

The transition from render-only to extension-with-write requires explicit binding. There is no silent privilege escalation.

Reader Scenario: A Realtime Event Stream

An app wants to react to canonical events as they happen.

  1. Subscribe. App opens a WebSocket subscription to Realm under admitted subscription surface.
  2. Realtime delivery. Events arrive as they commit.
  3. App reacts. Typed event handlers under admitted shapes.
  4. Connection lifecycle. Reconnect, backpressure, etc. under admitted connection contract.

Realtime is admitted; apps do not invent their own polling protocols when realtime is available.

Reader Scenario: External System Bridges Realm

An external system wants to mirror Realm world history.

  1. Read via interop mapping. External system reads Realm history under admitted interop mapping.
  2. Translate to external shape. The mapping projects Realm concepts to external open-spec representations.
  3. External system consumes. No mutation flowing back unless admitted.

The bridge is one-directional read by default. A bidirectional bridge requires admitted bidirectional contract — not implicit.

Boundary Summary

ConcernOwner
Realm canonical truthRealm kernel
App access to RealmAdmitted REST + WS surfaces
App-world bindingApp authorization preset + binding contract
Realtime deliveryAdmitted subscription surface
External system bridgesRealm interop mapping
Cross-protocol shapeInterop mapping bridge

Source Basis

Nimi AI open world platform documentation.