# Production readiness checklist (https://docs.open-e2ee.dev/operate/production-checklist.md)

- Status: stable
- Applies to: 15.0.0
- Platforms: Expo · Browser · Node
- Prereqs: A working client from Start → Quickstart
- Reading time: 11 min

This is a checklist of things that are wrong in most first integrations. Each item is a decision you make once and write down, or a piece of wiring that either exists or does not. Nothing here is aspirational.

Maturity, stated plainly before you rely on any of it: 15.0.x. Public APIs and persisted formats follow semantic versioning. The SDK is reviewed continuously by adversarial AI agents; it is not audited by any independent firm.

## 1. Adapters [#1-adapters]

The adapter you ship decides how much of the checklist below is your problem.

- [ ] Choose a storage adapter whose documentation claims support for your platform. The documentation defines `ExpoSignalProtocolStore` (`/local/store/expo`) as the primary supported adapter. It supports `ReactNativeSignalProtocolStore` (`/local/store/react-native`) for bare React Native, `NodeSignalProtocolStore` (`/local/store/node`) for Node and the Electron main process, `WebSqliteSignalProtocolStore` (`/local/store/web-sqlite`) for browsers where the origin private file system works, and `IndexedDbSignalProtocolStore` (`/local/store/web`) for browsers where it is not available. A browser deployment requires the origin-security review in [browser setup](https://docs.open-e2ee.dev/start/browser.md).
- [ ] If you ship `KeyValueSignalProtocolStore` (`/local/store/key-value`), run the SDK's exported backend-conformance kit, `assertBackendConformance`, against the key-value backend you supply. Run it from your tests and wire the `reopen` hook so the check proves durability. The store's guarantees hold only over a backend that passes.
- [ ] `InMemorySignalProtocolStore` (`/local/store/memory`) and any in-process test relay appear in **no** production code path. They are development only, in-memory, and hold nothing across a restart. Add a build-time check that neither is reachable from your release bundle.
- [ ] If you use the Expo store, your build pipeline produces a development build. The Expo store "requires a development build and is not available in Expo Go."
- [ ] `ExpoSecureStoreSignalProtocolSecretVault` (`/local/vault/expo-secure-store`) holds only a small bootstrap secret: a storage-wrapping key such as `"signal-store-wrapping-key"`. "Platform secret managers are appropriate for tiny keys and bootstrap values, but not full session databases."
- [ ] If you use an object store, access it through a broker. Keep cloud credentials and unrestricted provider clients on your backend, never in the app runtime.

See [choosing adapters](https://docs.open-e2ee.dev/start/choosing-adapters.md) and the [adapter reference](https://docs.open-e2ee.dev/reference/adapters.md).

## 2. Storage durability and atomicity [#2-storage-durability-and-atomicity]

A decrypt mutates ratchet state. A partial or interleaved write corrupts it, and a retry cannot repair that state.

- [ ] Write session state atomically in your adapter's backing store. If you wrote a custom `SignalProtocolLocalStore`, test a process kill mid-write.
- [ ] Two clients for the same `(userId, deviceId)` never run concurrently against the same storage. One store instance owns one user on one device.
- [ ] You handle `KEY_STORAGE_ERROR` and `STORAGE_QUOTA_EXCEEDED` explicitly rather than swallowing them. Inspect a key-storage failure's cause. Free space before retrying a quota failure.
- [ ] You have a plan for a store that will not open at all. The user-visible outcome is a device that cannot decrypt its own history. Decide now whether that is a re-link flow or a reset flow.

> **Failure mode — Corruption survives deleting the session file**
>
> A related project logged over 168,000 errors in two hours across 400+ sessions, exhausting the Node heap. The errors continued even after operators deleted session files because the failing path re-created state from the same broken inputs. If your recovery is "delete and retry", bound it: cap attempts per peer, and stop the loop before it takes the process with it.

## 3. Prekey replenishment [#3-prekey-replenishment]

- [ ] Call `syncToServer()` on app start, on foreground, and after any relay outage. `syncToServer()` and `rotatePreKeys()` are the only methods that replenish prekeys.
- [ ] Monitor `checkPreKeyStatus()` throughout the application lifecycle, not only at boot. It returns `oneTimePreKeysRemaining` and `needsReplenishment`.
- [ ] You set `preKeyLowThreshold` (default `50`) and an `onPreKeyLow` callback deliberately. The one-time prekey batch is `100`. The internal replenishment threshold is `10`. Do not conflate the two.
- [ ] Your alerting fires on `needsReplenishment` being true for longer than one sync interval, not on a single reading.

```ts
const client = await createSignalProtocolClient({
  identity: { userId },
  adapters: { storage, relay },
  preKeyLowThreshold: 50,
  onPreKeyLow: (remaining) => metrics.gauge('signal.prekeys.remaining', remaining),
});

await client.syncToServer();
```

> **Failure mode — Exhaustion is measured, not theoretical**
>
> A 2025 measurement study of WhatsApp found 13% of companion devices lacked a one-time prekey at scan time. Running out does not raise an error on the sender's side at the moment it matters: it silently weakens forward secrecy for new sessions. On your side it surfaces later as `PREKEY_NOT_FOUND`. Treat the gauge as the signal, not the exception.

## 4. Relay semantics under concurrency [#4-relay-semantics-under-concurrency]

- [ ] Your relay consumes one-time prekeys atomically. "the relay must not hand out the same one-time prekey as if it were still unused." Two concurrent bundle fetches for the same recipient must not receive the same one-time prekey.
- [ ] The relay allocates linked-device IDs. "the server owns linked-device slot allocation; clients must not choose linked `deviceId`s." Primary is `1`. Linked devices are `2` through `5`.
- [ ] Backend authentication binds registration, unlink, and removal to the owning account.
- [ ] Envelope delivery is at-least-once and you tolerate duplicates. For an at-least-once redelivery, the `duplicate` receive outcome is normal, not an incident.
- [ ] A custom relay adapter implements `relayConnectionState` and `subscribeRelayConnectionState`.
- [ ] A React Native app binds the relay subscription to the app state with `useSignalProtocolRelayLifecycle` or `bindSignalProtocolRelayLifecycle`. It sets `keepOpenInBackground` only while it must receive in the background, for example during an Android foreground service.
- [ ] A web app does not stop the relay subscription when a tab is hidden.

See [relay and prekeys](https://docs.open-e2ee.dev/build/relay-and-prekeys.md).

## 5. Identity change has a real UX [#5-identity-change-has-a-real-ux]

- [ ] `UntrustedIdentityError` reaches a screen a user can act on, carrying `.untrustedAddress` and `.identity`.
- [ ] The choice is explicit. Trust starts at `UNVERIFIED_TOFU`. `acceptIdentityRotation(...)` is a deliberate act, never an automatic recovery step.
- [ ] Safety-number comparison is reachable: `verify(remoteUserId)` produces the comparison data, `confirmSafetyNumber(confirmation)` records the decision. The SDK creates comparison data. Your app owns QR rendering, scanning, the verification experience, and storage of the user's trust decision.
- [ ] Watch a real user attempt the ceremony. In one study, 21 of 28 computer-science students could not verify a public key. Only 13% completed the ceremony when researchers explained the risks.

See [identity change and safety numbers](https://docs.open-e2ee.dev/build/identity-change-safety-numbers.md).

## 6. Recovery policy chosen and written down [#6-recovery-policy-chosen-and-written-down]

- [ ] Pick a named recovery profile and record it where product and support can both read it. [Recovery, backup and migration](https://docs.open-e2ee.dev/build/recovery-backup-migration.md) describes the profiles.
- [ ] Support has a written answer to "I lost my phone and I want my messages back." The answer follows from the selected profile. Support does not improvise it during a ticket.
- [ ] The managed device link and transfer are not confused in your code or your copy. The two-device link joins a new device with an empty store, and device 1 approves it. The one-process link, `linkHostedSignalProtocolRelayDevice()`, joins a device that already holds the account identity. Neither link moves **sessions or history**. Transfer moves the account identity to another device in an encrypted backup.

> **Tradeoff — Recoverable history vs. coercion resistance**
>
> A recovery path that restores message history means a credential that can restore it exists. An attacker or authority can demand, phish, or subpoena it. A design with no recovery path makes a lost device equal lost history. Your support burden then becomes a product problem, not a security problem.
>
> The SDK does not choose for you and does not ship a default backup service. Choose a policy and record it. Make the consequence visible in your onboarding copy.

## 7. Backup posture [#7-backup-posture]

- [ ] Encrypt backup material before it reaches any transport. "Identity and backup material is encrypted before it reaches a relay or transport."
- [ ] You know what your platform backs up without asking. Include OS-level backups of your app's data directory in the threat model.
- [ ] Decrypted message rows are yours: "Your app owns decrypted message rows and local files after the Signal Protocol client decrypts or stages them." Their backup posture is a separate decision from the protocol store's.

## 8. Device unlink and account reset [#8-device-unlink-and-account-reset]

- [ ] Account reset clears the device-ID cache, platform secret storage, and the protocol store **as one lifecycle**. Clearing two of the three leaves a device that believes it has an identity it can no longer use.
- [ ] Connect `clearAllData()` to that lifecycle. Clear `getDeviceId()` / `preloadDeviceId()` state from `/device/device-id` in the same lifecycle.
- [ ] Authenticate unlink requests at the backend against the owning account. Do not trust client assertions.

See [deletion and device revocation](https://docs.open-e2ee.dev/operate/deletion-revocation.md) and [device lifecycle](https://docs.open-e2ee.dev/build/device-lifecycle.md).

## 9. Error taxonomy handled [#9-error-taxonomy-handled]

- [ ] Every `EncryptionErrorCode` you can receive maps to a handler or an explicit "log and drop". The full taxonomy is at [error handling and retries](https://docs.open-e2ee.dev/operate/error-handling.md).
- [ ] You use the exported type guards (`isUntrustedIdentityError()`, `isDuplicatedMessageError()`, `isSealedSenderAuthError()`, `isPQXDHRequiredError()`, `isStorageQuotaExceededError()`) and ship one SDK copy. The current guards delegate to `instanceof`.
- [ ] Retry only retryable failures. Retrying a decrypt does not help and can leave ratchet state worse.

## 10. Observability without plaintext [#10-observability-without-plaintext]

- [ ] Connect `client.logger` to telemetry through a redaction boundary that your team reviewed line by line.
- [ ] No plaintext, key material, or safety number reaches a log sink. See [observability](https://docs.open-e2ee.dev/operate/observability.md) for what is safe to emit.
- [ ] `getStats()`, `getSessionHealth(userId)`, and `checkPreKeyStatus()` feed dashboards, not only ad-hoc debugging.

## 11. Test failure paths [#11-test-failure-paths]

- [ ] Test out-of-order and skipped delivery up to `maxSkip` (25000), prekey exhaustion, identity changes, and session recovery. Also test offline reconciliation, multi-device fanout, group removal, and attachment round trips. See [testing encrypted flows](https://docs.open-e2ee.dev/operate/testing.md).

## 12. Licensing decision [#12-licensing-decision]

- [ ] Record which of the two SDK licenses your product uses, MIT or Apache-2.0. Both permit proprietary use, and neither needs a fee or a signed agreement. Keep the license notice in your distribution. See [licensing](https://docs.open-e2ee.dev/licensing.md).

**Opacity ledger**

| Artifact | Stays on device | Sent to relay | In object store | Visible as metadata |
|---|---|---|---|---|
| `identityKeyPair` private half | yes | no | no | no |
| `identityKeyPair` public half | yes | yes | no | yes |
| `EcSignedPreKey` public half | yes | yes | no | yes |
| `EcOneTimePreKey` public half | yes | yes | no | yes |
| Session record (`version: 4`) | yes | no | no | no |
| Message plaintext | yes | no | no | no |
| Message ciphertext | yes | yes | no | envelope size, timing |
| Encrypted attachment bytes | staged locally | no | yes | object size |
| `oneTimePreKeysRemaining` | yes | no | no | inferable from bundle fetches |

> **Not covered — Capacity planning and relay scaling**
>
> Envelope throughput, fanout cost, and storage sizing depend on your relay implementation and are outside the SDK. The multiplicative cost to be aware of is `(nA−1)·nB` encryptions per message across devices. See [multi-device](https://docs.open-e2ee.dev/build/multi-device.md).

## Next [#next]

- [Error handling and retries](https://docs.open-e2ee.dev/operate/error-handling.md)
- [Observability without plaintext](https://docs.open-e2ee.dev/operate/observability.md)
- [Security review checklist](https://docs.open-e2ee.dev/operate/security-review.md)
- [Testing encrypted flows](https://docs.open-e2ee.dev/operate/testing.md)
