Choosing adapters
The four adapter slots, which are required, the honest maturity of each shipped option, and how to decide.
- Status
- stable
- Applies to
- 15.0.0
- Platforms
- All
- Prereqs
- Quickstart
- Reading time
- 8 min
The SDK is a protocol core with four pluggable slots. Composition is the API: what you pass here determines where keys live, who can deliver messages, and what your backend can see. Adapters are security boundaries, not convenience callbacks.
const signal = await createSignalProtocolClient({
identity: { userId, deviceId, enablePniKeys },
adapters: {
storage, // required
relay, // optional
remoteObjectStore, // optional
protocolManager, // advanced
},
protocol: { /* ... */ },
});Note the shape: only those four live under adapters. Everything else, logger, hooks, sealedSender, groups, prekey timings, is a top-level field on the config.
The four slots
| Slot | Interface | Required | What it owns |
|---|---|---|---|
storage | SignalProtocolLocalStore | yes | Device-local protocol state: identity keys, prekeys, sessions, ratchet state, contact trust |
relay | SignalProtocolRelayServer | no | Public key distribution, device registry, envelope delivery |
remoteObjectStore | SignalProtocolRemoteObjectStore | no | Brokered upload and download of encrypted attachment bytes |
protocolManager | SignalProtocolManager | no | Advanced override, mainly for tests |
The design requires only storage. You can replace delivery or omit the relay. The local test path still encrypts and decrypts. You cannot omit the store because it holds ratchet state. If you lose the store, no server copy can recover it.
Storage adapters
npm install @open-e2ee/signal-protocol-sdk@latest expo-secure-store expo-sqlite| Adapter | Subpath | Exports | Status |
|---|---|---|---|
| Expo | /local/store/expo | ExpoSignalProtocolStore, expoStore() | Primary. Requires a development build; SQLCipher is not available in Expo Go. In an Expo web build, an encrypted open fails with KEY_STORAGE_ERROR. |
| React Native (bare) | /local/store/react-native | ReactNativeSignalProtocolStore, reactNativeStore() | Supported. SQLCipher on op-sqlite in an SDK-owned database; requires the op-sqlite SQLCipher build and a native build. Not available in Expo Go. |
| Node and Electron | /local/store/node | NodeSignalProtocolStore, nodeStore() | Supported. SQLCipher on better-sqlite3-multiple-ciphers in an SDK-owned database; you pass the vault. In Electron, open it in the main process. |
| Web, SQLite | /local/store/web-sqlite | WebSqliteSignalProtocolStore, webSqliteStore() | Supported. Encrypted SQLite in the origin private file system, in an SDK-owned database; needs a CSP that allows 'wasm-unsafe-eval'. Also the store for a Tauri 2 webview. |
| Web | /local/store/web | IndexedDbSignalProtocolStore, indexedDbStore() | Supported. For browsers without the origin private file system. Full store contract; its graduation gates run in real Chromium, Firefox, and WebKit on every change. Deployment requires the browser threat model review. |
| Key-value | /local/store/key-value | KeyValueSignalProtocolStore, keyValueStore() | Supported. Full store contract; you supply the key-value backend and verify it with the exported backend-conformance kit. |
| In-memory | /local/store/memory | InMemorySignalProtocolStore, inMemoryStore() | Development only. Everything is lost on restart. |
Every store carries the same contract
Each shipped store declares implements SignalProtocolLocalStore and carries the full contract. This includes Expo, bare React Native, Node, both web stores, key-value, and in-memory. The contract includes the Sesame device store, sender-key store, and message-record store. Multi-device and both group APIs therefore work on every store, including Node.
Factory call shapes differ, and this catches people porting between runtimes:
inMemoryStore() // synchronous
await expoStore(options?) // async
await indexedDbStore() // async
await webSqliteStore(options?) // async
await reactNativeStore(options?) // async
await nodeStore(options) // async; directory and vault are required
await keyValueStore(options) // asyncThere is a fifth piece that is not a store: the secret vault, SignalProtocolLocalSecretVault, with ExpoSecureStoreSignalProtocolSecretVault at /local/vault/expo-secure-store, ReactNativeKeychainSignalProtocolSecretVault at /local/vault/react-native-keychain, and ElectronSafeStorageSignalProtocolSecretVault at /local/vault/electron-safe-storage. It holds small bootstrap secrets, in the OS keychain except for the web SQLite store's default IndexedDB vault: for each SQLite store, one 32-byte database key; for the key-value store, the 32-byte key that encrypts each stored value. A plain Node process has no SDK vault, so pass one over the secret store of your deployment. Platform secret managers are appropriate for tiny keys and bootstrap values, not full session databases. Do not try to put protocol state in it.
Relay adapters
| Adapter | Subpath | Exports | Status |
|---|---|---|---|
| OpenE2EE Signal Protocol Relay | package root | createHostedSignalProtocolClient() | Built to work with this SDK. Start on a Sandbox environment. See Signal Protocol Relay. |
| Custom transport | /remote/signal-relay | SignalProtocolRelayServer (type only) | You implement it and pass it to createSignalProtocolClient(). You operate the authenticated backend. |
The package contains no relay implementation.
Omitting relay gives you local-only mode: real encryption and decryption, no distribution. That is a legitimate configuration for tests and for a first integration where you want the protocol working before the backend exists.
Before you implement SignalProtocolRelayServer, read reference → adapters. The relay must preserve one-time-prekey consumption during concurrent requests. It must never issue a consumed prekey as unused.
Object store adapters
| Adapter | Subpath | Exports |
|---|---|---|
| Convex R2 | /remote/object-store/convex-r2 | ConvexR2ObjectStore, convexR2ObjectStore(), ConvexR2ObjectStoreApi |
| S3 | /remote/object-store/s3 | S3ObjectStore, s3ObjectStore() |
Both are brokered, and this is not an implementation detail. An authenticated application backend maps a request to a canonical object ID and a private provider key, and issues scoped URLs. Cloud credentials and unrestricted provider clients do not belong in the app runtime. If you choose an adapter that takes an access key in the client, you choose the wrong adapter.
These adapters apply to createSignalProtocolClient(). The hosted client takes no remoteObjectStore, because the Relay transport supplies the object store. Omit remoteObjectStore from createSignalProtocolClient() and file upload operations throw. See encrypted attachments.
How to decide
Start from your runtime, because storage is the only required slot and it is the most constrained choice:
- Shipping an Expo app → use the Expo store and secure-store vault. Plan for a development build.
- Shipping a web app → use the web SQLite store. It needs the origin private file system and a CSP with
'wasm-unsafe-eval'. Where the origin private file system is not available, the open fails withOPFS_UNAVAILABLE; use the IndexedDB store there. Evaluate the browser threat model separately from the adapter. - Shipping a bare React Native app → use the React Native store and the react-native-keychain vault. Plan for the op-sqlite SQLCipher build and a native build. See React Native setup.
- Choosing your own storage engine, for example Realm → use the key-value store, and verify your backend with the exported backend-conformance kit before you ship.
- Shipping an Electron app → use the Node store in the main process with the safeStorage vault. A Tauri 2 app uses the web SQLite store in its webview. On Linux, WebKitGTK fails the open with
OPFS_UNAVAILABLE. See runtime support. - Building a service, CLI, or test → the Node store, having read why a server-side identity is a real participant.
Then decide the relay, which is a backend question rather than a runtime one. Use the OpenE2EE Signal Protocol Relay for hosted delivery. On your own backend, Convex, Supabase, your own API, anything: implement SignalProtocolRelayServer. It is a bounded interface, and the SDK never asks it for anything private.
Then decide attachments, which most teams should defer. Get messaging working first.
Next
- Expo setup, React Native setup, Browser setup, Node setup.
- Local encrypted storage: the store and vault boundary in depth.
- Relay and prekeys: what a relay owes the protocol.
- Adapter interfaces: the full contracts.
- Package subpaths: every import path.
Node
Set up the Node SQLCipher store for services, integration tests, CLIs, Electron apps, and relay development — with direct answers on key storage, retention, prekeys, recovery, and what a server-side identity does to your threat model.
Build
The application architecture above the protocol, ordered by the sequence the decisions actually arrive in — from device registration through to the recovery policy you cannot avoid choosing.