Reference · toolkit
SDKs and npm packages.
Three packages are published on npm for building apps and themes against rumahl OS. The shell and the SSR server stay inside the workspace, because they are the platform rather than an app dependency.
This page is written against the current checkout and the public registry. The packages are early: the registry and the local source can be at different points in time. Pin the exact version you tested and check the exports you import.
Published packages
| Package | Latest | Use | Where |
|---|---|---|---|
@rumahl/ui | 0.1.0 | RUI components, tokens, themes, icons and CSS | npm |
@rumahl/bridge-client | 0.1.0 | Typed client for rumahl.bridge.v1 | npm |
@rumahl/contracts | 0.1.0 | Bridge, event, widget and snapshot types | npm |
@rumahl/shell | — | The first-party OS shell React app | workspace |
@rumahl/ssr | — | Server rendering and shell response | workspace |
rumahl-package | — | Keygen, sign and verify packages | repo binary |
Install
Install the three public packages with the version you verified. The bridge client depends on the matching contracts version.
# pnpm
pnpm add @rumahl/ui@0.1.0 @rumahl/bridge-client@0.1.0 @rumahl/contracts@0.1.0
# npm
npm install @rumahl/ui@0.1.0 @rumahl/bridge-client@0.1.0 @rumahl/contracts@0.1.0
| Requirement | What you need |
|---|---|
| Node.js | >=20 for every published package |
| React | >=19 as a peer dependency of @rumahl/ui |
| Bundler | ESM support and CSS imports, for example Vite or Next.js |
| Next.js | Add @rumahl/ui to transpilePackages if your setup does not transpile package JavaScript automatically |
RUI components and themes
@rumahl/ui is the operating-system design system. It is not RWDS. Import the styles once, wrap the app in ThemeProvider and use semantic tokens instead of local colors.
import { Button, GroupContainer, GroupRow } from "@rumahl/ui/components";
import "@rumahl/ui/base.css";
import "@rumahl/ui/primitives.css";
export function Example() {
return (
<GroupContainer>
<GroupRow>
<Button variant="primary">Continue</Button>
</GroupRow>
</GroupContainer>
);
}
| Entry point | What it exposes |
|---|---|
@rumahl/ui | Tokens, color helpers, theme registry, slots and the SDK |
@rumahl/ui/components | React components and controls |
@rumahl/ui/icons | The system icon set |
@rumahl/ui/i18n | The German and English message catalog provider |
@rumahl/ui/*.css | Base, materials, primitives, controls and component styles |
See Create a theme for the token and package workflow. The theme package format is separate from the npm component package.
Bridge client
@rumahl/bridge-client is framework-agnostic. It performs the hello/welcome handshake, binds messages to the parent frame and exposes typed helpers. Outside the shell, available is false and calls reject instead of hanging.
import { connectRumahlBridge } from "@rumahl/bridge-client";
const rumahl = connectRumahlBridge();
await rumahl.ready();
const info = await rumahl.info();
const theme = await rumahl.theme();
const settings = await rumahl.settings();
await rumahl.notify({ message: "Synced", variant: "success" });
rumahl.watchTheme((next) => applyTheme(next));
rumahl.window.minimize();
| Helper | Purpose |
|---|---|
info() | Bounded app and account information |
theme() / watchTheme() | Read the semantic palette and follow changes |
notify() | Send a user notification |
settings() / setSettings() | Read or write the app’s own settings; secrets are write-only |
requestNetwork() | Brokered HTTP(S) request to a consented origin |
provide() | Register a provided capability handler |
invokeCapability() | Call another app’s capability through the platform |
window.* | Close, minimize or focus the app window |
A method is refused unless the signed manifest declares the matching capability. The npm package does not bypass the platform’s consent, lease or origin checks.
Contracts
@rumahl/contracts/bridge owns the protocol version, the complete method union, capability ids and message types. Use it instead of copying string literals into an app.
import {
RUMAHL_BRIDGE,
RUMAHL_BRIDGE_VERSION,
BRIDGE_METHODS,
BRIDGE_CAPABILITIES
} from "@rumahl/contracts/bridge";
RUMAHL_BRIDGE; // "rumahl.bridge.v1"
RUMAHL_BRIDGE_VERSION; // 1
BRIDGE_METHODS; // the complete v1 method surface
BRIDGE_CAPABILITIES.window; // "com.rumahl.os.window"
| Entry point | What it validates or exposes |
|---|---|
@rumahl/contracts | Snapshot and contribution types for UI contract v1 |
@rumahl/contracts/parse | Bounded shell snapshot parsers |
@rumahl/contracts/events | Shell event parser |
@rumahl/contracts/widget | Widget frame descriptor validation |
@rumahl/contracts/bridge | The rumahl.bridge.v1 message contract |
The protocol is versioned. New methods are additive; a caller should still check the app’s declared capabilities and handle a refusal.
Workspace-only packages
@rumahl/shell and @rumahl/ssr are first-party applications, not an SDK. They are consumed inside the rumahl frontend workspace and are not published to npm. Cloning the repository is the supported way to run or modify them.
git clone https://github.com/rumahl/rumahl.git
cd rumahl
pnpm --dir frontend install --frozen-lockfile
The local package manifests keep private: true. The public tarballs are built artifacts; do not infer that the source tree and the registry metadata are byte-identical.
Package CLI
cargo run -p rumahl-app-packages --bin rumahl-package -- keygen \
--key-id example-1 --publisher com.example --keystore keys/example.json
cargo run -p rumahl-app-packages --bin rumahl-package -- sign \
--package dist/notes --manifest dist/notes/package.json \
--keystore keys/example.json
cargo run -p rumahl-app-packages --bin rumahl-package -- verify \
--package dist/notes --trust-store trust.json
The CLI is a Rust binary in the repository. It is not part of the npm packages and does not read a shell session.
Versions and compatibility
Package versions, contract versions and the OS release are separate promises. A new SDK patch does not silently change formatVersion or rumahl.bridge.v1.
| Version surface | Current | Rule |
|---|---|---|
@rumahl/ui | 0.1.0 | Pin exact; 0.1.1 exists but is not the latest tag |
@rumahl/bridge-client | 0.1.0 | Keep it aligned with contracts 0.1.0 |
@rumahl/contracts | 0.1.0 | Use the matching protocol version |
| Bridge protocol | rumahl.bridge.v1 | Additive methods; unknown required versions are unsupported |
| Package format | formatVersion: 1 | The signed manifest is authoritative |
See Versions and compatibility for the complete contract table and the rules for updates.
Platform APIs
The HTTP API, bridge, OIDC and store source endpoints are documented in the API reference. SDK helpers do not change the server-side authorization boundary; they only make the calls typed.
Next
- Bridge SDK reference — the complete app-side contract.
- Permissions and capabilities — app-to-app calls.
- Publish an app — package and store metadata.
- Create a theme — RUI tokens and packages.
Was this page helpful?