@open-e2ee/signal-protocol-sdk 2.0.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/ADAPTERS.md +14 -21
  2. package/ARCHITECTURE.md +1 -2
  3. package/CHANGELOG.md +90 -0
  4. package/LICENSE +11 -655
  5. package/LICENSE-APACHE +201 -0
  6. package/LICENSE-MIT +21 -0
  7. package/NOTICE +5 -7
  8. package/README.md +11 -11
  9. package/SECURITY.md +2 -2
  10. package/TROUBLESHOOTING.md +6 -10
  11. package/client/README.md +36 -18
  12. package/device/README.md +1 -1
  13. package/dist/blocking/manager.d.ts +2 -2
  14. package/dist/blocking/manager.d.ts.map +1 -1
  15. package/dist/blocking/manager.js.map +1 -1
  16. package/dist/client/client.d.ts +45 -34
  17. package/dist/client/client.d.ts.map +1 -1
  18. package/dist/client/client.js +178 -115
  19. package/dist/client/client.js.map +1 -1
  20. package/dist/client/compose.d.ts +7 -7
  21. package/dist/client/compose.d.ts.map +1 -1
  22. package/dist/client/compose.js +2 -2
  23. package/dist/client/compose.js.map +1 -1
  24. package/dist/client/config.d.ts +24 -28
  25. package/dist/client/config.d.ts.map +1 -1
  26. package/dist/client/config.js.map +1 -1
  27. package/dist/client/content-adapter.d.ts +2 -0
  28. package/dist/client/content-adapter.d.ts.map +1 -1
  29. package/dist/client/content-adapter.js +4 -0
  30. package/dist/client/content-adapter.js.map +1 -1
  31. package/dist/client/dual-store.d.ts +5 -5
  32. package/dist/client/dual-store.d.ts.map +1 -1
  33. package/dist/client/dual-store.js.map +1 -1
  34. package/dist/client/endorsement-manager.d.ts +6 -3
  35. package/dist/client/endorsement-manager.d.ts.map +1 -1
  36. package/dist/client/endorsement-manager.js +14 -6
  37. package/dist/client/endorsement-manager.js.map +1 -1
  38. package/dist/client/files.d.ts +1 -1
  39. package/dist/client/files.js +1 -1
  40. package/dist/client/group-authority.d.ts +8 -0
  41. package/dist/client/group-authority.d.ts.map +1 -0
  42. package/dist/client/group-authority.js +2 -0
  43. package/dist/client/group-authority.js.map +1 -0
  44. package/dist/client/group-outbox.d.ts +4 -4
  45. package/dist/client/group-outbox.d.ts.map +1 -1
  46. package/dist/client/group-sealed-sender.d.ts +2 -2
  47. package/dist/client/group-sealed-sender.d.ts.map +1 -1
  48. package/dist/client/groups.d.ts +1 -1
  49. package/dist/client/groups.js +1 -1
  50. package/dist/client/headless.d.ts +11 -16
  51. package/dist/client/headless.d.ts.map +1 -1
  52. package/dist/client/headless.js +4 -9
  53. package/dist/client/headless.js.map +1 -1
  54. package/dist/client/hosted-anonymous-delivery.d.ts +32 -0
  55. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -0
  56. package/dist/client/hosted-anonymous-delivery.js +239 -0
  57. package/dist/client/hosted-anonymous-delivery.js.map +1 -0
  58. package/dist/client/hosted-connection.d.ts +1 -1
  59. package/dist/client/hosted-connection.d.ts.map +1 -1
  60. package/dist/client/hosted-connection.js +18 -51
  61. package/dist/client/hosted-connection.js.map +1 -1
  62. package/dist/client/hosted-group-authority.d.ts +11 -0
  63. package/dist/client/hosted-group-authority.d.ts.map +1 -0
  64. package/dist/client/hosted-group-authority.js +96 -0
  65. package/dist/client/hosted-group-authority.js.map +1 -0
  66. package/dist/client/hosted-groups.d.ts +31 -0
  67. package/dist/client/hosted-groups.d.ts.map +1 -0
  68. package/dist/client/hosted-groups.js +217 -0
  69. package/dist/client/hosted-groups.js.map +1 -0
  70. package/dist/client/hosted-mailbox-subscription.d.ts +34 -0
  71. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -0
  72. package/dist/client/hosted-mailbox-subscription.js +257 -0
  73. package/dist/client/hosted-mailbox-subscription.js.map +1 -0
  74. package/dist/client/hosted-prekey-publication.d.ts +51 -0
  75. package/dist/client/hosted-prekey-publication.d.ts.map +1 -0
  76. package/dist/client/hosted-prekey-publication.js +249 -0
  77. package/dist/client/hosted-prekey-publication.js.map +1 -0
  78. package/dist/client/hosted-push.d.ts +5 -6
  79. package/dist/client/hosted-push.d.ts.map +1 -1
  80. package/dist/client/hosted-push.js +22 -22
  81. package/dist/client/hosted-push.js.map +1 -1
  82. package/dist/client/hosted-transport.d.ts +62 -40
  83. package/dist/client/hosted-transport.d.ts.map +1 -1
  84. package/dist/client/hosted-transport.js +666 -341
  85. package/dist/client/hosted-transport.js.map +1 -1
  86. package/dist/client/hosted-trust.d.ts +29 -0
  87. package/dist/client/hosted-trust.d.ts.map +1 -0
  88. package/dist/client/hosted-trust.js +28 -0
  89. package/dist/client/hosted-trust.js.map +1 -0
  90. package/dist/client/hosted.d.ts +26 -21
  91. package/dist/client/hosted.d.ts.map +1 -1
  92. package/dist/client/hosted.js +80 -36
  93. package/dist/client/hosted.js.map +1 -1
  94. package/dist/client/index.d.ts +15 -15
  95. package/dist/client/index.d.ts.map +1 -1
  96. package/dist/client/index.js +7 -7
  97. package/dist/client/index.js.map +1 -1
  98. package/dist/client/key-rotation-core.d.ts +16 -8
  99. package/dist/client/key-rotation-core.d.ts.map +1 -1
  100. package/dist/client/key-rotation-core.js +14 -3
  101. package/dist/client/key-rotation-core.js.map +1 -1
  102. package/dist/client/key-rotation.d.ts +3 -2
  103. package/dist/client/key-rotation.d.ts.map +1 -1
  104. package/dist/client/key-rotation.js +5 -5
  105. package/dist/client/key-rotation.js.map +1 -1
  106. package/dist/client/media-queue-persistence.d.ts +14 -0
  107. package/dist/client/media-queue-persistence.d.ts.map +1 -0
  108. package/dist/client/media-queue-persistence.js +123 -0
  109. package/dist/client/media-queue-persistence.js.map +1 -0
  110. package/dist/client/media-upload-budget.d.ts +3 -0
  111. package/dist/client/media-upload-budget.d.ts.map +1 -0
  112. package/dist/client/media-upload-budget.js +27 -0
  113. package/dist/client/media-upload-budget.js.map +1 -0
  114. package/dist/client/media.d.ts +51 -15
  115. package/dist/client/media.d.ts.map +1 -1
  116. package/dist/client/media.js +541 -73
  117. package/dist/client/media.js.map +1 -1
  118. package/dist/client/messages.d.ts +1 -1
  119. package/dist/client/messages.d.ts.map +1 -1
  120. package/dist/client/messages.js +14 -15
  121. package/dist/client/messages.js.map +1 -1
  122. package/dist/client/multi-device.d.ts +1 -1
  123. package/dist/client/multi-device.js +1 -1
  124. package/dist/client/prekeys.d.ts +1 -1
  125. package/dist/client/prekeys.d.ts.map +1 -1
  126. package/dist/client/prekeys.js +132 -44
  127. package/dist/client/prekeys.js.map +1 -1
  128. package/dist/client/relay-subscription.d.ts +5 -1
  129. package/dist/client/relay-subscription.d.ts.map +1 -1
  130. package/dist/client/relay-subscription.js +59 -26
  131. package/dist/client/relay-subscription.js.map +1 -1
  132. package/dist/client/retry.d.ts +3 -3
  133. package/dist/client/retry.d.ts.map +1 -1
  134. package/dist/client/retry.js +1 -1
  135. package/dist/client/retry.js.map +1 -1
  136. package/dist/client/sealed-sender.d.ts +5 -5
  137. package/dist/client/sealed-sender.d.ts.map +1 -1
  138. package/dist/client/sealed-sender.js.map +1 -1
  139. package/dist/client/sender-key-distribution.d.ts +8 -0
  140. package/dist/client/sender-key-distribution.d.ts.map +1 -0
  141. package/dist/client/sender-key-distribution.js +59 -0
  142. package/dist/client/sender-key-distribution.js.map +1 -0
  143. package/dist/client/sessions.d.ts +3 -3
  144. package/dist/client/sessions.d.ts.map +1 -1
  145. package/dist/client/sessions.js +1 -1
  146. package/dist/client/sessions.js.map +1 -1
  147. package/dist/client/signal-service-cipher.d.ts +12 -8
  148. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  149. package/dist/client/signal-service-cipher.js +41 -16
  150. package/dist/client/signal-service-cipher.js.map +1 -1
  151. package/dist/client/state.d.ts +1 -1
  152. package/dist/client/state.js +1 -1
  153. package/dist/client/types.d.ts +10 -10
  154. package/dist/client/types.d.ts.map +1 -1
  155. package/dist/client/types.js +1 -1
  156. package/dist/device/connection.d.ts.map +1 -1
  157. package/dist/device/connection.js.map +1 -1
  158. package/dist/device/device-id.d.ts +2 -2
  159. package/dist/device/device-id.d.ts.map +1 -1
  160. package/dist/device/device-id.js.map +1 -1
  161. package/dist/device/{expo-metadata.d.ts → expo/index.d.ts} +3 -3
  162. package/dist/device/expo/index.d.ts.map +1 -0
  163. package/dist/device/{expo-metadata.js → expo/index.js} +2 -2
  164. package/dist/device/expo/index.js.map +1 -0
  165. package/dist/device/index.d.ts +1 -1
  166. package/dist/device/index.d.ts.map +1 -1
  167. package/dist/device/index.js +1 -1
  168. package/dist/device/index.js.map +1 -1
  169. package/dist/device/lifecycle/index.d.ts +1 -1
  170. package/dist/device/lifecycle/index.d.ts.map +1 -1
  171. package/dist/device/lifecycle/types.d.ts +8 -8
  172. package/dist/device/lifecycle/types.d.ts.map +1 -1
  173. package/dist/device/provisioning.d.ts +13 -13
  174. package/dist/device/provisioning.d.ts.map +1 -1
  175. package/dist/device/provisioning.js +1 -1
  176. package/dist/device/provisioning.js.map +1 -1
  177. package/dist/device/transfer.d.ts +13 -13
  178. package/dist/device/transfer.d.ts.map +1 -1
  179. package/dist/device/transfer.js.map +1 -1
  180. package/dist/device/types.d.ts +3 -3
  181. package/dist/device/types.d.ts.map +1 -1
  182. package/dist/groups/index.d.ts +1 -1
  183. package/dist/groups/index.d.ts.map +1 -1
  184. package/dist/groups/server.d.ts +10 -0
  185. package/dist/groups/server.d.ts.map +1 -0
  186. package/dist/groups/server.js +6 -0
  187. package/dist/groups/server.js.map +1 -0
  188. package/dist/hooks/use-connection-presence.d.ts +6 -8
  189. package/dist/hooks/use-connection-presence.d.ts.map +1 -1
  190. package/dist/hooks/use-connection-presence.js +2 -4
  191. package/dist/hooks/use-connection-presence.js.map +1 -1
  192. package/dist/hooks/use-group-membership.d.ts +2 -2
  193. package/dist/hooks/use-group-membership.d.ts.map +1 -1
  194. package/dist/hooks/use-group-membership.js.map +1 -1
  195. package/dist/hooks/use-key-rotation.d.ts +2 -2
  196. package/dist/hooks/use-key-rotation.d.ts.map +1 -1
  197. package/dist/hooks/use-session-health.d.ts +2 -2
  198. package/dist/hooks/use-session-health.d.ts.map +1 -1
  199. package/dist/index.d.ts +57 -55
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +27 -26
  202. package/dist/index.js.map +1 -1
  203. package/dist/internal/crypto/ec/x25519-validation.d.ts +4 -4
  204. package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
  205. package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
  206. package/dist/internal/groups/authority-certificate.d.ts +22 -0
  207. package/dist/internal/groups/authority-certificate.d.ts.map +1 -0
  208. package/dist/internal/groups/authority-certificate.js +99 -0
  209. package/dist/internal/groups/authority-certificate.js.map +1 -0
  210. package/dist/internal/groups/error-details.d.ts +9 -0
  211. package/dist/internal/groups/error-details.d.ts.map +1 -0
  212. package/dist/internal/groups/error-details.js +30 -0
  213. package/dist/internal/groups/error-details.js.map +1 -0
  214. package/dist/internal/groups/index.d.ts +1 -1
  215. package/dist/internal/groups/index.d.ts.map +1 -1
  216. package/dist/internal/groups/manager.d.ts +9 -4
  217. package/dist/internal/groups/manager.d.ts.map +1 -1
  218. package/dist/internal/groups/manager.js +3 -0
  219. package/dist/internal/groups/manager.js.map +1 -1
  220. package/dist/internal/groups/sdk-store.d.ts +4 -4
  221. package/dist/internal/groups/sdk-store.d.ts.map +1 -1
  222. package/dist/internal/groups/sdk-store.js.map +1 -1
  223. package/dist/internal/groups/server-engine.d.ts +9 -2
  224. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  225. package/dist/internal/groups/server-engine.js +51 -19
  226. package/dist/internal/groups/server-engine.js.map +1 -1
  227. package/dist/internal/groups/wire.d.ts.map +1 -1
  228. package/dist/internal/groups/wire.js +10 -9
  229. package/dist/internal/groups/wire.js.map +1 -1
  230. package/dist/internal/manager/index.d.ts +2 -2
  231. package/dist/internal/manager/index.d.ts.map +1 -1
  232. package/dist/internal/manager/index.js +1 -1
  233. package/dist/internal/manager/index.js.map +1 -1
  234. package/dist/internal/manager/manager.d.ts +23 -23
  235. package/dist/internal/manager/manager.d.ts.map +1 -1
  236. package/dist/internal/manager/manager.js +40 -43
  237. package/dist/internal/manager/manager.js.map +1 -1
  238. package/dist/internal/protocol/double-ratchet/chains.d.ts +9 -9
  239. package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
  240. package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
  241. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +2 -2
  242. package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
  243. package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
  244. package/dist/internal/protocol/pqxdh/pqxdh.d.ts +3 -3
  245. package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
  246. package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
  247. package/dist/internal/protocol/sender-keys/manager.d.ts +4 -4
  248. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  249. package/dist/internal/protocol/sender-keys/manager.js +27 -14
  250. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  251. package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts +3 -3
  252. package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts.map +1 -1
  253. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +3 -3
  254. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
  255. package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts +2 -2
  256. package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts.map +1 -1
  257. package/dist/internal/protocol/spqr/ml-kem-braid/index.js +1 -1
  258. package/dist/internal/protocol/spqr/ml-kem-braid/index.js.map +1 -1
  259. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +3 -3
  260. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts.map +1 -1
  261. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +2 -2
  262. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  263. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +3 -3
  264. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  265. package/dist/internal/protocol/spqr/spqr.d.ts +5 -5
  266. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  267. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  268. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +4 -4
  269. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
  270. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
  271. package/dist/internal/protocol/x3dh/x3dh.d.ts +3 -3
  272. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  273. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  274. package/dist/internal/sesame/device-registry.d.ts +16 -16
  275. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  276. package/dist/internal/sesame/device-registry.js +6 -6
  277. package/dist/internal/sesame/device-registry.js.map +1 -1
  278. package/dist/internal/sesame/index.d.ts +4 -4
  279. package/dist/internal/sesame/index.d.ts.map +1 -1
  280. package/dist/internal/sesame/index.js +2 -2
  281. package/dist/internal/sesame/index.js.map +1 -1
  282. package/dist/internal/sesame/manager.d.ts +10 -10
  283. package/dist/internal/sesame/manager.d.ts.map +1 -1
  284. package/dist/internal/sesame/manager.js +13 -13
  285. package/dist/internal/sesame/manager.js.map +1 -1
  286. package/dist/internal/sesame/types.d.ts +5 -5
  287. package/dist/internal/sesame/types.d.ts.map +1 -1
  288. package/dist/internal/session/cipher.d.ts +4 -4
  289. package/dist/internal/session/cipher.d.ts.map +1 -1
  290. package/dist/internal/session/cipher.js +31 -28
  291. package/dist/internal/session/cipher.js.map +1 -1
  292. package/dist/internal/session/decryption.js.map +1 -1
  293. package/dist/internal/session/factory.d.ts +3 -3
  294. package/dist/internal/session/factory.d.ts.map +1 -1
  295. package/dist/internal/session/factory.js.map +1 -1
  296. package/dist/internal/session/handshake.d.ts +2 -2
  297. package/dist/internal/session/handshake.d.ts.map +1 -1
  298. package/dist/internal/session/handshake.js.map +1 -1
  299. package/dist/internal/session/ratchet.d.ts +4 -4
  300. package/dist/internal/session/ratchet.d.ts.map +1 -1
  301. package/dist/internal/session/ratchet.js.map +1 -1
  302. package/dist/internal/session/types.d.ts +5 -5
  303. package/dist/internal/session/types.d.ts.map +1 -1
  304. package/dist/internal/session/validation.d.ts +3 -3
  305. package/dist/internal/session/validation.d.ts.map +1 -1
  306. package/dist/internal/session/validation.js.map +1 -1
  307. package/dist/layers.d.ts +4 -4
  308. package/dist/layers.d.ts.map +1 -1
  309. package/dist/layers.js +12 -12
  310. package/dist/layers.js.map +1 -1
  311. package/dist/local/store/expo/adapter.d.ts +15 -9
  312. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  313. package/dist/local/store/expo/adapter.js +29 -10
  314. package/dist/local/store/expo/adapter.js.map +1 -1
  315. package/dist/local/store/expo/database-key.d.ts +5 -5
  316. package/dist/local/store/expo/database-key.d.ts.map +1 -1
  317. package/dist/local/store/expo/database-key.js.map +1 -1
  318. package/dist/local/store/expo/index.d.ts +3 -3
  319. package/dist/local/store/expo/index.d.ts.map +1 -1
  320. package/dist/local/store/expo/key-storage.d.ts +11 -5
  321. package/dist/local/store/expo/key-storage.d.ts.map +1 -1
  322. package/dist/local/store/expo/key-storage.js +82 -17
  323. package/dist/local/store/expo/key-storage.js.map +1 -1
  324. package/dist/local/store/expo/models/kyber-prekey-used.d.ts +1 -4
  325. package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +1 -1
  326. package/dist/local/store/expo/models/kyber-prekey-used.js +23 -9
  327. package/dist/local/store/expo/models/kyber-prekey-used.js.map +1 -1
  328. package/dist/local/store/expo/models/kyber-prekey.d.ts +4 -4
  329. package/dist/local/store/expo/models/kyber-prekey.d.ts.map +1 -1
  330. package/dist/local/store/expo/models/kyber-prekey.js +67 -26
  331. package/dist/local/store/expo/models/kyber-prekey.js.map +1 -1
  332. package/dist/local/store/expo/schema.d.ts +21 -2
  333. package/dist/local/store/expo/schema.d.ts.map +1 -1
  334. package/dist/local/store/expo/schema.js +10 -2
  335. package/dist/local/store/expo/schema.js.map +1 -1
  336. package/dist/local/store/index.d.ts +3 -3
  337. package/dist/local/store/index.d.ts.map +1 -1
  338. package/dist/local/store/index.js +1 -1
  339. package/dist/local/store/kyber-prekey-lifecycle.d.ts +46 -0
  340. package/dist/local/store/kyber-prekey-lifecycle.d.ts.map +1 -0
  341. package/dist/local/store/kyber-prekey-lifecycle.js +88 -0
  342. package/dist/local/store/kyber-prekey-lifecycle.js.map +1 -0
  343. package/dist/local/store/memory/adapter.d.ts +14 -6
  344. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  345. package/dist/local/store/memory/adapter.js +114 -29
  346. package/dist/local/store/memory/adapter.js.map +1 -1
  347. package/dist/local/store/node/adapter.d.ts +9 -3
  348. package/dist/local/store/node/adapter.d.ts.map +1 -1
  349. package/dist/local/store/node/adapter.js +31 -13
  350. package/dist/local/store/node/adapter.js.map +1 -1
  351. package/dist/local/store/node/database-file-commit.d.ts +8 -0
  352. package/dist/local/store/node/database-file-commit.d.ts.map +1 -0
  353. package/dist/local/store/node/database-file-commit.js +62 -0
  354. package/dist/local/store/node/database-file-commit.js.map +1 -0
  355. package/dist/local/store/node/database-key.d.ts +6 -1
  356. package/dist/local/store/node/database-key.d.ts.map +1 -1
  357. package/dist/local/store/node/database-key.js +79 -44
  358. package/dist/local/store/node/database-key.js.map +1 -1
  359. package/dist/local/store/node/database-lock.d.ts +8 -0
  360. package/dist/local/store/node/database-lock.d.ts.map +1 -0
  361. package/dist/local/store/node/database-lock.js +44 -0
  362. package/dist/local/store/node/database-lock.js.map +1 -0
  363. package/dist/local/store/node/database.d.ts +17 -16
  364. package/dist/local/store/node/database.d.ts.map +1 -1
  365. package/dist/local/store/node/database.js +197 -202
  366. package/dist/local/store/node/database.js.map +1 -1
  367. package/dist/local/store/react-native/adapter.d.ts +10 -4
  368. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  369. package/dist/local/store/react-native/adapter.js +151 -66
  370. package/dist/local/store/react-native/adapter.js.map +1 -1
  371. package/dist/local/store/received-content.d.ts +9 -0
  372. package/dist/local/store/received-content.d.ts.map +1 -0
  373. package/dist/local/store/received-content.js +46 -0
  374. package/dist/local/store/received-content.js.map +1 -0
  375. package/dist/local/store/reliability.d.ts +4 -4
  376. package/dist/local/store/reliability.d.ts.map +1 -1
  377. package/dist/local/store/reliability.js +7 -4
  378. package/dist/local/store/reliability.js.map +1 -1
  379. package/dist/local/store/web/adapter.d.ts +11 -5
  380. package/dist/local/store/web/adapter.d.ts.map +1 -1
  381. package/dist/local/store/web/adapter.js +207 -74
  382. package/dist/local/store/web/adapter.js.map +1 -1
  383. package/dist/local/vault/expo-secure-store.d.ts +2 -2
  384. package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
  385. package/dist/local/vault/index.d.ts +1 -1
  386. package/dist/local/vault/index.d.ts.map +1 -1
  387. package/dist/logger.d.ts +4 -4
  388. package/dist/logger.d.ts.map +1 -1
  389. package/dist/logger.js.map +1 -1
  390. package/dist/media/index.d.ts +71 -61
  391. package/dist/media/index.d.ts.map +1 -1
  392. package/dist/media/index.js +550 -386
  393. package/dist/media/index.js.map +1 -1
  394. package/dist/media/prepared-upload.d.ts +37 -0
  395. package/dist/media/prepared-upload.d.ts.map +1 -0
  396. package/dist/media/prepared-upload.js +46 -0
  397. package/dist/media/prepared-upload.js.map +1 -0
  398. package/dist/profile/contact-state.d.ts +2 -2
  399. package/dist/profile/contact-state.d.ts.map +1 -1
  400. package/dist/profile/contact-state.js.map +1 -1
  401. package/dist/profile/profile-key.d.ts +2 -2
  402. package/dist/profile/profile-key.d.ts.map +1 -1
  403. package/dist/profile/profile-key.js.map +1 -1
  404. package/dist/profile/update-service.d.ts +2 -2
  405. package/dist/profile/update-service.d.ts.map +1 -1
  406. package/dist/profile/update-service.js.map +1 -1
  407. package/dist/remote/object-store/convex-r2/server.d.ts +2 -1
  408. package/dist/remote/object-store/convex-r2/server.d.ts.map +1 -1
  409. package/dist/remote/object-store/convex-r2/server.js +4 -0
  410. package/dist/remote/object-store/convex-r2/server.js.map +1 -1
  411. package/dist/remote/object-store/convex-r2/storage.d.ts.map +1 -1
  412. package/dist/remote/object-store/convex-r2/storage.js +1 -0
  413. package/dist/remote/object-store/convex-r2/storage.js.map +1 -1
  414. package/dist/remote/object-store/index.d.ts +3 -1
  415. package/dist/remote/object-store/index.d.ts.map +1 -1
  416. package/dist/remote/object-store/index.js +1 -1
  417. package/dist/remote/object-store/index.js.map +1 -1
  418. package/dist/remote/object-store/s3/storage.d.ts +3 -1
  419. package/dist/remote/object-store/s3/storage.d.ts.map +1 -1
  420. package/dist/remote/object-store/s3/storage.js +9 -2
  421. package/dist/remote/object-store/s3/storage.js.map +1 -1
  422. package/dist/remote/object-store/types.d.ts +33 -4
  423. package/dist/remote/object-store/types.d.ts.map +1 -1
  424. package/dist/remote/object-store/upload-error.d.ts +23 -0
  425. package/dist/remote/object-store/upload-error.d.ts.map +1 -0
  426. package/dist/remote/object-store/upload-error.js +33 -0
  427. package/dist/remote/object-store/upload-error.js.map +1 -0
  428. package/dist/remote/object-store/validation.d.ts +7 -1
  429. package/dist/remote/object-store/validation.d.ts.map +1 -1
  430. package/dist/remote/object-store/validation.js +39 -25
  431. package/dist/remote/object-store/validation.js.map +1 -1
  432. package/dist/remote/relay/index.d.ts +7 -14
  433. package/dist/remote/relay/index.d.ts.map +1 -1
  434. package/dist/remote/relay/index.js +6 -13
  435. package/dist/remote/relay/index.js.map +1 -1
  436. package/dist/remote/relay/memory/adapter.d.ts +5 -4
  437. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  438. package/dist/remote/relay/memory/adapter.js +14 -4
  439. package/dist/remote/relay/memory/adapter.js.map +1 -1
  440. package/dist/remote/relay/types.d.ts +36 -25
  441. package/dist/remote/relay/types.d.ts.map +1 -1
  442. package/dist/remote/relay/types.js +1 -1
  443. package/dist/types/api.d.ts +59 -24
  444. package/dist/types/api.d.ts.map +1 -1
  445. package/dist/types/index.js +1 -1
  446. package/dist/types/index.js.map +1 -1
  447. package/dist/types/session.d.ts +6 -0
  448. package/dist/types/session.d.ts.map +1 -1
  449. package/dist/types/session.js.map +1 -1
  450. package/docs/ASSURANCE.md +7 -7
  451. package/docs/CLIENT_COMPOSITION.md +16 -23
  452. package/docs/DEVIATIONS.md +1 -1
  453. package/docs/DOCUMENTATION_STANDARDS.md +4 -0
  454. package/docs/ERROR_HANDLING.md +2 -2
  455. package/docs/GETTING_STARTED.md +23 -38
  456. package/docs/INTERFACES.md +36 -27
  457. package/docs/PACKAGE_SURFACE.md +9 -16
  458. package/docs/RECIPES.md +10 -23
  459. package/examples/browser/index.html +2 -2
  460. package/groups/README.md +4 -4
  461. package/local/store/README.md +22 -7
  462. package/local/store/expo/README.md +24 -20
  463. package/local/store/memory/README.md +1 -1
  464. package/local/store/node/README.md +31 -2
  465. package/local/store/react-native/README.md +1 -1
  466. package/local/store/web/README.md +1 -1
  467. package/local/vault/README.md +1 -1
  468. package/media/README.md +94 -0
  469. package/package.json +17 -27
  470. package/remote/README.md +24 -24
  471. package/remote/object-store/README.md +8 -0
  472. package/remote/object-store/s3/README.md +10 -1
  473. package/remote/relay/README.md +4 -3
  474. package/remote/relay/memory/README.md +1 -1
  475. package/types/README.md +2 -2
  476. package/COMMERCIAL.md +0 -56
  477. package/dist/device/expo-metadata.d.ts.map +0 -1
  478. package/dist/device/expo-metadata.js.map +0 -1
  479. package/dist/remote/relay/convex/backend.d.ts +0 -394
  480. package/dist/remote/relay/convex/backend.d.ts.map +0 -1
  481. package/dist/remote/relay/convex/backend.js +0 -678
  482. package/dist/remote/relay/convex/backend.js.map +0 -1
  483. package/dist/remote/relay/convex/component/_generated/api.d.ts +0 -58
  484. package/dist/remote/relay/convex/component/_generated/api.d.ts.map +0 -1
  485. package/dist/remote/relay/convex/component/_generated/api.js +0 -31
  486. package/dist/remote/relay/convex/component/_generated/api.js.map +0 -1
  487. package/dist/remote/relay/convex/component/_generated/component.d.ts +0 -475
  488. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +0 -1
  489. package/dist/remote/relay/convex/component/_generated/component.js +0 -11
  490. package/dist/remote/relay/convex/component/_generated/component.js.map +0 -1
  491. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +0 -46
  492. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +0 -1
  493. package/dist/remote/relay/convex/component/_generated/dataModel.js +0 -11
  494. package/dist/remote/relay/convex/component/_generated/dataModel.js.map +0 -1
  495. package/dist/remote/relay/convex/component/_generated/server.d.ts +0 -129
  496. package/dist/remote/relay/convex/component/_generated/server.d.ts.map +0 -1
  497. package/dist/remote/relay/convex/component/_generated/server.js +0 -79
  498. package/dist/remote/relay/convex/component/_generated/server.js.map +0 -1
  499. package/dist/remote/relay/convex/component/accounts.d.ts +0 -45
  500. package/dist/remote/relay/convex/component/accounts.d.ts.map +0 -1
  501. package/dist/remote/relay/convex/component/accounts.js +0 -184
  502. package/dist/remote/relay/convex/component/accounts.js.map +0 -1
  503. package/dist/remote/relay/convex/component/certificates.d.ts +0 -10
  504. package/dist/remote/relay/convex/component/certificates.d.ts.map +0 -1
  505. package/dist/remote/relay/convex/component/certificates.js +0 -126
  506. package/dist/remote/relay/convex/component/certificates.js.map +0 -1
  507. package/dist/remote/relay/convex/component/cleanup.d.ts +0 -32
  508. package/dist/remote/relay/convex/component/cleanup.d.ts.map +0 -1
  509. package/dist/remote/relay/convex/component/cleanup.js +0 -146
  510. package/dist/remote/relay/convex/component/cleanup.js.map +0 -1
  511. package/dist/remote/relay/convex/component/convex.config.d.ts +0 -5
  512. package/dist/remote/relay/convex/component/convex.config.d.ts.map +0 -1
  513. package/dist/remote/relay/convex/component/convex.config.js +0 -35
  514. package/dist/remote/relay/convex/component/convex.config.js.map +0 -1
  515. package/dist/remote/relay/convex/component/crons.d.ts +0 -3
  516. package/dist/remote/relay/convex/component/crons.d.ts.map +0 -1
  517. package/dist/remote/relay/convex/component/crons.js +0 -10
  518. package/dist/remote/relay/convex/component/crons.js.map +0 -1
  519. package/dist/remote/relay/convex/component/devices.d.ts +0 -102
  520. package/dist/remote/relay/convex/component/devices.d.ts.map +0 -1
  521. package/dist/remote/relay/convex/component/devices.js +0 -300
  522. package/dist/remote/relay/convex/component/devices.js.map +0 -1
  523. package/dist/remote/relay/convex/component/errors.d.ts +0 -22
  524. package/dist/remote/relay/convex/component/errors.d.ts.map +0 -1
  525. package/dist/remote/relay/convex/component/errors.js +0 -17
  526. package/dist/remote/relay/convex/component/errors.js.map +0 -1
  527. package/dist/remote/relay/convex/component/groups.d.ts +0 -63
  528. package/dist/remote/relay/convex/component/groups.d.ts.map +0 -1
  529. package/dist/remote/relay/convex/component/groups.js +0 -341
  530. package/dist/remote/relay/convex/component/groups.js.map +0 -1
  531. package/dist/remote/relay/convex/component/keys.d.ts +0 -130
  532. package/dist/remote/relay/convex/component/keys.d.ts.map +0 -1
  533. package/dist/remote/relay/convex/component/keys.js +0 -578
  534. package/dist/remote/relay/convex/component/keys.js.map +0 -1
  535. package/dist/remote/relay/convex/component/messages.d.ts +0 -105
  536. package/dist/remote/relay/convex/component/messages.d.ts.map +0 -1
  537. package/dist/remote/relay/convex/component/messages.js +0 -702
  538. package/dist/remote/relay/convex/component/messages.js.map +0 -1
  539. package/dist/remote/relay/convex/component/provisioning.d.ts +0 -92
  540. package/dist/remote/relay/convex/component/provisioning.d.ts.map +0 -1
  541. package/dist/remote/relay/convex/component/provisioning.js +0 -360
  542. package/dist/remote/relay/convex/component/provisioning.js.map +0 -1
  543. package/dist/remote/relay/convex/component/runtime.d.ts +0 -18
  544. package/dist/remote/relay/convex/component/runtime.d.ts.map +0 -1
  545. package/dist/remote/relay/convex/component/runtime.js +0 -144
  546. package/dist/remote/relay/convex/component/runtime.js.map +0 -1
  547. package/dist/remote/relay/convex/component/schema.d.ts +0 -358
  548. package/dist/remote/relay/convex/component/schema.d.ts.map +0 -1
  549. package/dist/remote/relay/convex/component/schema.js +0 -288
  550. package/dist/remote/relay/convex/component/schema.js.map +0 -1
  551. package/dist/remote/relay/convex/component/zkAuth.d.ts +0 -18
  552. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +0 -1
  553. package/dist/remote/relay/convex/component/zkAuth.js +0 -86
  554. package/dist/remote/relay/convex/component/zkAuth.js.map +0 -1
  555. package/dist/remote/relay/convex/constants.d.ts +0 -3
  556. package/dist/remote/relay/convex/constants.d.ts.map +0 -1
  557. package/dist/remote/relay/convex/constants.js +0 -3
  558. package/dist/remote/relay/convex/constants.js.map +0 -1
  559. package/dist/remote/relay/convex/group-server.d.ts +0 -123
  560. package/dist/remote/relay/convex/group-server.d.ts.map +0 -1
  561. package/dist/remote/relay/convex/group-server.js +0 -184
  562. package/dist/remote/relay/convex/group-server.js.map +0 -1
  563. package/dist/remote/relay/convex/index.d.ts +0 -42
  564. package/dist/remote/relay/convex/index.d.ts.map +0 -1
  565. package/dist/remote/relay/convex/index.js +0 -38
  566. package/dist/remote/relay/convex/index.js.map +0 -1
  567. package/dist/remote/relay/convex/relay.d.ts +0 -323
  568. package/dist/remote/relay/convex/relay.d.ts.map +0 -1
  569. package/dist/remote/relay/convex/relay.js +0 -1144
  570. package/dist/remote/relay/convex/relay.js.map +0 -1
  571. package/dist/remote/relay/convex/types.d.ts +0 -24
  572. package/dist/remote/relay/convex/types.d.ts.map +0 -1
  573. package/dist/remote/relay/convex/types.js +0 -14
  574. package/dist/remote/relay/convex/types.js.map +0 -1
  575. package/remote/relay/convex/README.md +0 -61
  576. package/remote/relay/convex/component/README.md +0 -462
