From d56adcd558c264664951a04e6d83a1242b3b6f39 Mon Sep 17 00:00:00 2001 From: Rae McKelvey <633012+okdistribute@users.noreply.github.com> Date: Thu, 11 Jun 2026 11:04:14 -0700 Subject: [PATCH 1/3] Add quick reference to top of each language guide Each language page now opens with supported platforms (from the overview matrix), a link to the API reference, and an example app. Co-Authored-By: Claude Fable 5 --- languages/javascript.mdx | 4 ++++ languages/kotlin.mdx | 4 ++++ languages/python.mdx | 4 ++++ languages/rust.mdx | 4 ++++ languages/swift.mdx | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/languages/javascript.mdx b/languages/javascript.mdx index 9b2d73b..2808b00 100644 --- a/languages/javascript.mdx +++ b/languages/javascript.mdx @@ -3,6 +3,10 @@ title: "JavaScript" description: "Use iroh from Node.js via the iroh-ffi bindings." --- +- **Platforms:** Node.js 20.3+ on macOS (arm64), Linux (x86_64, aarch64 — glibc + musl, armv7), Windows (x86_64, aarch64), Android (aarch64, armv7) ([full matrix](/languages#platform-support)) +- **API reference:** [JavaScript API docs](https://n0-computer.github.io/iroh-ffi/js/) +- **Example code:** [iroh-js test scripts](https://github.com/n0-computer/iroh-ffi/tree/main/iroh-js/test) — runnable scripts exercising endpoints, keys, and relays + The JavaScript bindings to iroh are published on npm as [`@number0/iroh`](https://www.npmjs.com/package/@number0/iroh) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). They're built with [napi-rs](https://napi.rs/), so the package distributes prebuilt native binaries — no Rust toolchain or local compilation needed. ## Install diff --git a/languages/kotlin.mdx b/languages/kotlin.mdx index 50b2537..20bb9ac 100644 --- a/languages/kotlin.mdx +++ b/languages/kotlin.mdx @@ -3,6 +3,10 @@ title: "Kotlin" description: "Use iroh from Kotlin on the JVM or Android." --- +- **Platforms:** macOS (arm64, x86_64), Linux (x86_64, aarch64 — glibc), Windows (x86_64); Android (aarch64, armv7) via [building from source](#building-from-source) ([full matrix](/languages#platform-support)) +- **API reference:** [Kotlin API docs](https://n0-computer.github.io/iroh-ffi/kotlin/) +- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/kotlin-android) — Jetpack Compose demo streaming live positions between two devices + The Kotlin bindings live in [iroh-ffi](https://github.com/n0-computer/iroh-ffi), generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs) from the same Rust core as the Swift and Python bindings. Published to Maven Central as `computer.iroh:iroh`. ## Prerequisites diff --git a/languages/python.mdx b/languages/python.mdx index f12b3da..ad443a0 100644 --- a/languages/python.mdx +++ b/languages/python.mdx @@ -3,6 +3,10 @@ title: "Python" description: "Use iroh from Python via the iroh-ffi bindings." --- +- **Platforms:** macOS (arm64, x86_64), Linux (x86_64, aarch64 — glibc), Windows (x86_64) ([full matrix](/languages#platform-support)) +- **API reference:** [Python API docs](https://n0-computer.github.io/iroh-ffi/python/) +- **Example app:** [main.py](https://github.com/n0-computer/iroh-ffi/blob/main/python/main.py) — two-peer echo over QUIC + The Python bindings to iroh are published as prebuilt wheels on [PyPI](https://pypi.org/project/iroh/) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). The bindings are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs), so every class, method, and enum carries a docstring you can introspect from a REPL. ## Install diff --git a/languages/rust.mdx b/languages/rust.mdx index 9583820..5af8d10 100644 --- a/languages/rust.mdx +++ b/languages/rust.mdx @@ -3,6 +3,10 @@ title: "Rust" description: "Add iroh to your Rust project." --- +- **Platforms:** iOS, Android, macOS, Linux (glibc + musl), Windows — every officially supported platform ([full matrix](/languages#platform-support)) +- **API reference:** [docs.rs/iroh](https://docs.rs/iroh) +- **Example app:** [sendme](https://github.com/n0-computer/sendme) — CLI for direct file transfers between devices + iroh is written in Rust, so the Rust crate is the most fully-featured way to use it. Everything in these docs assumes Rust unless explicitly tagged otherwise. ## Install diff --git a/languages/swift.mdx b/languages/swift.mdx index 7ca20aa..88e9f80 100644 --- a/languages/swift.mdx +++ b/languages/swift.mdx @@ -3,6 +3,10 @@ title: "Swift" description: "Build an iOS + macOS app on top of iroh via the Swift bindings." --- +- **Platforms:** iOS (device + simulator), macOS (arm64) ([full matrix](/languages#platform-support)) +- **API reference:** [Swift API docs](https://n0-computer.github.io/iroh-ffi/swift/documentation/irohlib/) +- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/swift) — SwiftUI demo streaming live positions between two devices + The Swift bindings to iroh ship from [iroh-ffi](https://github.com/n0-computer/iroh-ffi) and are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs). The package distributes a prebuilt xcframework for iOS device, iOS simulator, and macOS, so adding iroh to your app is the same as adding any other Swift Package — no Rust toolchain required. This tutorial walks through creating a new Xcode project from scratch and wiring up a SwiftUI app that binds an iroh `Endpoint` and prints its endpoint id. From 0d19647f37fec3e874cfe1cafec82e198c2316bc Mon Sep 17 00:00:00 2001 From: Rae McKelvey <633012+okdistribute@users.noreply.github.com> Date: Thu, 11 Jun 2026 11:27:19 -0700 Subject: [PATCH 2/3] Use platform tables in language quick references Replace the inline platform lists with per-language tables and remove em dashes from the quick reference blocks. Co-Authored-By: Claude Fable 5 --- languages/javascript.mdx | 13 +++++++++++-- languages/kotlin.mdx | 11 +++++++++-- languages/python.mdx | 10 ++++++++-- languages/rust.mdx | 12 ++++++++++-- languages/swift.mdx | 9 +++++++-- 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/languages/javascript.mdx b/languages/javascript.mdx index 2808b00..20b03e8 100644 --- a/languages/javascript.mdx +++ b/languages/javascript.mdx @@ -3,9 +3,18 @@ title: "JavaScript" description: "Use iroh from Node.js via the iroh-ffi bindings." --- -- **Platforms:** Node.js 20.3+ on macOS (arm64), Linux (x86_64, aarch64 — glibc + musl, armv7), Windows (x86_64, aarch64), Android (aarch64, armv7) ([full matrix](/languages#platform-support)) +| Platform | Architectures | +| --- | --- | +| macOS | arm64 | +| Linux | x86_64, aarch64 (glibc and musl), armv7 | +| Windows | x86_64, aarch64 | +| Android | aarch64, armv7 | + +All platforms require Node.js 20.3.0 or newer. + - **API reference:** [JavaScript API docs](https://n0-computer.github.io/iroh-ffi/js/) -- **Example code:** [iroh-js test scripts](https://github.com/n0-computer/iroh-ffi/tree/main/iroh-js/test) — runnable scripts exercising endpoints, keys, and relays +- **Example code:** [iroh-js test scripts](https://github.com/n0-computer/iroh-ffi/tree/main/iroh-js/test), runnable scripts covering endpoints, keys, and relays +- **All languages:** [platform support matrix](/languages#platform-support) The JavaScript bindings to iroh are published on npm as [`@number0/iroh`](https://www.npmjs.com/package/@number0/iroh) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). They're built with [napi-rs](https://napi.rs/), so the package distributes prebuilt native binaries — no Rust toolchain or local compilation needed. diff --git a/languages/kotlin.mdx b/languages/kotlin.mdx index 20bb9ac..bbe1313 100644 --- a/languages/kotlin.mdx +++ b/languages/kotlin.mdx @@ -3,9 +3,16 @@ title: "Kotlin" description: "Use iroh from Kotlin on the JVM or Android." --- -- **Platforms:** macOS (arm64, x86_64), Linux (x86_64, aarch64 — glibc), Windows (x86_64); Android (aarch64, armv7) via [building from source](#building-from-source) ([full matrix](/languages#platform-support)) +| Platform | Architectures | +| --- | --- | +| macOS | arm64, x86_64 | +| Linux | x86_64, aarch64 (glibc) | +| Windows | x86_64 | +| Android | aarch64, armv7 (requires [building from source](#building-from-source)) | + - **API reference:** [Kotlin API docs](https://n0-computer.github.io/iroh-ffi/kotlin/) -- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/kotlin-android) — Jetpack Compose demo streaming live positions between two devices +- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/kotlin-android), a Jetpack Compose demo that streams live positions between two devices +- **All languages:** [platform support matrix](/languages#platform-support) The Kotlin bindings live in [iroh-ffi](https://github.com/n0-computer/iroh-ffi), generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs) from the same Rust core as the Swift and Python bindings. Published to Maven Central as `computer.iroh:iroh`. diff --git a/languages/python.mdx b/languages/python.mdx index ad443a0..e548258 100644 --- a/languages/python.mdx +++ b/languages/python.mdx @@ -3,9 +3,15 @@ title: "Python" description: "Use iroh from Python via the iroh-ffi bindings." --- -- **Platforms:** macOS (arm64, x86_64), Linux (x86_64, aarch64 — glibc), Windows (x86_64) ([full matrix](/languages#platform-support)) +| Platform | Architectures | +| --- | --- | +| macOS | arm64, x86_64 | +| Linux | x86_64, aarch64 (glibc) | +| Windows | x86_64 | + - **API reference:** [Python API docs](https://n0-computer.github.io/iroh-ffi/python/) -- **Example app:** [main.py](https://github.com/n0-computer/iroh-ffi/blob/main/python/main.py) — two-peer echo over QUIC +- **Example app:** [main.py](https://github.com/n0-computer/iroh-ffi/blob/main/python/main.py), a two-peer echo over QUIC +- **All languages:** [platform support matrix](/languages#platform-support) The Python bindings to iroh are published as prebuilt wheels on [PyPI](https://pypi.org/project/iroh/) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). The bindings are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs), so every class, method, and enum carries a docstring you can introspect from a REPL. diff --git a/languages/rust.mdx b/languages/rust.mdx index 5af8d10..32cc8ac 100644 --- a/languages/rust.mdx +++ b/languages/rust.mdx @@ -3,9 +3,17 @@ title: "Rust" description: "Add iroh to your Rust project." --- -- **Platforms:** iOS, Android, macOS, Linux (glibc + musl), Windows — every officially supported platform ([full matrix](/languages#platform-support)) +| Platform | Architectures | +| --- | --- | +| iOS | device and simulator | +| Android | aarch64, armv7 | +| macOS | arm64, x86_64 | +| Linux | x86_64, aarch64, armv7 (glibc and musl) | +| Windows | x86_64, aarch64 | + - **API reference:** [docs.rs/iroh](https://docs.rs/iroh) -- **Example app:** [sendme](https://github.com/n0-computer/sendme) — CLI for direct file transfers between devices +- **Example app:** [sendme](https://github.com/n0-computer/sendme), a CLI for direct file transfers between devices +- **All languages:** [platform support matrix](/languages#platform-support) iroh is written in Rust, so the Rust crate is the most fully-featured way to use it. Everything in these docs assumes Rust unless explicitly tagged otherwise. diff --git a/languages/swift.mdx b/languages/swift.mdx index 88e9f80..7234602 100644 --- a/languages/swift.mdx +++ b/languages/swift.mdx @@ -3,9 +3,14 @@ title: "Swift" description: "Build an iOS + macOS app on top of iroh via the Swift bindings." --- -- **Platforms:** iOS (device + simulator), macOS (arm64) ([full matrix](/languages#platform-support)) +| Platform | Architectures | +| --- | --- | +| iOS | device and simulator | +| macOS | arm64 | + - **API reference:** [Swift API docs](https://n0-computer.github.io/iroh-ffi/swift/documentation/irohlib/) -- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/swift) — SwiftUI demo streaming live positions between two devices +- **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/swift), a SwiftUI demo that streams live positions between two devices +- **All languages:** [platform support matrix](/languages#platform-support) The Swift bindings to iroh ship from [iroh-ffi](https://github.com/n0-computer/iroh-ffi) and are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs). The package distributes a prebuilt xcframework for iOS device, iOS simulator, and macOS, so adding iroh to your app is the same as adding any other Swift Package — no Rust toolchain required. From f016ad91e84e0dd36ebbd1b61b4dd00d8edcb452 Mon Sep 17 00:00:00 2001 From: Rae McKelvey <633012+okdistribute@users.noreply.github.com> Date: Thu, 11 Jun 2026 11:33:28 -0700 Subject: [PATCH 3/3] Remove em dashes from language guide prose Co-Authored-By: Claude Fable 5 --- languages/javascript.mdx | 4 ++-- languages/kotlin.mdx | 8 ++++---- languages/python.mdx | 2 +- languages/swift.mdx | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/languages/javascript.mdx b/languages/javascript.mdx index 20b03e8..03d5ca6 100644 --- a/languages/javascript.mdx +++ b/languages/javascript.mdx @@ -16,7 +16,7 @@ All platforms require Node.js 20.3.0 or newer. - **Example code:** [iroh-js test scripts](https://github.com/n0-computer/iroh-ffi/tree/main/iroh-js/test), runnable scripts covering endpoints, keys, and relays - **All languages:** [platform support matrix](/languages#platform-support) -The JavaScript bindings to iroh are published on npm as [`@number0/iroh`](https://www.npmjs.com/package/@number0/iroh) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). They're built with [napi-rs](https://napi.rs/), so the package distributes prebuilt native binaries — no Rust toolchain or local compilation needed. +The JavaScript bindings to iroh are published on npm as [`@number0/iroh`](https://www.npmjs.com/package/@number0/iroh) and shipped from [iroh-ffi](https://github.com/n0-computer/iroh-ffi). They're built with [napi-rs](https://napi.rs/), so the package distributes prebuilt native binaries. No Rust toolchain or local compilation is needed. ## Install @@ -50,7 +50,7 @@ await ep.close() A minimal sender/receiver pair over a bidirectional stream: ```javascript -// main.mjs — run: `node main.mjs receiver` or `node main.mjs sender ` +// main.mjs: run `node main.mjs receiver` or `node main.mjs sender ` import { Endpoint, EndpointTicket } from '@number0/iroh' const ALPN = Array.from(Buffer.from('hello-iroh/0')) diff --git a/languages/kotlin.mdx b/languages/kotlin.mdx index bbe1313..1bdbe53 100644 --- a/languages/kotlin.mdx +++ b/languages/kotlin.mdx @@ -36,7 +36,7 @@ dependencies { ``` -The published artifact is single-platform — it does not yet ship a multiplatform build, so it won't cover Android or arbitrary host triples out of the box. If you need a target the artifact doesn't cover, [build the bindings from source](#building-from-source). +The published artifact is single-platform. It does not yet ship a multiplatform build, so it won't cover Android or arbitrary host triples out of the box. If you need a target the artifact doesn't cover, [build the bindings from source](#building-from-source). ## Hello, iroh @@ -56,7 +56,7 @@ fun main() = runBlocking { } ``` -Drop this in any module that depends on the generated `computer.iroh` package. The API mirrors the Swift and Python bindings — same `Endpoint.bind`, same `EndpointOptions`, same presets. +Drop this in any module that depends on the generated `computer.iroh` package. The API mirrors the Swift and Python bindings: same `Endpoint.bind`, same `EndpointOptions`, same presets. ## Next steps @@ -78,13 +78,13 @@ Drop this in any module that depends on the generated `computer.iroh` package. T ## Foreground and backgrounding -On Android, the OS aggressively suspends background processes — sockets get torn down, threads stop scheduling, and an iroh endpoint that was happily accepting connections a moment ago goes silent. Treat each foreground/background transition as a lifecycle event for your endpoint: +On Android, the OS aggressively suspends background processes: sockets get torn down, threads stop scheduling, and an iroh endpoint that was happily accepting connections a moment ago goes silent. Treat each foreground/background transition as a lifecycle event for your endpoint: - **Going to background**: call `ep.shutdown()` to close cleanly and release sockets. Persist the endpoint's secret key (`ep.secretKey().toBytes()`) somewhere durable (e.g. `EncryptedSharedPreferences`) so the next bind keeps the same endpoint id. - **Returning to foreground**: re-bind with `EndpointOptions(secretKey = persistedBytes, preset = presetN0(), ...)`. Discovery republishes the new direct addresses automatically. - **Staying live while backgrounded**: run iroh inside an [Android foreground service](https://developer.android.com/develop/background-work/services/foreground-services) (with the appropriate `FOREGROUND_SERVICE_*` permission for your use case). Without one, Android will eventually kill the network sockets regardless of how the coroutine scope is structured. -For desktop JVM apps these constraints don't apply — keep the endpoint bound for the lifetime of the process and call `shutdown()` on exit. +For desktop JVM apps these constraints don't apply. Keep the endpoint bound for the lifetime of the process and call `shutdown()` on exit. ## Building from source diff --git a/languages/python.mdx b/languages/python.mdx index e548258..2676c26 100644 --- a/languages/python.mdx +++ b/languages/python.mdx @@ -86,7 +86,7 @@ The [main.py example](https://github.com/n0-computer/iroh-ffi/blob/main/python/m # Terminal 1 python main.py serve -# Terminal 2 — paste the ticket printed from Terminal 1 +# Terminal 2: paste the ticket printed from Terminal 1 python main.py connect ``` diff --git a/languages/swift.mdx b/languages/swift.mdx index 7234602..ff8b31e 100644 --- a/languages/swift.mdx +++ b/languages/swift.mdx @@ -12,7 +12,7 @@ description: "Build an iOS + macOS app on top of iroh via the Swift bindings." - **Example app:** [hello-iroh-ffi](https://github.com/n0-computer/hello-iroh-ffi/tree/main/swift), a SwiftUI demo that streams live positions between two devices - **All languages:** [platform support matrix](/languages#platform-support) -The Swift bindings to iroh ship from [iroh-ffi](https://github.com/n0-computer/iroh-ffi) and are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs). The package distributes a prebuilt xcframework for iOS device, iOS simulator, and macOS, so adding iroh to your app is the same as adding any other Swift Package — no Rust toolchain required. +The Swift bindings to iroh ship from [iroh-ffi](https://github.com/n0-computer/iroh-ffi) and are generated by [uniffi-rs](https://github.com/mozilla/uniffi-rs). The package distributes a prebuilt xcframework for iOS device, iOS simulator, and macOS, so adding iroh to your app is the same as adding any other Swift Package, with no Rust toolchain required. This tutorial walks through creating a new Xcode project from scratch and wiring up a SwiftUI app that binds an iroh `Endpoint` and prints its endpoint id. @@ -133,7 +133,7 @@ Pick a destination and hit Run. - **iOS Simulator**: choose any iPhone simulator destination. - **iOS device**: select your device. You'll need to trust your developer certificate in **Settings → General → VPN & Device Management** the first time. -Two different installs print two different endpoint ids — that's expected, since each launch generates a fresh `SecretKey`. If you want a stable identity across launches, persist `endpoint.secretKey().toBytes()` (e.g. in `UserDefaults` for a demo, Keychain for production) and pass it back via `EndpointOptions(secretKey: ...)` on subsequent launches. +Two different installs print two different endpoint ids. That's expected, since each launch generates a fresh `SecretKey`. If you want a stable identity across launches, persist `endpoint.secretKey().toBytes()` (e.g. in `UserDefaults` for a demo, Keychain for production) and pass it back via `EndpointOptions(secretKey: ...)` on subsequent launches. ## Building against an unreleased iroh-ffi @@ -160,7 +160,7 @@ Then in Xcode, **File → Add Package Dependencies… → Add Local…** and pic - Full DocC reference for `IrohLib` — every type, method, and option generated from the bindings. + Full DocC reference for `IrohLib`: every type, method, and option generated from the bindings. @@ -173,12 +173,12 @@ Then in Xcode, **File → Add Package Dependencies… → Add Local…** and pic ## Troubleshooting -**`Undefined symbols: _nw_interface_get_index` on iOS.** You skipped step 3 — add `-framework Network` to **Other Linker Flags** for the iOS SDKs. +**`Undefined symbols: _nw_interface_get_index` on iOS.** You skipped step 3. Add `-framework Network` to **Other Linker Flags** for the iOS SDKs. -**`product being built is not an allowed client of SwiftUICore`.** You skipped step 5 — set **Enable Previews** to **No**. +**`product being built is not an allowed client of SwiftUICore`.** You skipped step 5. Set **Enable Previews** to **No**. **`No such module 'IrohLib'`.** The package didn't resolve. Pull down the package from **File → Packages → Reset Package Caches** and try the resolve again. -**`bind failed: NoNetwork` or hang on macOS.** Check **Signing & Capabilities** — both **Incoming** and **Outgoing** network sandbox boxes need to be checked. +**`bind failed: NoNetwork` or hang on macOS.** Check **Signing & Capabilities**: both **Incoming** and **Outgoing** network sandbox boxes need to be checked. **`The developer disk image could not be mounted on this device`.** Your device is running a newer iOS than your Xcode supports. Update Xcode (App Store for stable, [developer.apple.com](https://developer.apple.com/download/applications) for betas) so the matching Developer Disk Image is available, or fall back to the simulator while you wait.