# Package subpaths (https://docs.open-e2ee.dev/reference/package-subpaths.md)

Applies to `@open-e2ee/signal-protocol-sdk` `15.0.x`. Public APIs and persisted formats follow semantic versioning.

The package is ESM-only (`"type": "module"`), and `package.json` marks it as `sideEffects: false`. It requires Node `>= 22.12.0`. Every peer dependency is optional: install only what your chosen adapters need. The following tables contain all 58 entries of the exports map: the root, `./package.json`, and 56 subpaths.

Imports are exact. `@open-e2ee/signal-protocol-sdk/keys` resolves. `@open-e2ee/signal-protocol-sdk/dist/keys` and `@open-e2ee/signal-protocol-sdk/src/keys` do not. Deep paths outside this map are not reachable through the exports field.

> `internal/**` is implementation-only and not part of the supported external API. The exports map omits it, so you cannot import it through the package name. If a symbol exists only inside `internal/`, treat it as unavailable. Internal APIs carry no compatibility promise across releases.

## Root [#root]

| Subpath | Exports |
|---|---|
| `.` | `createHostedSignalProtocolClient`, `joinHostedSignalProtocolRelayAccount`, `approveHostedSignalProtocolRelayDeviceLink`, `linkHostedSignalProtocolRelayDevice`, `createSignalProtocolClient`, `createSignalProtocolClientConfig`, `SignalProtocolClient`, `PostQuantumPolicy`, `BraidPolicy`, the error taxonomy, and the commonly used types |
| `./package.json` | The manifest itself, for tooling that reads the version |

The root re-exports the broadly used surface. Everything below it is available for narrower imports and for symbols the root does not lift.

## Client [#client]

| Subpath | Exports |
|---|---|
| `./client` | `DefaultSignalProtocolClient`, `createHostedSignalProtocolClient`, `bindSignalProtocolRelayLifecycle`, `SignalProtocolRelayLifecycleAppState`, `SignalProtocolRelayLifecycleOptions`, and the client-level re-exports |
| `./client/compose` | `createSignalProtocolClient`, `createSignalProtocolClientConfig`, `SignalProtocolClientCompositionOptions`, `SignalProtocolClientIdentityConfig`, `SignalProtocolClientAdapterConfig` |
| `./client/config` | `SignalProtocolClientConfig`, `DoubleRatchetConfig`, `SealedSenderConfig`, `SenderKeysConfig`, `ProgressCallback`, `Logger` |
| `./client/types` | `SendOptions`, `SendResult`, `DataMessageInput`, `IncomingEnvelope`, `ProcessEnvelopeOptions`, `SessionHealthResult` |
| `./client/constants` | `MESSAGE_RECORD_TTL_MS`, `MAX_RETRY_RESPONSES_PER_MESSAGE`, `isImplicitContentType` |
| `./client/headless` | `rotateKeysHeadless`, `checkRotationNeeded`, `HeadlessRotationOptions`, `PreKeyRotationResult` |
| `./client/endorsement-manager` | `EndorsementManager`, `EndorsementCacheStore` |

`./client/headless` exists for scheduled maintenance without a UI: a background task or a server-side job that rotates keys. `./client/endorsement-manager` supports group send endorsements.

## Device [#device]

| Subpath | Exports |
|---|---|
| `./device` | `prepareNewDeviceTransfer`, `prepareOldDeviceTransferWithBackup`, `createDeviceBackup`, `restoreDeviceBackup`, `encryptDeviceName`, `MAX_DEVICES` |
| `./device/lifecycle` | `DeviceLifecycleManager`, `getLocalDeviceMetadata` |
| `./device/device-id` | `getDeviceId`, `getDeviceIdSync`, `preloadDeviceId`, `clearDeviceIdCache` |
| `./device/expo` | `getTransferDeviceInfo`, `getDeviceLifecyclePlatform`, which read the local device metadata on Expo |
| `./device/react-native` | `getTransferDeviceInfo`, `getDeviceLifecyclePlatform`, which read the local device metadata on bare React Native |
| `./device/constants` | `DEFAULT_DEVICE_ID`, `MAX_DEVICES`, `DEVICE_ID_KEY`, `DEVICE_NAME_KEY`, `LOCAL_IDENTITY_KEY`, `DEVICE_REGISTERED_USER_ID_KEY`, `DEVICE_OWNER_SENTINEL` |