@@ -13,7 +13,7 @@ npm install @open-e2ee/signal-protocol-sdk
13
13
 
14
14
  In this monorepo, consumers use the package as a workspace package. App consumers
15
15
  should also install any runtime dependencies their chosen adapters need, such as
16
- Expo or Convex client packages.
16
+ Expo packages.
17
17
 
18
18
  ## What You Need
19
19
 
@@ -102,7 +102,7 @@ flowchart LR
102
102
  - The remote object store carries encrypted attachment/media bytes only.
103
103
 
104
104
  You can operate these server-side interfaces through a shipped or custom
105
- adapter. You can instead use [OpenE2EE Relay](https://open-e2ee.dev/relay) for
105
+ adapter. You can instead use [OpenE2EE Signal Protocol Relay](https://open-e2ee.dev/relay) for
106
106
  managed encrypted delivery, private encrypted attachment storage, push wakes,
107
107
  and lifecycle controls. The SDK does not require the managed service. The
108
108
  [Relay pricing page](https://open-e2ee.dev/relay/pricing) defines its exact
@@ -170,21 +170,16 @@ The production shape uses the same message API with platform adapters:
170
170
 
171
171
  <!-- doc-snippet:planned target-message-api-platform-adapters unshipped="@open-e2ee/signal-protocol-sdk/device/storage/expo" -->
172
172
  ```ts
173
- import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
173
+ import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
174
174
  import { createExpoDeviceStorage } from "@open-e2ee/signal-protocol-sdk/device/storage/expo";
175
- import { convexR2ObjectStore } from "@open-e2ee/signal-protocol-sdk/remote/object-store/convex-r2";
176
- import { convexRelay } from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
177
- import { api } from "../convex/_generated/api";
178
175
 
179
- const signal = await createSignalProtocolClient({
180
- identity: { userId, deviceId },
176
+ const signal = await createHostedSignalProtocolClient({
181
177
  adapters: {
182
178
  deviceStorage: createExpoDeviceStorage({ database, files }),
183
- relay: convexRelay({ convex, api, currentUserId: userId }),
184
- remoteObjectStore: convexR2ObjectStore({
185
- convex,
186
- api: api.signalObjectStore,
187
- }),
179
+ },
180
+ hosted: {
181
+ relayUrl: process.env.EXPO_PUBLIC_OPEN_E2EE_RELAY_URL!,
182
+ getIdentityAssertion,
188
183
  },
189
184
  });
190
185
  ```
@@ -320,40 +315,28 @@ session, and later messages use `ciphertext`.
320
315
 
321
316
  ## Production Client
322
317
 
323
- Use the protocol storage adapter for your runtime and the relay adapter for your
324
- backend. For the Signal Protocol stack, that is Expo local storage and a Convex
325
- relay:
318
+ Use the protocol storage adapter for your runtime and connect to the OpenE2EE
319
+ Signal Protocol Relay. For an Expo app, that is Expo local storage and the
320
+ hosted client:
326
321
 
327
322
  <!-- doc-snippet:skip requires-external-context -->
328
323
  ```ts
329
- import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
324
+ import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
330
325
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
331
- import {
332
- convexRelay,
333
- type ConvexSignalProtocolRelayApi,
334
- } from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
335
- import { api } from "../convex/_generated/api";
336
-
337
- const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
338
326
 
339
- // The relay handles server-side public keys, devices, and encrypted envelopes.
340
- const relay = convexRelay({
341
- convex,
342
- api: signalApi,
343
- currentUserId: userId,
344
- });
345
-
346
- const signal = await createSignalProtocolClient({
347
- identity: { userId },
327
+ // Initialize the application-owned Expo/SQLCipher database bindings first.
328
+ const signal = await createHostedSignalProtocolClient({
348
329
  adapters: {
349
- // Storage owns this device's private keys and session state.
330
+ // Expo storage owns this device's private keys and session state.
350
331
  storage: expoStore(),
351
- relay,
332
+ },
333
+ hosted: {
334
+ // The environment-scoped connection URL from the OpenE2EE console.
335
+ relayUrl: process.env.EXPO_PUBLIC_OPEN_E2EE_RELAY_URL!,
336
+ // Returns a short-lived signed assertion for the signed-in user.
337
+ getIdentityAssertion,
352
338
  },
353
339
  });
354
-
355
- // Publish this device's public prekeys so other devices can start sessions.
356
- await signal.syncToServer();
357
340
  ```
358
341
 
359
342
  Production bootstrapping must register or provision the current device with the
@@ -431,6 +414,8 @@ const signal = await createSignalProtocolClient({
431
414
  }),
432
415
  },
433
416
  media: {
417
+ preparedUploads: appPreparedUploads,
418
+ maxPreparedUploadBytes: appUploadBudgetBytes,
434
419
  loadLocalAttachment: async ({ localMediaId }) =>
435
420
  appDraftMedia.readBytes(localMediaId),
436
421
  saveUploadedAttachment: async ({ localMediaId, attachment }) =>
@@ -12,31 +12,31 @@ policy.
12
12
 
13
13
  ```text
14
14
  SignalProtocolClient
15
- ├── ISignalProtocolLocalStore device-local protocol state
16
- ├── ISignalProtocolRelayServer authenticated device, prekey, and envelope service
15
+ ├── SignalProtocolLocalStore device-local protocol state
16
+ ├── SignalProtocolRelayServer authenticated device, prekey, and envelope service
17
17
  ├── SignalProtocolRemoteObjectStore brokered encrypted-object operations (optional)
18
18
  ├── media callbacks application-owned attachment bytes and caches
19
19
  └── lifecycle hooks application reactions and observability
20
20
 
21
21
  Local-store bootstrap
22
- └── ISignalProtocolLocalSecretVault small platform-managed bootstrap secrets
22
+ └── SignalProtocolLocalSecretVault small platform-managed bootstrap secrets
23
23
  ```
24
24
 
25
25
  The interfaces are public contracts, but they do not make an implementation
26
26
  secure by themselves. Each adapter must preserve the ownership and atomicity
27
27
  requirements described below.
28
28
 
29
- ## `ISignalProtocolLocalStore`
29
+ ## `SignalProtocolLocalStore`
30
30
 
31
- `ISignalProtocolLocalStore` persists the current device's identities, prekeys, sessions,
31
+ `SignalProtocolLocalStore` persists the current device's identities, prekeys, sessions,
32
32
  sender keys, contact trust, retry records, and operational metadata.
33
33
 
34
34
  <!-- doc-snippet:skip requires-external-context -->
35
35
  ```ts
36
- import type { ISignalProtocolLocalStore } from "@open-e2ee/signal-protocol-sdk/local/store";
36
+ import type { SignalProtocolLocalStore } from "@open-e2ee/signal-protocol-sdk/local/store";
37
37
  import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
38
38
 
39
- const storage: ISignalProtocolLocalStore = appProtocolStore;
39
+ const storage: SignalProtocolLocalStore = appProtocolStore;
40
40
 
41
41
  const client = await createSignalProtocolClient({
42
42
  identity: { userId },
@@ -57,17 +57,17 @@ A production implementation must:
57
57
  The [local-store guide](../local/store/README.md) lists the available adapters
58
58
  and their status.
59
59
 
60
- ## `ISignalProtocolLocalSecretVault`
60
+ ## `SignalProtocolLocalSecretVault`
61
61
 
62
- `ISignalProtocolLocalSecretVault` is a deliberately small interface for bootstrap
62
+ `SignalProtocolLocalSecretVault` is a deliberately small interface for bootstrap
63
63
  secrets that must live outside the main local store, such as a database
64
64
  encryption key.
65
65
 
66
66
  <!-- doc-snippet:skip requires-external-context -->
67
67
  ```ts
68
- import type { ISignalProtocolLocalSecretVault } from "@open-e2ee/signal-protocol-sdk";
68
+ import type { SignalProtocolLocalSecretVault } from "@open-e2ee/signal-protocol-sdk";
69
69
 
70
- const vault: ISignalProtocolLocalSecretVault = {
70
+ const vault: SignalProtocolLocalSecretVault = {
71
71
  getSecret: (name) => platformSecrets.getBytes(name),
72
72
  setSecret: (name, value) => platformSecrets.setBytes(name, value),
73
73
  deleteSecret: (name) => platformSecrets.delete(name),
@@ -79,28 +79,21 @@ device migration, uninstall persistence, and deletion behavior depend on the
79
79
  selected platform service and host configuration. See the
80
80
  [secret-vault guide](../local/vault/README.md).
81
81
 
82
- ## `ISignalProtocolRelayServer`
82
+ ## `SignalProtocolRelayServer`
83
83
 
84
- `ISignalProtocolRelayServer` represents the authenticated application backend used for
84
+ `SignalProtocolRelayServer` represents the authenticated application backend used for
85
85
  device registration, account identity state, public prekeys, encrypted-envelope
86
86
  delivery, provisioning, key rotation, and encrypted group coordination.
87
87
 
88
88
  <!-- doc-snippet:skip requires-external-context -->
89
89
  ```ts
90
- import type { ISignalProtocolRelayServer } from "@open-e2ee/signal-protocol-sdk/remote/relay";
91
- import {
92
- convexRelay,
93
- type ConvexSignalProtocolRelayApi,
94
- } from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
95
- import { api } from "../convex/_generated/api";
96
-
97
- const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
98
-
99
- const relay: ISignalProtocolRelayServer = convexRelay({
100
- convex,
101
- api: signalApi,
102
- currentUserId: userId,
103
- });
90
+ import type { SignalProtocolRelayServer } from "@open-e2ee/signal-protocol-sdk/remote/relay";
91
+ import { inMemoryRelay } from "@open-e2ee/signal-protocol-sdk/remote/relay/memory";
92
+
93
+ // Development uses the in-memory relay. Production connects to the OpenE2EE
94
+ // Signal Protocol Relay through `createHostedSignalProtocolClient()`, or to an
95
+ // application backend that implements this interface.
96
+ const relay: SignalProtocolRelayServer = inMemoryRelay();
104
97
  ```
105
98
 
106
99
  The application backend must:
@@ -114,6 +107,20 @@ The application backend must:
114
107
 
115
108
  A client-supplied user identifier is a routing input, not proof of identity.
116
109
 
110
+ Each adapter implements `getPreKeyInventory` for prekey synchronization.
111
+ It returns both reusable-key metadata records and both one-time-key counts.
112
+ These observations do not consume keys, reserve a version, or authorize an upload.
113
+ Callers request new observations after intervening work.
114
+ The Signal Protocol Relay persists a separate public-eligibility snapshot for its published
115
+ prekeys. A publication reads the current public inventory, names its exact
116
+ predecessor revision, persists one pending receipt before the request, and reads
117
+ the accepted inventory before it commits the new receipt. An exact retry can
118
+ recover a lost response. A stale or reordered writer cannot restore material
119
+ that the Relay already issued. Retained private prekeys are not a publication
120
+ inventory.
121
+
122
+ The server remains responsible for atomic one-time-key consumption.
123
+
117
124
  The relay stores public protocol material, ciphertext, and required routing
118
125
  metadata. It must not require device private keys or decrypted message content.
119
126
  See the [relay guide](../remote/relay/README.md).
@@ -165,6 +172,8 @@ const client = await createSignalProtocolClient({
165
172
  identity: { userId },
166
173
  adapters: { storage, relay, remoteObjectStore },
167
174
  media: {
175
+ preparedUploads: appPreparedUploads,
176
+ maxPreparedUploadBytes: appUploadBudgetBytes,
168
177
  loadLocalAttachment: ({ localMediaId }) =>
169
178
  appDrafts.readBytes(localMediaId),
170
179
  saveUploadedAttachment: ({ localMediaId, attachment }) =>
@@ -59,14 +59,11 @@ import {
59
59
  ```
60
60
 
61
61
  The root package intentionally does not re-export platform-bound adapters like
62
- Expo storage or Convex helpers.
62
+ Expo storage or the Convex R2 object store.
63
63
 
64
64
  ## Integration subpaths
65
65
 
66
66
  - `@open-e2ee/signal-protocol-sdk/remote/relay`
67
- - `@open-e2ee/signal-protocol-sdk/remote/relay/convex`
68
- - `@open-e2ee/signal-protocol-sdk/remote/relay/convex/relay`
69
- - `@open-e2ee/signal-protocol-sdk/convex.config`
70
67
  - `@open-e2ee/signal-protocol-sdk/remote/relay/memory`
71
68
  - `@open-e2ee/signal-protocol-sdk/remote/relay/types`
72
69
  - `@open-e2ee/signal-protocol-sdk/remote/object-store`
@@ -83,13 +80,14 @@ Expo storage or Convex helpers.
83
80
  - `@open-e2ee/signal-protocol-sdk/device`
84
81
  - `@open-e2ee/signal-protocol-sdk/device/constants`
85
82
  - `@open-e2ee/signal-protocol-sdk/device/device-id`
86
- - `@open-e2ee/signal-protocol-sdk/device/expo-metadata`
83
+ - `@open-e2ee/signal-protocol-sdk/device/expo`
87
84
  - `@open-e2ee/signal-protocol-sdk/device/lifecycle`
88
85
  - `@open-e2ee/signal-protocol-sdk/device/provisioning`
89
86
  - `@open-e2ee/signal-protocol-sdk/encoding`
90
87
  - `@open-e2ee/signal-protocol-sdk/encoding/hex`
91
88
  - `@open-e2ee/signal-protocol-sdk/files`
92
89
  - `@open-e2ee/signal-protocol-sdk/groups`
90
+ - `@open-e2ee/signal-protocol-sdk/groups/server`
93
91
  - `@open-e2ee/signal-protocol-sdk/hooks`
94
92
  - `@open-e2ee/signal-protocol-sdk/hooks/use-connection-presence`
95
93
  - `@open-e2ee/signal-protocol-sdk/keys`
@@ -146,15 +144,10 @@ Expo storage or Convex helpers.
146
144
 
147
145
  ### Relay implementations
148
146
 
149
- - `ConvexSignalProtocolRelayServer` for Convex-backed apps
150
- - `convexRelay()` for Convex-backed composition
151
- - the installable component from
152
- `@open-e2ee/signal-protocol-sdk/convex.config`, with public handlers from
153
- `defineConvexSignalProtocolBackend()` and the `oe-groups` CLI
154
- (`npx oe-groups trust-root`) for secret initialization and trust-root
155
- export
147
+ - `createHostedSignalProtocolClient()` from the package root for the OpenE2EE
148
+ Signal Protocol Relay
156
149
  - `InMemorySignalProtocolRelayServer` / `inMemoryRelay()` for local development
157
- - custom implementations via `ISignalProtocolRelayServer`
150
+ - custom implementations via `SignalProtocolRelayServer`
158
151
 
159
152
  ### Storage implementations
160
153
 
@@ -169,7 +162,7 @@ Expo storage or Convex helpers.
169
162
  backend-conformance kit)
170
163
  - `NodeSignalProtocolStore` / `nodeStore()` for Node environments
171
164
  - `InMemorySignalProtocolStore` / `inMemoryStore()` for local development
172
- - custom implementations via `ISignalProtocolLocalStore`
165
+ - custom implementations via `SignalProtocolLocalStore`
173
166
 
174
167
  ### Remote object store
175
168
 
@@ -210,12 +203,12 @@ implement the same `MediaAttachmentTransfer` seam.
210
203
 
211
204
  ## Design notes
212
205
 
213
- - `SignalProtocolClient.create()` requires `storage`. There are no hidden
206
+ - `DefaultSignalProtocolClient.create()` requires `storage`. There are no hidden
214
207
  default adapters.
215
208
  - `createSignalProtocolClient()` is the preferred composition helper when app
216
209
  code owns multiple adapters.
217
210
  - Linked devices must already contain provisioned identity material before
218
- `SignalProtocolClient.create(..., { deviceId: 2 })`.
211
+ `DefaultSignalProtocolClient.create(..., { deviceId: 2 })`.
219
212
  - Username-only apps typically run ACI-only. Phone-capable apps can enable both
220
213
  ACI and PNI with `enablePniKeys: true`.
221
214
  - `protocol.postQuantum` and `protocol.braid` are product-facing policy.
package/docs/RECIPES.md CHANGED
@@ -93,39 +93,26 @@ the session. Later messages on the same session use `ciphertext`. In both cases
93
93
  the relay sees encrypted envelope bytes. Bob receives decrypted content only
94
94
  through the `onMessageDecrypted` hook.
95
95
 
96
- ## Production composition with Convex + Expo
96
+ ## Production composition with Expo on the Signal Protocol Relay
97
97
 
98
98
  <!-- doc-snippet:skip requires-external-context -->
99
99
  ```ts
100
- import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
101
- import {
102
- convexRelay,
103
- type ConvexSignalProtocolRelayApi,
104
- } from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
100
+ import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
105
101
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
106
- import { api } from "../convex/_generated/api";
107
-
108
- const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
109
-
110
- // The relay handles server-side public keys, devices, and encrypted envelopes.
111
- const relay = convexRelay({
112
- convex,
113
- api: signalApi,
114
- currentUserId: userId,
115
- });
116
102
 
117
103
  // Initialize the application-owned Expo/SQLCipher database bindings first.
118
- const signal = await createSignalProtocolClient({
119
- identity: { userId },
104
+ const signal = await createHostedSignalProtocolClient({
120
105
  adapters: {
121
- // Storage owns this device's private keys and session state.
106
+ // Expo storage owns this device's private keys and session state.
122
107
  storage: expoStore(),
123
- relay,
108
+ },
109
+ hosted: {
110
+ // The environment-scoped connection URL from the OpenE2EE console.
111
+ relayUrl: process.env.EXPO_PUBLIC_OPEN_E2EE_RELAY_URL!,
112
+ // Returns a short-lived signed assertion for the signed-in user.
113
+ getIdentityAssertion,
124
114
  },
125
115
  });
126
-
127
- // Publish this device's public prekeys so other devices can start sessions.
128
- await signal.syncToServer();
129
116
  ```
130
117
 
131
118
  Production bootstrapping must register or provision the current device with the
@@ -19,8 +19,8 @@
19
19
  <p id="status" role="status">Ready</p>
20
20
  <pre id="output" aria-label="Execution output" tabindex="0"></pre>
21
21
  <p>The browser console shows the same results. Ciphertext changes on each run.</p>
22
- <p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v2.0.2/examples/browser/src/exchange.ts">Read the exchange code</a> · <a href="https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v2.0.2/examples/browser">Edit on StackBlitz</a></p>
23
- <p>Continue with <a href="https://docs.open-e2ee.dev/start/browser">browser storage</a>, <a href="https://docs.open-e2ee.dev/start/expo">Expo / Hermes setup</a>, or <a href="https://open-e2ee.dev/relay">OpenE2EE Relay for separate devices</a>.</p>
22
+ <p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v4.0.0/examples/browser/src/exchange.ts">Read the exchange code</a> · <a href="https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v4.0.0/examples/browser">Edit on StackBlitz</a></p>
23
+ <p>Continue with <a href="https://docs.open-e2ee.dev/start/browser">browser storage</a>, <a href="https://docs.open-e2ee.dev/start/expo">Expo / Hermes setup</a>, or <a href="https://open-e2ee.dev/relay">the OpenE2EE Signal Protocol Relay for separate devices</a>.</p>
24
24
  </main>
25
25
  <script type="module" src="/src/main.ts"></script>
26
26
  </body>
package/groups/README.md CHANGED
@@ -18,13 +18,13 @@ and sender-key rotation.
18
18
  import {
19
19
  GroupManager,
20
20
  createGroupId,
21
- type IGroupServer,
22
- type IGroupStateStore,
21
+ type GroupServer,
22
+ type GroupStateStore,
23
23
  } from "@open-e2ee/signal-protocol-sdk/groups";
24
24
 
25
25
  const groups = new GroupManager({
26
- store: appGroupStore as IGroupStateStore,
27
- server: appGroupServer as IGroupServer,
26
+ store: appGroupStore as GroupStateStore,
27
+ server: appGroupServer as GroupServer,
28
28
  issueCredential: () => appGroupCredentials.issue(),
29
29
  credentialPublicKey,
30
30
  serverSigningPublicKey,
@@ -1,6 +1,6 @@
1
1
  # Storage Guide
2
2
 
3
- > Infrastructure | Implements `ISignalProtocolLocalStore` | [Architecture](../../ARCHITECTURE.md)
3
+ > Infrastructure | Implements `SignalProtocolLocalStore` | [Architecture](../../ARCHITECTURE.md)
4
4
 
5
5
  The storage layer owns device-local Signal Protocol state: identity keys,
6
6
  contact trust, prekeys, sessions, and retry/message-record metadata.
@@ -8,7 +8,7 @@ contact trust, prekeys, sessions, and retry/message-record metadata.
8
8
  ## Why it exists
9
9
 
10
10
  Protocol state must survive restarts and several security transitions must
11
- commit atomically. `ISignalProtocolLocalStore` makes those requirements explicit
11
+ commit atomically. `SignalProtocolLocalStore` makes those requirements explicit
12
12
  without coupling the client to a database or platform.
13
13
 
14
14
  ## Current Support
@@ -50,7 +50,7 @@ exported backend-conformance kit described in the
50
50
 
51
51
  The experimental label comes off an adapter when every item below is a named,
52
52
  continuously running CI gate. Each gate tests the adapter's own contract,
53
- which is the set of promises `ISignalProtocolLocalStore` makes. No gate tests
53
+ which is the set of promises `SignalProtocolLocalStore` makes. No gate tests
54
54
  the platform under it. Browsers, IndexedDB, and React Native are the
55
55
  environment an adapter must honor its promises in, not the subject of a test.
56
56
 
@@ -144,11 +144,11 @@ state, retry message records, and recovery helpers.
144
144
 
145
145
  <!-- doc-snippet:skip requires-external-context -->
146
146
  ```ts
147
- import { SignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
147
+ import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
148
148
  import { ExpoSignalProtocolStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
149
149
 
150
150
  // Configure the application-owned Expo/SQLCipher database bindings first.
151
- const signal = await SignalProtocolClient.create(userId, {
151
+ const signal = await DefaultSignalProtocolClient.create(userId, {
152
152
  storage: new ExpoSignalProtocolStore(),
153
153
  });
154
154
  ```
@@ -157,7 +157,7 @@ The [Expo guide](./expo/README.md) shows the required database bootstrap.
157
157
 
158
158
  ## Storage Responsibilities
159
159
 
160
- An `ISignalProtocolLocalStore` implementation must preserve:
160
+ An `SignalProtocolLocalStore` implementation must preserve:
161
161
 
162
162
  - account identity key storage
163
163
  - contact identity trust / TOFU decisions
@@ -187,7 +187,7 @@ every live session.
187
187
 
188
188
  ## Atomic Security Commits
189
189
 
190
- Contact trust and session creation/advancement share one atomic commit seam.
190
+ Contact trust and session creation/advancement share one atomic commit boundary.
191
191
  Responder one-time-prekey consumption joins that same transaction. Separately,
192
192
  one logical transaction accepts an identity rotation and deletes every bound
193
193
  device session. An adapter must never publish only a subset of either
@@ -205,6 +205,21 @@ identity.
205
205
 
206
206
  ## Design Notes
207
207
 
208
+ Received content uses the same encryption and transaction boundary as protocol state.
209
+
210
+ The `commitSessionTrust` method commits received content, ratchet state, contact trust, and consumed prekeys together.
211
+ The `storeSenderKeyRecord` method commits received content and skipped-key consumption together.
212
+
213
+ An adapter must reject the complete transaction if any write fails.
214
+ `getReceivedContent`, `deleteReceivedContent`, and `deleteExpiredReceivedContent`
215
+ own recovery and cleanup. Generic unencrypted metadata cannot hold this content.
216
+ The Node adapter uses its encrypted security document. Expo uses SQLCipher.
217
+ Web and React Native encrypt each content record with their existing store key.
218
+
219
+ The SDK removes content after durable handling and retains separate bounded
220
+ duplicate evidence. Cleanup uses the existing thirty-day retry horizon.
221
+ The host application must use idempotent writes keyed by message ID.
222
+
208
223
  - The Expo adapter is the primary supported mobile implementation. Deployment
209
224
  still requires review of key custody, backups, and host security.
210
225
  - `@open-e2ee/signal-protocol-sdk/local/store/expo` is also the package home for Expo-specific
@@ -1,6 +1,6 @@
1
1
  # Expo Store
2
2
 
3
- `ExpoSignalProtocolStore` implements `ISignalProtocolLocalStore` for Expo and React Native with
3
+ `ExpoSignalProtocolStore` implements `SignalProtocolLocalStore` for Expo and React Native with
4
4
  an application-owned SQLite/Drizzle database and a database key held through
5
5
  the local secret-vault boundary.
6
6
 
@@ -14,29 +14,31 @@ schema and transaction lifecycle.
14
14
 
15
15
  ## Database setup
16
16
 
17
- Compose the exported table definitions into the application schema, configure
17
+ The package ships the authoritative Drizzle table definitions at
18
+ `@open-e2ee/signal-protocol-sdk/local/store/expo/schema`. The host application
19
+ owns migration generation and execution. Generate migrations from the package
20
+ version that the application uses. Apply those migrations before the store
21
+ makes its first query.
22
+
23
+ Compose the exported table definitions into the application schema. Configure
18
24
  the database bindings once during bootstrap, and apply the database key before
19
25
  the first query:
20
26
 
21
27
  <!-- doc-snippet:skip requires-external-context -->
28
+
22
29
  ```ts
23
- import {
24
- configureSignalProtocolExpoDbBindings,
25
- } from "@open-e2ee/signal-protocol-sdk/local/store/expo/db";
26
- import {
27
- getDatabaseKeyManager,
28
- } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
29
- import * as signalSchema from "@open-e2ee/signal-protocol-sdk/local/store/expo/schema";
30
+ import { configureSignalProtocolExpoDbBindings } from '@open-e2ee/signal-protocol-sdk/local/store/expo/db';
31
+ import { getDatabaseKeyManager } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
32
+ import * as signalSchema from '@open-e2ee/signal-protocol-sdk/local/store/expo/schema';
30
33
 
31
34
  const keyManager = getDatabaseKeyManager();
32
35
  await keyManager.initialize();
33
36
  const sqlCipherPassword = await keyManager.getPassword();
34
37
 
35
- const { rawDatabase, drizzleDatabase } =
36
- await appDatabase.openEncryptedSignalProtocolDatabase({
37
- password: sqlCipherPassword,
38
- schema: signalSchema,
39
- });
38
+ const { rawDatabase, drizzleDatabase } = await appDatabase.openEncryptedSignalProtocolDatabase({
39
+ password: sqlCipherPassword,
40
+ schema: signalSchema,
41
+ });
40
42
 
41
43
  configureSignalProtocolExpoDbBindings({
42
44
  getDrizzle: async () => drizzleDatabase,
@@ -52,6 +54,10 @@ bootstrap. It must:
52
54
  - create or migrate the exported tables
53
55
  - return the matching raw and Drizzle handles
54
56
 
57
+ Do not copy the exported table definitions into an application-owned schema.
58
+ Copied definitions can omit key ownership constraints when the package schema
59
+ changes.
60
+
55
61
  SQLCipher requires a development build and is not available in Expo Go.
56
62
 
57
63
  Every table this store exports holds material that must not leave the device.
@@ -67,16 +73,14 @@ Do not back these tables up to a server or sync them between devices.
67
73
  ## Client usage
68
74
 
69
75
  <!-- doc-snippet:skip requires-external-context -->
76
+
70
77
  ```ts
71
- import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
72
- import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
78
+ import { createSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
79
+ import { expoStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
73
80
 
74
81
  const client = await createSignalProtocolClient({
75
82
  identity: { userId },
76
- adapters: {
77
- storage: expoStore(),
78
- relay,
79
- },
83
+ adapters: { storage: expoStore(), relay },
80
84
  });
81
85
  ```
82
86
 
@@ -1,6 +1,6 @@
1
1
  # In-Memory Store
2
2
 
3
- `InMemorySignalProtocolStore` implements `ISignalProtocolLocalStore` in memory for examples, local
3
+ `InMemorySignalProtocolStore` implements `SignalProtocolLocalStore` in memory for examples, local
4
4
  development, and deterministic application prototypes.
5
5
 
6
6
  The protocol and cryptography are real. The adapter simulates the
@@ -3,12 +3,12 @@
3
3
  `NodeSignalProtocolStore` provides Node.js protocol storage using encrypted,
4
4
  crash-durable filesystem state.
5
5
 
6
- It implements all of `ISignalProtocolLocalStore`. That covers identity,
6
+ It implements all of `SignalProtocolLocalStore`. That covers identity,
7
7
  prekeys, sessions, Kyber prekeys, Sesame device records, sender keys, and
8
8
  message records. Multi-device and group flows therefore work in Node without a
9
9
  custom adapter.
10
10
 
11
- The class declares `implements ISignalProtocolLocalStore`, so the compiler
11
+ The class declares `implements SignalProtocolLocalStore`, so the compiler
12
12
  rejects any build that omits a member or changes its signature. That check is
13
13
  the guarantee behind this paragraph, not a manual audit.
14
14
 
@@ -20,6 +20,16 @@ boundary while allowing each deployment to choose an explicit data directory.
20
20
 
21
21
  ## Usage
22
22
 
23
+ Install the Node adapter's native file-lock dependency:
24
+
25
+ ```sh
26
+ npm install fs-native-extensions@1.2.7
27
+ ```
28
+
29
+ The exact version passes the supported-runtime checks on Node.js 22 and 26.
30
+ Dependency upgrades must pass the supported-runtime checks. Other adapters do not load this dependency.
31
+ If the native module or file locking is unavailable, the Node store refuses to open.
32
+
23
33
  <!-- doc-snippet:skip requires-external-context -->
24
34
  ```ts
25
35
  import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
@@ -41,5 +51,24 @@ account isolation, backups, volume security, process access, and secure account
41
51
  reset. Do not place the store on an eventually consistent or multi-writer
42
52
  network filesystem.
43
53
 
54
+ ## Concurrent access and reset
55
+
56
+ A kernel file lock serializes security-state transactions across processes and
57
+ independent handles. Directory aliases use the same lock inode.
58
+ The lock covers the key check, state read, conditional mutation, and durable write.
59
+ It does not make several SDK calls one transaction.
60
+
61
+ A contender stops after 30 seconds without acquiring the lock. It does not
62
+ remove the lock or continue without exclusion. Process termination releases
63
+ the kernel lock. The next initialization removes interrupted temporary writes.
64
+
65
+ Reset removes stored data but retains the empty `.database.lock` file and its
66
+ directory. It preserves unrelated files. Do not remove the lock file while a process can use the store.
67
+ An interrupted reset blocks access until an explicit reset finishes.
68
+ Handles with the old database key refuse subsequent writes after reset.
69
+
70
+ The application owns a coordinated key rotation across all encrypted records.
71
+ Changing only the key file is not a complete rotation.
72
+
44
73
  See the parent [storage guide](../README.md), [adapter guide](../../../ADAPTERS.md),
45
74
  and [security model](../../../docs/SECURITY.md).
@@ -1,6 +1,6 @@
1
1
  # Bare React Native Store
2
2
 
3
- `ReactNativeSignalProtocolStore` implements `ISignalProtocolLocalStore` for bare React Native
3
+ `ReactNativeSignalProtocolStore` implements `SignalProtocolLocalStore` for bare React Native
4
4
  through an application-provided persistent key-value backend.
5
5
 
6
6
  ## Why it exists
@@ -1,6 +1,6 @@
1
1
  # IndexedDB Store
2
2
 
3
- `IndexedDbSignalProtocolStore` implements the full `ISignalProtocolLocalStore` contract for web
3
+ `IndexedDbSignalProtocolStore` implements the full `SignalProtocolLocalStore` contract for web
4
4
  browsers using IndexedDB and Web Crypto.
5
5
 
6
6
  ## Why it exists
@@ -7,7 +7,7 @@ The local secret vault stores small bootstrap secrets through a minimal
7
7
 
8
8
  Platform secret managers are appropriate for tiny keys and bootstrap values,
9
9
  but not full session databases. A vault separate from
10
- `ISignalProtocolLocalStore` keeps platform limits explicit. A local store can
10
+ `SignalProtocolLocalStore` keeps platform limits explicit. A local store can
11
11
  then use a vault-held wrapping key without placing every protocol record in the
12
12
  platform keychain.
13
13