# Klorad

> TypeScript SDK for digital twins on an Earth anchored world model: scenes, Digital Objects, Shadows and Twins, observations ordered by time, Actions checked by Entitlement, Worlds, alerts, and a three.js renderer.

All pages as one file: https://docs.klorad.com/llms-full.txt

## Docs

- [Physical correspondence](https://docs.klorad.com/concepts/correspondence): Digital Object, Digital Shadow, Digital Twin. Every Scene Object says how it relates to the physical world.
- [Overview](https://docs.klorad.com/concepts): The ideas behind the Klorad API, one per page, in the order the code builds on them.
- [Integration](https://docs.klorad.com/concepts/integration): Sources report readings about their own entities; connectSource routes them to the shadows and twins bound to them.
- [Interaction and actuation](https://docs.klorad.com/concepts/interaction): Action, Entitlement, Behaviour, Animation. How people change a twin, and how a twin commands a device, in one direction only.
- [The model](https://docs.klorad.com/concepts/model): Three layers, four pillars, and the rule that decides who may call whom.
- [Rendering](https://docs.klorad.com/concepts/rendering): Renderers draw what World defines, follow its events, and never change world state.
- [The scene and its events](https://docs.klorad.com/concepts/scene): The one place world state changes, and the ordered stream of events every change becomes.
- [Space](https://docs.klorad.com/concepts/space): Every scene is anchored on Earth. Positions are real places, and renderers still work in metres.
- [Time](https://docs.klorad.com/concepts/time): Readings are ordered by when they were observed, not when they arrived. Late data never overwrites a newer state.
- [Worlds and access](https://docs.klorad.com/concepts/worlds): One twin, many entitled views. A World decides which objects a group sees, what it may do, and who may enter.
- [Act on a twin](https://docs.klorad.com/guides/act-on-a-twin): Define an Action that sends a command to a device, check who may take it, and watch the twin follow the device.
- [Raise alerts](https://docs.klorad.com/guides/alerts): Rules over readings and Actions raise alerts, delivered only to the Worlds whose scope contains the object.
- [Connect a polling API](https://docs.klorad.com/guides/connect-a-polling-api): Read a vendor endpoint on an interval, validate what comes back, and route it to your shadows.
- [Give a team its own view](https://docs.klorad.com/guides/entitled-views): A district crew sees and acts on its own bins only, the city sees everything, and every Action is audited.
- [Guides](https://docs.klorad.com/guides): One task per page. Each guide assumes you have done the quickstart and shows the smallest code that does the job.
- [Save and restore a scene](https://docs.klorad.com/guides/save-and-restore): Snapshot a scene to JSON, with its objects and readings, and rebuild it elsewhere.
- [Style objects by readings](https://docs.klorad.com/guides/style-objects-by-readings): Colour and scale objects by their current state, and show when a sensor has gone quiet.
- [Test with a manual clock](https://docs.klorad.com/guides/test-with-a-manual-clock): Deterministic tests of staleness and ordering, with node:test and createManualClock.
- [Introduction](https://docs.klorad.com/get-started): What Klorad is, what you can build with it today, and how these docs are organised.
- [Install](https://docs.klorad.com/get-started/install): How access to the Klorad packages works, which ones your app needs, and how to install them locally and in CI.
- [Quickstart](https://docs.klorad.com/get-started/quickstart): Build a Next.js app that shows a building and a live occupancy sensor in 3D. About fifteen minutes.
- [@klorad/access](https://docs.klorad.com/reference/access): The Access layer. Worlds, the Entitlement the World layer asks, projections per World and the audit log.
- [@klorad/api/integration](https://docs.klorad.com/reference/api-integration): The Integration layer. Sources of readings, the connection that routes them, and a simulated device.
- [@klorad/api/world](https://docs.klorad.com/reference/api-world): The World layer. Scenes, Scene Objects, space, time, snapshots, interaction and projections. Pure TypeScript.
- [@klorad/engine-three](https://docs.klorad.com/reference/engine-three): Draws a scene with three.js, follows its events, and never changes world state.
- [For agents](https://docs.klorad.com/reference/for-agents): How a coding agent should read these docs and work with the SDK.
- [Reference](https://docs.klorad.com/reference): Every public package and export of the Klorad SDK, what it takes and what it returns.
- [@klorad/notify](https://docs.klorad.com/reference/notify): Rules over a scene's events raise alerts, addressed to Worlds and never wider than their scope.
- [@klorad/react](https://docs.klorad.com/reference/react): React bindings. Components declare what exists; hooks read and subscribe. No world logic.
- [Versions and releases](https://docs.klorad.com/reference/releases): How Klorad packages are versioned, released and checked before they reach you.