There is no `client.device.*` namespace. Device transfer and backup are these modules.

The managed device link is in the package root. In the two-device link, the new device calls `joinHostedSignalProtocolRelayAccount()`, and device 1 calls `approveHostedSignalProtocolRelayDeviceLink()`. The one-process link is `linkHostedSignalProtocolRelayDevice()`. To manage the devices of the account, call `listHostedSignalProtocolRelayDevices()`, `renameHostedSignalProtocolRelayDevice()`, and `removeHostedSignalProtocolRelayDevice()`. See [device lifecycle](https://docs.open-e2ee.dev/build/device-lifecycle.md) and [multi-device](https://docs.open-e2ee.dev/build/multi-device.md).

## Keys, trust, and identity [#keys-trust-and-identity]

| Subpath | Exports |
|---|---|
| `./keys` | Re-exports of `./keys/generation` and `./keys/types` |
| `./keys/generation` | `generateIdentityKeyPair`, `generateRegistrationId`, `generateEcSignedPreKey`, `generateEcSignedPreKeyId`, `generateEcOneTimePreKeys`, `generateKyberLastResortPreKey`, `generateKemOneTimePreKeys` |
| `./keys/types` | `CompositeIdentityV1`, `IdentityTrustState`, `ContactIdentityRecord`, `PreKeyBundle`, `IdentityType` |
| `./safety` | `generateCompositeSafetyNumber`, `generateSingleKeyReferenceSafetyNumber`, `compareSafetyNumbers`, `isValidSafetyNumber`, `clearFingerprintCache`, `Fingerprint`, `DisplayableFingerprint`, `ScannableFingerprint`, verify-URL helpers |
| `./sealed-sender` | `deriveAccessKey`, `ACCESS_KEY_BYTES` |

`IdentityTrustState` is exactly `'UNVERIFIED_TOFU' | 'VERIFIED'`. See [keys, identity, and sessions](https://docs.open-e2ee.dev/learn/keys-identity-sessions.md).

## Feature modules [#feature-modules]

| Subpath | Exports |
|---|---|
| `./groups` | `GroupManager`, `createGroupId`, `GroupServer`, `GroupStateStore`, `DecryptedGroup`, `AccessControl` |
| `./blocking` | `SignalProtocolBlockingManager` — `blockRecipient`, `unblockRecipient`, `isBlocked`, `listBlockedRecipients`, `applySyncSnapshot` |
| `./profile` | `encryptProfileName`, `decryptProfileName`, `getOrCreateOwnProfileKey`, `setOwnProfileKey`, `updateEncryptedProfile` |
| `./username` | `formatUsername`, `hashUsername`, `parseUsername` |
| `./username/link` | `createUsernameLink`, `decryptUsernameLink` |
| `./media` | `MediaAttachmentPointer`, `MediaAttachmentMessage`, `MediaAttachmentError`, `MediaAttachmentErrorCode`, `MediaAttachmentTransferOptions`, `MEDIA_ATTACHMENT_POLICY_DEFAULTS`, `MEDIA_ATTACHMENT_POLICY_PRESETS` |
| `./files` | `streamingEncrypt`, `streamingDecrypt`, `DEFAULT_SEGMENT_SIZE`, `secureZeroBytes` |
| `./zk/groups` | `computeProfileKeyVersion`, `deriveGroupSecretParams`, `getGroupPublicParams`, `uuidToBytes`, `serviceIdBinary`, `SERVICE_ID_ACI`, `SERVICE_ID_PNI` |
| `./zk/credentials` | Credential key serialization and deserialization helpers |
| `./hooks` | `useSessionHealth`, `useKeyRotation`, `useKeyRotationWithControls`, `useSignalProtocolRelayConnectionState`, `useSignalProtocolRelayLifecycle`, `useGroupMembership`, `useSingleFlight` |
| `./logger` | `createDefaultSignalProtocolLogger`, `resolveSignalProtocolLogger` |
| `./server-clock` | `recordServerClockSample`, `estimateServerTimestamp` |
| `./encoding` | `bytesToBase64`, `base64ToBytes`, and the shared encoding helpers |
| `./encoding/hex` | `bytesToHex`, `hexToBytes` |
| `./utils/retry` | `withRetry`, `isRetryableError`, `SignalProtocolRetryConfig` |

`./hooks` are React hooks and need `react` installed. The subpath also imports `AppState` from `react-native` when it loads, because `useKeyRotation` and `useSignalProtocolRelayLifecycle` read it.

## Types [#types]

| Subpath | Exports |
|---|---|
| `./types` | `SignalProtocolLocalStore`, `ProtocolStore`, `SignalProtocolManager`, the error taxonomy, and the shared protocol types |
| `./types/address` | `ProtocolAddress` and its `create`, `parse`, `toString`, `equals`, `isUser`, `isValid`, `toStorageKey`, `fromStorageKey` helpers |
| `./types/messages` | `MessageType`, `ContentHint`, `MessageHeader`, `RatchetMessage`, `PreKeyMessage`, `ProtocolMessage` |
| `./types/utils` | `Base64`, `Hex`, `Bytes` branded types with `asBase64`, `asHex`, `asBytes`, `toBase64`, `toHex`, `isValidBase64`, `isValidHex` |

## Local storage and vault [#local-storage-and-vault]

| Subpath | Exports | Status |
|---|---|---|
| `./local/store` | `SignalProtocolLocalStore`, `InMemorySignalProtocolStore` re-export, shared store types | — |
| `./local/store/conformance` | `assertLocalStoreConformance`, `runLocalStoreConformance`, and the `LocalStoreConformanceOptions`, `LocalStoreConformanceResult`, `LocalStoreConformanceFailure` types | Conformance checks for a custom store |
| `./local/store/expo` | `expoStore(options?)`, `resetExpoStore(options?)`, `ExpoSignalProtocolStore`, `ExpoSignalProtocolStoreOptions`, `createPreKeyMaintenanceStore(store)` | Primary supported adapter |
| `./local/store/react-native` | `reactNativeStore(options?)`, `resetReactNativeStore(options?)`, `ReactNativeSignalProtocolStore`, `ReactNativeSignalProtocolStoreOptions`, `createPreKeyMaintenanceStore(store)` | Supported; bare React Native |
| `./local/store/node` | `nodeStore(options)`, `resetNodeStore(options)`, `NodeSignalProtocolStore`, `NodeSignalProtocolStoreOptions`, `sqliteDatabaseKeySlot(path)`, `createPreKeyMaintenanceStore(store)` | Node, the Electron main process, and server-side |
| `./local/store/web` | `indexedDbStore()`, `IndexedDbSignalProtocolStore` | Supported; browsers without the origin private file system |
| `./local/store/web-sqlite` | `webSqliteStore(options?)`, `resetWebSqliteStore(options?)`, `WebSqliteSignalProtocolStore`, `WebSqliteSignalProtocolStoreOptions`, `createPreKeyMaintenanceStore(store)` | Supported from 8.1.0; browsers with the origin private file system, and the Tauri 2 webview |
| `./local/store/key-value` | `keyValueStore(...)`, `KeyValueSignalProtocolStore`, `KeyValueStorage`, `createTransactionalKeyValueBackend`, `assertBackendConformance`, `runBackendConformance` | Supported; caller-provided backend |
| `./local/store/key-value/realm` | `createRealmKeyValueBackend(realm)`, `realmKeyValueSchema`, the structural `RealmLike` types | Key-value backend over an app-owned Realm |
| `./local/store/memory` | `inMemoryStore()`, `InMemorySignalProtocolStore` | **Development only** |
| `./local/vault` | `SignalProtocolLocalSecretVault` | — |
| `./local/vault/electron-safe-storage` | `ElectronSafeStorageSignalProtocolSecretVault`, a vault implementation over Electron's `safeStorage` for the main process | — |
| `./local/vault/expo-secure-store` | Vault implementation over `expo-secure-store` | — |
| `./local/vault/react-native-keychain` | `ReactNativeKeychainSignalProtocolSecretVault`, a vault implementation over `react-native-keychain` | — |

Await the async `expoStore()`, `reactNativeStore()`, `nodeStore()`, `indexedDbStore()`, `webSqliteStore()`, and `keyValueStore()` functions. Do not await `inMemoryStore()`.

The SDK owns the database of each SQLite store (Expo, bare React Native, Node, and web SQLite): its file, its key, and its migrations. Keep application tables in a separate database file.

## Remote relay [#remote-relay]

| Subpath | Exports | Status |
|---|---|---|
| `./remote/signal-relay` | `SignalProtocolRelayServer`, `Envelope`, `DeviceRegistration`, `PreKeyBundle`, `SignalProtocolRelayConnectionState`, and the other shared relay types | — |
| `./remote/signal-relay/types` | `SignalProtocolRelayServer`, `KeyRotationService`, `SignalProtocolRelayConnectionState`, `SignalProtocolRelayConnectionReason`, `Unsubscribe`, envelope and bundle types | — |

The package contains no relay implementation. The relay subpaths export types only. Connect to the OpenE2EE Signal Protocol Relay with `createHostedSignalProtocolClient()` from the package root: see [Signal Protocol Relay](https://docs.open-e2ee.dev/signal-relay.md). For a custom transport, pass an application-owned `SignalProtocolRelayServer` to `createSignalProtocolClient()`. It connects to an authenticated backend that you operate.

## Remote object store [#remote-object-store]

| Subpath | Exports | Status |
|---|---|---|
| `./remote/object-store` | `SignalProtocolRemoteObjectStore` and the brokered request and response types | — |
| `./remote/object-store/convex-r2` | `convexR2ObjectStore(config)`, `ConvexR2ObjectStore`, `ConvexR2ObjectStoreApi`, `ConvexR2ObjectStoreConfig` | — |
| `./remote/object-store/s3` | `s3ObjectStore(config)`, `S3ObjectStoreBroker`, `S3ObjectStoreConfig` | — |

Both object-store adapters run on the device. Your backend supplies the broker that holds the provider credential. For Convex R2, `ConvexR2ObjectStoreApi` types the four Convex functions that your backend exports. See [encrypted attachments with R2 or S3](https://docs.open-e2ee.dev/guides/encrypted-attachments-r2-s3.md).

## Peer dependencies by subpath [#peer-dependencies-by-subpath]

The package declares all peer dependencies as optional. Install only what the subpaths you import require.

| If you import | You need |
|---|---|
| `./local/store/expo` | `expo-sqlite`, `expo-secure-store` |
| `./local/vault/expo-secure-store` | `expo-secure-store` |
| `./local/store/react-native` | `@op-engineering/op-sqlite`, `react-native-keychain` |
| `./local/store/node` | `better-sqlite3-multiple-ciphers` |
| `./local/store/web`, `./local/store/web-sqlite` | `idb` |
| `./local/vault/react-native-keychain` | `react-native-keychain` |
| `./device/expo` | `react-native`, `expo-constants`, `expo-device` |
| `./device/react-native` | `react-native`, `react-native-device-info` |
| `./remote/object-store/convex-r2` | `convex` |
| `./hooks` | `react`, `react-native` |

The manifest also declares `expo` as an optional peer. No subpath imports it. An Expo app already has it.

[Security and protocol policy](https://docs.open-e2ee.dev/reference/security-policy.md) covers the six direct production dependencies that the package installs, which resolve to six packages in total: `@noble/ciphers`, `@noble/curves`, `@noble/hashes`, `@noble/post-quantum`, `async-lock`, and `unique-names-generator`.

## Next [#next]

- [API reference](https://docs.open-e2ee.dev/reference/api.md): the curated client surface
- [Adapter interfaces](https://docs.open-e2ee.dev/reference/adapters.md): what the adapter subpaths require of you
- [Runtime support](https://docs.open-e2ee.dev/reference/runtime-support.md): which store subpath your runtime needs
- [Choosing adapters](https://docs.open-e2ee.dev/start/choosing-adapters.md): picking between them
