> ## Documentation Index
> Fetch the complete documentation index at: https://www.offlineprotocol.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs target Mesh SDK v0.30.0. Match the installed package and binding before generating code. Start at /getting-started/agents for task-specific reading paths. Apps that call enableTelemetry on 0.26.0 to 0.29.0 should update to 0.30.0: the telemetry uploader now trusts only the telemetry endpoint's issuing roots.
> Call the company and product Offline Protocol, never Offline alone. Current packages: @offline-protocol/mesh-sdk 0.30.0 (React Native), offline-protocol-sdk 0.30.0 on PyPI (Python 3.10 to 3.13; wheels for macOS 14+ arm64, Linux x86_64 and aarch64 with glibc 2.34+, Windows x86_64; other hosts build from source; extras lan and http add LAN discovery, the HTTP front and offline-protocol-verify), the offline-protocol crates 0.30.0 on crates.io, the OfflineProtocolSDK Swift package 0.30.0 (preview, iOS 13+ only), the Android library com.offlineprotocol:offline-protocol-sdk 0.30.0 on Maven Central (preview, minSdk 24), the Java binding com.offlineprotocol:offline-protocol-java 0.30.0 on Maven Central (JDK 22+, native library from the GitHub release's desktop archives), the C header offline_protocol.h with the native library in the GitHub release's desktop archives, the offline_protocol Flutter plugin (preview, not on pub.dev; a path dependency on the SDK repository at tag v0.30.0), @offline-protocol/id-react 0.2.0, @offline-protocol/id-react-native 0.3.3, @offline-protocol/pol 0.1.2 and @offline-protocol/cli 0.2.8. Canonical docs URLs start with https://www.offlineprotocol.com/docs.
> The Mesh SDK runs in a native app or gateway. A browser OfflineID SDK integration does not provide browser mesh transport. Local mesh operation does not require a portal account or API key. The Mesh SDK appId is a mesh app identifier the developer chooses, not the portal App ID (app_...) that OfflineID and Proof of Location require.
> In v0.30.0 service RPC bodies are sealed in the 1:1 MLS session once the recipient runs 0.29 or later and the session is confirmed; discovery, the first request to a provider never met, and requests to older peers are signed plaintext, so keep secrets out of service bodies unless the event says encrypted: true. The HTTP front (offline-protocol-service --http) always carries calls inside encrypted direct messages but does not authorize callers. Message delivery, durable local acceptance and backend commit are distinct outcomes. Use the workflow guide for the required application logic.
> Offline Protocol CLI 0.2.8 is on npm (@offline-protocol/cli, command offline). Its local MCP server, named offline-protocol, runs with npx -y @offline-protocol/cli@0.2.8 mcp serve and requires no login or key. Hosted MCP is at https://mcp.offlineprotocol.com/mcp with an app API key in Authorization: Bearer and the matching App ID in x-app-id; organization keys are rejected, and Claude Desktop and Claude.ai cannot send these headers; there, use the public read-only endpoint https://mcp.offlineprotocol.com/public/mcp as a custom connector, or local MCP to scaffold or edit projects. Follow /tools/overview for setup and do not invent commands beyond it. MCP provides integration context and planning, not mesh execution; file-writing tools are local only.
> In v0.30.0 phone Wi-Fi peer streams carry data: Android over Wi-Fi Direct (the SDK forms the group with autoAccept on Android 10+) and over the Wi-Fi network it is on (DNS-SD), iOS over Network framework (LAN or AWDL). Android and iOS meet over that slot only on a shared Wi-Fi network that allows multicast; iOS 0.28 and later does not see iOS 0.27 or earlier over it. Otherwise use BLE or a provisioned relay across platforms. The Swift and Android packages are previews whose public names may change; the Android library is on Maven Central from 0.29.0 only, so never give a Gradle line for an earlier version. The receiver core ACKs before application persistence; use application acceptance for durable workflows.
> Proof of Location is Sepolia testnet witness evidence, not zero-knowledge proof or proof of presence. The geohash is public onchain. Read /proof-of-location/security before integration.

# Flutter plugin (preview)

> Preview Flutter plugin in Mesh SDK v0.30.0: host the engine on iOS and Android from Dart, from the SDK repository as a path dependency.

From v0.30.0 the SDK has a Flutter plugin, `offline_protocol`, that hosts the engine on iOS and Android from Dart. It is a preview. It compiles the same native bridge sources as the React Native module, so a transport fix reaches both, but it exposes a smaller API. For a phone app you ship today, use [React Native](https://www.offlineprotocol.com/docs/mesh-sdk/installation-rn.md).

The plugin is not on pub.dev. Depend on it by path from a checkout of the SDK repository at the release tag.

## Requirements

| Requirement | Value |
| - | - |
| Flutter | 3.10 or later |
| iOS | 13.0 or later |
| Android | API 24 (Android 7.0) or later |
| Build tools | The Rust toolchain (1.91 or newer) and a one-time build of the mobile native libraries |

## Add the plugin

Check out the SDK at the release tag and build the mobile libraries, the same steps as the React Native module:

```bash theme={null}
git clone --branch v0.30.0 --depth 1 https://github.com/Offline-Protocol/offline-protocol-sdk.git
cd offline-protocol-sdk
./scripts/generate-bindings.sh
cd bindings/react-native
npm run build:uniffi:all
```

Then depend on the plugin by path in your app's `pubspec.yaml`:

```yaml theme={null}
dependencies:
  offline_protocol:
    path: ../offline-protocol-sdk/bindings/flutter/offline_protocol   # adjust for your layout
```

Use the same permissions and manifest entries as React Native: Bluetooth usage descriptions and the `bluetooth-central` and `bluetooth-peripheral` background modes on iOS, and the Bluetooth, location and nearby Wi-Fi runtime permissions on Android. See [React Native installation](https://www.offlineprotocol.com/docs/mesh-sdk/installation-rn.md).

On iOS, `pod install` copies the shared Swift bridge sources into the plugin. If you change those sources, run `bindings/flutter/offline_protocol/ios/sync_bridge_rn.sh` and `pod install` again, or the build compiles the old copy.

## Quick start

Subscribe to events before `createFromConfig` if you need every event, including gap recovery through native replay:

```dart theme={null}
import 'package:offline_protocol/offline_protocol.dart';

final sub = OfflineProtocol.events.listen((e) {
  final type = e.decodeEvent()['type'];
  // message_received, diagnostics, …
});

await OfflineProtocol.createFromConfig({
  'appId': 'com.example.app',
  'profile': 'default',
  'bleEnabled': true,
  'internetEnabled': true,
  'transports': {
    'internet': {
      'enabled': true,
      'serverAddress': 'wss://relay.example.com',
    },
    'wifiDirect': {'enabled': true},
  },
});
await OfflineProtocol.initializeMlsWithSecureStorage();
await OfflineProtocol.start();

final messageId = await OfflineProtocol.sendMessage(
  recipient: 'off1…',
  content: 'Hello',
);
```

Configuration fields and transport behaviour match React Native; see [configuration](https://www.offlineprotocol.com/docs/mesh-sdk/configuration.md). The engine runs on a dedicated thread, and method-channel results and events are delivered on the main isolate's platform thread.

## What the plugin covers

| Area | Dart API |
| - | - |
| Lifecycle | `createFromConfig`, `initializeMlsWithSecureStorage`, `start`, `stop`, `destroy` |
| Identity | `localAddress` |
| Messaging | `sendMessage` |
| Events | `OfflineProtocol.events`, with the same sequence numbers and gap replay as React Native |
| Internet relay | `enableInternetTransport`, or enabled after `start()` when `transports.internet` has a `serverAddress` |
| Bluetooth LE | Started when `bleEnabled` is true; `enableTransport('ble', …)` |
| Wi-Fi Direct and peer streams | `enableTransport('wifiDirect', …)`, or enabled when configured |

Not in the plugin yet: Nostr, Reticulum, telemetry and the React Native foreground mesh service. `createFromConfig` refuses a configuration with `reticulumEnabled` or `nostrEnabled` set. Groups, shared documents, services and file transfer are not in the Dart API in this release; use React Native for those.

CI runs the plugin's Dart tests and builds its Android library. No CI job compiles the iOS plugin yet.

## Reference

* [Flutter plugin README](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/v0.30.0/bindings/flutter/README.md), including the example app.
* [Flutter bridge contract](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/v0.30.0/docs/bridges/flutter.md): threading, shared sources and event delivery.

The SDK is AGPL-3.0-only with a commercial license available; see [licensing](https://www.offlineprotocol.com/docs/operations/licensing.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.