FOR DEVELOPERS / RUNTIME 0.2.0
Web & WASM.
A native home.
Ship a static build and a manifest. Capsula runs it in a native app library on iOS and Android, with an optional native bridge for invitation-based peer connections.
One portable package.
A .bin file is a ZIP archive containing manifest.json and a dist/ directory. The entry points to the app’s HTML file.
my-app.bin
├── manifest.json
└── dist/
├── index.html
└── assets/
Build for the container.
Use relative asset paths and package the interface and its assets together. Each app runs under its own origin, with browser storage for local data. The hosts use SwiftUI and WebKit on iOS, and Kotlin, Compose and WebView on Android.
Review before installing.
The native library shows package details and declared permissions before installation or replacement. Installed apps can be searched, inspected and removed from the library.
Connect to your backend.
Enable permissions.network and declare an HTTPS apiOrigin to access your backend through /api/*. External navigation is blocked.
The starting manifest.
{
"schemaVersion": 1,
"id": "com.example.myapp",
"name": "My App",
"version": "1.0.0",
"entry": "dist/index.html",
"minimumRuntimeVersion": "0.2.0",
"permissions": {
"network": false,
"camera": false,
"microphone": false,
"p2p": false
}
}
P2P is off by default and is separate from HTTP network permission. Set permissions.p2p to true for an app that uses the native peer bridge; a P2P-only app needs no apiOrigin.
Invite a peer.
Both hosts use Iroh for authenticated peer connections through Capsula.p2p. A peer needs Capsula, the same installed app, and an invitation exchanged through a trusted channel.
Invitations expire after 15 minutes and are single-use. Connections support up to eight peers, with four as the default. send(text, peerID) targets a peer; receiveFrom() returns messages with the authenticated sender.
Direct paths and relays.
The default configuration uses Iroh’s lookup and relay infrastructure. Apps can configure custom HTTPS relays or exchange address hints through invitations. Both apps must remain open; backgrounding a host closes its sessions.
Native hosts only.
Check available before calling the SDK. Ordinary browsers do not have the native transport; a browser WebRTC adapter is not implemented. This website does not connect peers.
Start a connection.
// Declare permissions.p2p: true in the package manifest.
const p2p = globalThis.Capsula?.p2p;
if (p2p?.available) {
await p2p.configure({
mode: 'default', relays: [], maxPeers: 4
});
const invitation = await p2p.invite();
// Share through a trusted channel. The other device uses:
// await p2p.connect(invitation);
}
Bridge requests are restricted to the installed app’s main frame and origin with P2P permission. Native endpoint keys stay in the host.
Signed content and files.
The Content Copies reference app adds immutable SHA-256 references and signed publication history. A retained copy can be served to another peer while its original publisher is offline, when sharing is explicitly enabled.
Encrypted fragments.
File Fragments adds signed manifests, verified binary chunks and optional AES-256-GCM encryption. Private imports encrypt the filename too. A reader reference includes the decryption key; a holder reference omits it. Treat reader references as private access credentials.
Imports keep a complete pinned local copy without changing the original system file. Other devices can retain selected fragments within independently chosen budgets. Reconstruction needs every distinct chunk and verifies hashes, authentication tags and lengths.
Bounded experiments.
The file reference app currently limits files to 4 MiB, 128 chunks and eight known manifests, with per-device fragment storage budgets up to 32 MiB. Smaller chunk sizes can lower the file-size limit.
Hosting is opt-in and resets to off after reopening. Storage is app-local and can be cleared or evicted by the device. Withdrawing a share does not erase copies already retained by peers.
These are reference protocols over the native channel. They do not provide a general distributed database, automatic backups or package updates. Received executable files are not installed or run.
Web, WASM & native code.
Web packages run in the platform WebView. Tools like ScriptC can compile a core to WebAssembly alongside its web interface. Standalone native executable packages are rejected; additional native capabilities require host integration.
Still an experiment.
Current builds target iOS 17.5+ and Android 8+. Public downloads are not available yet. Packages are unsigned, so use packages from trusted developers. Camera and microphone access, push notifications, package signing and authenticated update delivery are not implemented. Signed content history does not establish installer trust.
Talk to Wolff Solutions ↗