@open-e2ee/signal-protocol-sdk 0.1.0-alpha.7 → 0.1.0-alpha.9

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 (655) hide show
  1. package/ADAPTERS.md +1 -1
  2. package/CHANGELOG.md +767 -2
  3. package/COMMERCIAL.md +56 -0
  4. package/README.md +13 -8
  5. package/SECURITY.md +15 -1
  6. package/client/README.md +1 -1
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +16 -8
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/config.d.ts +12 -2
  11. package/dist/client/config.d.ts.map +1 -1
  12. package/dist/client/config.js.map +1 -1
  13. package/dist/client/endorsement-manager.d.ts +19 -2
  14. package/dist/client/endorsement-manager.d.ts.map +1 -1
  15. package/dist/client/endorsement-manager.js +26 -10
  16. package/dist/client/endorsement-manager.js.map +1 -1
  17. package/dist/client/headless.d.ts +1 -1
  18. package/dist/client/headless.js +1 -1
  19. package/dist/client/sealed-sender-ops.d.ts +27 -1
  20. package/dist/client/sealed-sender-ops.d.ts.map +1 -1
  21. package/dist/client/sealed-sender-ops.js +36 -6
  22. package/dist/client/sealed-sender-ops.js.map +1 -1
  23. package/dist/client/signal-service-cipher.d.ts +16 -1
  24. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  25. package/dist/client/signal-service-cipher.js +112 -52
  26. package/dist/client/signal-service-cipher.js.map +1 -1
  27. package/dist/client/types.d.ts +20 -7
  28. package/dist/client/types.d.ts.map +1 -1
  29. package/dist/client/types.js.map +1 -1
  30. package/dist/index.d.ts +7 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/internal/crypto/index.d.ts +1 -1
  35. package/dist/internal/crypto/index.d.ts.map +1 -1
  36. package/dist/internal/crypto/index.js +1 -1
  37. package/dist/internal/crypto/index.js.map +1 -1
  38. package/dist/internal/crypto/random.d.ts +9 -0
  39. package/dist/internal/crypto/random.d.ts.map +1 -1
  40. package/dist/internal/crypto/random.js +16 -0
  41. package/dist/internal/crypto/random.js.map +1 -1
  42. package/dist/internal/groups/manager.d.ts +37 -5
  43. package/dist/internal/groups/manager.d.ts.map +1 -1
  44. package/dist/internal/groups/manager.js +98 -15
  45. package/dist/internal/groups/manager.js.map +1 -1
  46. package/dist/internal/groups/server-engine.d.ts +48 -2
  47. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  48. package/dist/internal/groups/server-engine.js +122 -13
  49. package/dist/internal/groups/server-engine.js.map +1 -1
  50. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +1 -1
  51. package/dist/internal/protocol/sealed-sender/decryption-v2.js +32 -18
  52. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
  53. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  54. package/dist/internal/protocol/sealed-sender/decryption.js +33 -19
  55. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  56. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +1 -1
  57. package/dist/internal/protocol/sealed-sender/encryption-v2.js +8 -14
  58. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
  59. package/dist/internal/protocol/sealed-sender/encryption.d.ts +9 -4
  60. package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
  61. package/dist/internal/protocol/sealed-sender/encryption.js +7 -15
  62. package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
  63. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +6 -7
  64. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  65. package/dist/internal/protocol/sealed-sender/proto/index.js +5 -7
  66. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  67. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +45 -0
  68. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -0
  69. package/dist/internal/protocol/sealed-sender/trust-root.js +77 -0
  70. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -0
  71. package/dist/internal/protocol/sealed-sender/types.d.ts +64 -9
  72. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  73. package/dist/internal/protocol/sealed-sender/types.js +43 -0
  74. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  75. package/dist/internal/protocol/sender-keys/manager.d.ts +37 -0
  76. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  77. package/dist/internal/protocol/sender-keys/manager.js +108 -7
  78. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  79. package/dist/local/store/expo/adapter.d.ts +14 -15
  80. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  81. package/dist/local/store/expo/adapter.js +109 -102
  82. package/dist/local/store/expo/adapter.js.map +1 -1
  83. package/dist/local/store/expo/db.d.ts +4 -1
  84. package/dist/local/store/expo/db.d.ts.map +1 -1
  85. package/dist/local/store/expo/db.js +5 -0
  86. package/dist/local/store/expo/db.js.map +1 -1
  87. package/dist/local/store/expo/index.d.ts +0 -2
  88. package/dist/local/store/expo/index.d.ts.map +1 -1
  89. package/dist/local/store/expo/index.js +1 -1
  90. package/dist/local/store/expo/index.js.map +1 -1
  91. package/dist/local/store/expo/models/index.d.ts +1 -1
  92. package/dist/local/store/expo/models/index.d.ts.map +1 -1
  93. package/dist/local/store/expo/models/index.js +2 -2
  94. package/dist/local/store/expo/models/index.js.map +1 -1
  95. package/dist/local/store/expo/models/sender-key.d.ts +101 -77
  96. package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
  97. package/dist/local/store/expo/models/sender-key.js +154 -124
  98. package/dist/local/store/expo/models/sender-key.js.map +1 -1
  99. package/dist/local/store/expo/schema.d.ts +134 -32
  100. package/dist/local/store/expo/schema.d.ts.map +1 -1
  101. package/dist/local/store/expo/schema.js +36 -7
  102. package/dist/local/store/expo/schema.js.map +1 -1
  103. package/dist/local/store/mock/adapter.d.ts +1 -0
  104. package/dist/local/store/mock/adapter.d.ts.map +1 -1
  105. package/dist/local/store/mock/adapter.js +18 -0
  106. package/dist/local/store/mock/adapter.js.map +1 -1
  107. package/dist/local/store/node/adapter.d.ts +53 -4
  108. package/dist/local/store/node/adapter.d.ts.map +1 -1
  109. package/dist/local/store/node/adapter.js +456 -9
  110. package/dist/local/store/node/adapter.js.map +1 -1
  111. package/dist/local/store/node/database.d.ts +68 -0
  112. package/dist/local/store/node/database.d.ts.map +1 -1
  113. package/dist/local/store/node/database.js +201 -18
  114. package/dist/local/store/node/database.js.map +1 -1
  115. package/dist/local/store/react-native/adapter.d.ts +39 -0
  116. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  117. package/dist/local/store/react-native/adapter.js +163 -8
  118. package/dist/local/store/react-native/adapter.js.map +1 -1
  119. package/dist/local/store/web/adapter.d.ts +1 -0
  120. package/dist/local/store/web/adapter.d.ts.map +1 -1
  121. package/dist/local/store/web/adapter.js +33 -1
  122. package/dist/local/store/web/adapter.js.map +1 -1
  123. package/dist/remote/relay/convex/backend.d.ts +405 -0
  124. package/dist/remote/relay/convex/backend.d.ts.map +1 -0
  125. package/dist/remote/relay/convex/backend.js +687 -0
  126. package/dist/remote/relay/convex/backend.js.map +1 -0
  127. package/dist/remote/relay/convex/component/_generated/api.d.ts +58 -0
  128. package/dist/remote/relay/convex/component/_generated/api.d.ts.map +1 -0
  129. package/dist/remote/relay/convex/component/_generated/api.js +31 -0
  130. package/dist/remote/relay/convex/component/_generated/api.js.map +1 -0
  131. package/dist/remote/relay/convex/component/_generated/component.d.ts +483 -0
  132. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -0
  133. package/dist/remote/relay/convex/component/_generated/component.js +11 -0
  134. package/dist/remote/relay/convex/component/_generated/component.js.map +1 -0
  135. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +46 -0
  136. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +1 -0
  137. package/dist/remote/relay/convex/component/_generated/dataModel.js +11 -0
  138. package/dist/remote/relay/convex/component/_generated/dataModel.js.map +1 -0
  139. package/dist/remote/relay/convex/component/_generated/server.d.ts +129 -0
  140. package/dist/remote/relay/convex/component/_generated/server.d.ts.map +1 -0
  141. package/dist/remote/relay/convex/component/_generated/server.js +79 -0
  142. package/dist/remote/relay/convex/component/_generated/server.js.map +1 -0
  143. package/dist/remote/relay/convex/component/accounts.d.ts +43 -0
  144. package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -0
  145. package/dist/remote/relay/convex/component/accounts.js +181 -0
  146. package/dist/remote/relay/convex/component/accounts.js.map +1 -0
  147. package/dist/remote/relay/convex/component/certificates.d.ts +10 -0
  148. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -0
  149. package/dist/remote/relay/convex/component/certificates.js +122 -0
  150. package/dist/remote/relay/convex/component/certificates.js.map +1 -0
  151. package/dist/remote/relay/convex/component/cleanup.d.ts +32 -0
  152. package/dist/remote/relay/convex/component/cleanup.d.ts.map +1 -0
  153. package/dist/remote/relay/convex/component/cleanup.js +146 -0
  154. package/dist/remote/relay/convex/component/cleanup.js.map +1 -0
  155. package/dist/remote/relay/convex/component/convex.config.d.ts +5 -0
  156. package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -0
  157. package/dist/remote/relay/convex/component/convex.config.js +33 -0
  158. package/dist/remote/relay/convex/component/convex.config.js.map +1 -0
  159. package/dist/remote/relay/convex/component/crons.d.ts +3 -0
  160. package/dist/remote/relay/convex/component/crons.d.ts.map +1 -0
  161. package/dist/remote/relay/convex/component/crons.js +10 -0
  162. package/dist/remote/relay/convex/component/crons.js.map +1 -0
  163. package/dist/remote/relay/convex/component/devices.d.ts +101 -0
  164. package/dist/remote/relay/convex/component/devices.d.ts.map +1 -0
  165. package/dist/remote/relay/convex/component/devices.js +299 -0
  166. package/dist/remote/relay/convex/component/devices.js.map +1 -0
  167. package/dist/remote/relay/convex/component/errors.d.ts +22 -0
  168. package/dist/remote/relay/convex/component/errors.d.ts.map +1 -0
  169. package/dist/remote/relay/convex/component/errors.js +17 -0
  170. package/dist/remote/relay/convex/component/errors.js.map +1 -0
  171. package/dist/remote/relay/convex/component/groups.d.ts +63 -0
  172. package/dist/remote/relay/convex/component/groups.d.ts.map +1 -0
  173. package/dist/remote/relay/convex/component/groups.js +341 -0
  174. package/dist/remote/relay/convex/component/groups.js.map +1 -0
  175. package/dist/remote/relay/convex/component/keys.d.ts +130 -0
  176. package/dist/remote/relay/convex/component/keys.d.ts.map +1 -0
  177. package/dist/remote/relay/convex/component/keys.js +578 -0
  178. package/dist/remote/relay/convex/component/keys.js.map +1 -0
  179. package/dist/remote/relay/convex/component/messages.d.ts +119 -0
  180. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -0
  181. package/dist/remote/relay/convex/component/messages.js +723 -0
  182. package/dist/remote/relay/convex/component/messages.js.map +1 -0
  183. package/dist/remote/relay/convex/component/provisioning.d.ts +92 -0
  184. package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -0
  185. package/dist/remote/relay/convex/component/provisioning.js +359 -0
  186. package/dist/remote/relay/convex/component/provisioning.js.map +1 -0
  187. package/dist/remote/relay/convex/component/runtime.d.ts +18 -0
  188. package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -0
  189. package/dist/remote/relay/convex/component/runtime.js +142 -0
  190. package/dist/remote/relay/convex/component/runtime.js.map +1 -0
  191. package/dist/remote/relay/convex/component/schema.d.ts +358 -0
  192. package/dist/remote/relay/convex/component/schema.d.ts.map +1 -0
  193. package/dist/remote/relay/convex/component/schema.js +287 -0
  194. package/dist/remote/relay/convex/component/schema.js.map +1 -0
  195. package/dist/remote/relay/convex/component/zkAuth.d.ts +12 -0
  196. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -0
  197. package/dist/remote/relay/convex/component/zkAuth.js +71 -0
  198. package/dist/remote/relay/convex/component/zkAuth.js.map +1 -0
  199. package/dist/remote/relay/convex/constants.d.ts +3 -0
  200. package/dist/remote/relay/convex/constants.d.ts.map +1 -0
  201. package/dist/remote/relay/convex/constants.js +3 -0
  202. package/dist/remote/relay/convex/constants.js.map +1 -0
  203. package/dist/remote/relay/convex/group-server.d.ts +9 -6
  204. package/dist/remote/relay/convex/group-server.d.ts.map +1 -1
  205. package/dist/remote/relay/convex/group-server.js +17 -11
  206. package/dist/remote/relay/convex/group-server.js.map +1 -1
  207. package/dist/remote/relay/convex/index.d.ts +4 -1
  208. package/dist/remote/relay/convex/index.d.ts.map +1 -1
  209. package/dist/remote/relay/convex/index.js +3 -1
  210. package/dist/remote/relay/convex/index.js.map +1 -1
  211. package/dist/remote/relay/convex/relay.d.ts +44 -65
  212. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  213. package/dist/remote/relay/convex/relay.js +61 -36
  214. package/dist/remote/relay/convex/relay.js.map +1 -1
  215. package/dist/remote/relay/convex/types.d.ts +16 -103
  216. package/dist/remote/relay/convex/types.d.ts.map +1 -1
  217. package/dist/remote/relay/convex/types.js +8 -13
  218. package/dist/remote/relay/convex/types.js.map +1 -1
  219. package/dist/remote/relay/index.d.ts +1 -1
  220. package/dist/remote/relay/index.d.ts.map +1 -1
  221. package/dist/remote/relay/index.js.map +1 -1
  222. package/dist/remote/relay/mock/adapter.d.ts +4 -9
  223. package/dist/remote/relay/mock/adapter.d.ts.map +1 -1
  224. package/dist/remote/relay/mock/adapter.js +39 -22
  225. package/dist/remote/relay/mock/adapter.js.map +1 -1
  226. package/dist/remote/relay/types.d.ts +57 -75
  227. package/dist/remote/relay/types.d.ts.map +1 -1
  228. package/dist/remote/relay/types.js +0 -1
  229. package/dist/remote/relay/types.js.map +1 -1
  230. package/dist/types/api.d.ts +21 -0
  231. package/dist/types/api.d.ts.map +1 -1
  232. package/dist/types/protocol-config.d.ts +51 -0
  233. package/dist/types/protocol-config.d.ts.map +1 -1
  234. package/dist/types/protocol-config.js +46 -0
  235. package/dist/types/protocol-config.js.map +1 -1
  236. package/docs/ASSURANCE.md +10 -6
  237. package/docs/CLIENT_COMPOSITION.md +23 -69
  238. package/docs/DEVIATIONS.md +44 -11
  239. package/docs/E2EE.md +71 -6
  240. package/docs/GETTING_STARTED.md +1 -1
  241. package/docs/PACKAGE_SURFACE.md +6 -5
  242. package/docs/RECIPES.md +1 -1
  243. package/docs/SECURITY.md +8 -0
  244. package/local/store/README.md +3 -1
  245. package/local/store/expo/README.md +10 -1
  246. package/local/store/node/README.md +8 -1
  247. package/package.json +12 -7
  248. package/remote/relay/convex/README.md +1 -1
  249. package/remote/relay/convex/component/README.md +428 -0
  250. package/scripts/oe-groups.mjs +21 -1
  251. package/dist/remote/relay/convex/server/index.d.ts +0 -2
  252. package/dist/remote/relay/convex/server/index.d.ts.map +0 -1
  253. package/dist/remote/relay/convex/server/index.js +0 -2
  254. package/dist/remote/relay/convex/server/index.js.map +0 -1
  255. package/dist/remote/relay/convex/server.d.ts +0 -150
  256. package/dist/remote/relay/convex/server.d.ts.map +0 -1
  257. package/dist/remote/relay/convex/server.js +0 -506
  258. package/dist/remote/relay/convex/server.js.map +0 -1
  259. package/docs/api/README.md +0 -471
  260. package/docs/api/classes/EncryptionError.md +0 -112
  261. package/docs/api/classes/EndorsementManager.md +0 -325
  262. package/docs/api/classes/SealedSenderAuthError.md +0 -127
  263. package/docs/api/classes/ServerDerivedKeyPair.md +0 -68
  264. package/docs/api/classes/ServerDerivedPublicKey.md +0 -33
  265. package/docs/api/classes/ServerRootKeyPair.md +0 -94
  266. package/docs/api/classes/ServerRootPublicKey.md +0 -72
  267. package/docs/api/classes/SignalProtocolBlockingManager.md +0 -106
  268. package/docs/api/classes/SignalProtocolClient.md +0 -2654
  269. package/docs/api/classes/VerificationFailure.md +0 -25
  270. package/docs/api/enumerations/ContentHint.md +0 -63
  271. package/docs/api/enumerations/EncryptionErrorCode.md +0 -488
  272. package/docs/api/enumerations/IdentityKeyChange.md +0 -65
  273. package/docs/api/enumerations/MessageType.md +0 -29
  274. package/docs/api/enumerations/TrustDirection.md +0 -33
  275. package/docs/api/enumerations/TypingAction.md +0 -31
  276. package/docs/api/functions/createDefaultSignalProtocolContentAdapter.md +0 -13
  277. package/docs/api/functions/createDefaultSignalProtocolLogger.md +0 -36
  278. package/docs/api/functions/createGroupId.md +0 -32
  279. package/docs/api/functions/createSignalProtocolClient.md +0 -36
  280. package/docs/api/functions/createSignalProtocolClientConfig.md +0 -24
  281. package/docs/api/functions/decodeGroupTrustRoot.md +0 -21
  282. package/docs/api/functions/encodeGroupTrustRoot.md +0 -28
  283. package/docs/api/functions/extractGroupId.md +0 -32
  284. package/docs/api/functions/formatVersion.md +0 -25
  285. package/docs/api/functions/isCompatible.md +0 -31
  286. package/docs/api/functions/isGroupId.md +0 -37
  287. package/docs/api/functions/isSealedSenderAuthError.md +0 -25
  288. package/docs/api/functions/parseVersion.md +0 -29
  289. package/docs/api/functions/resolveSPQRLimits.md +0 -21
  290. package/docs/api/functions/resolveSignalProtocolLogger.md +0 -42
  291. package/docs/api/interfaces/AccountIdentityProvisioning.md +0 -43
  292. package/docs/api/interfaces/AccountIdentityRotation.md +0 -69
  293. package/docs/api/interfaces/AttachmentTransferOptions.md +0 -49
  294. package/docs/api/interfaces/BlockedRecipientEntry.md +0 -25
  295. package/docs/api/interfaces/BlockedRecipientsSyncInput.md +0 -27
  296. package/docs/api/interfaces/ConfigurationSyncInput.md +0 -19
  297. package/docs/api/interfaces/CredentialPublicKey.md +0 -25
  298. package/docs/api/interfaces/DataMessageInput.md +0 -21
  299. package/docs/api/interfaces/DecryptedEnvelope.md +0 -95
  300. package/docs/api/interfaces/DecryptedGroup.md +0 -86
  301. package/docs/api/interfaces/DeviceInfo.md +0 -79
  302. package/docs/api/interfaces/DeviceRecord.md +0 -87
  303. package/docs/api/interfaces/DeviceRegistration.md +0 -27
  304. package/docs/api/interfaces/DoubleRatchetConfig.md +0 -36
  305. package/docs/api/interfaces/EcOneTimePreKey.md +0 -27
  306. package/docs/api/interfaces/EcSignedPreKey.md +0 -39
  307. package/docs/api/interfaces/EcSignedPreKeyUpload.md +0 -50
  308. package/docs/api/interfaces/EncryptionErrorContext.md +0 -51
  309. package/docs/api/interfaces/Envelope.md +0 -154
  310. package/docs/api/interfaces/ForceKeyResetResult.md +0 -37
  311. package/docs/api/interfaces/GroupAuthorization.md +0 -23
  312. package/docs/api/interfaces/GroupChangeEntry.md +0 -42
  313. package/docs/api/interfaces/GroupMemberDevice.md +0 -26
  314. package/docs/api/interfaces/GroupTrustRoot.md +0 -33
  315. package/docs/api/interfaces/IEcOneTimePreKeyStore.md +0 -86
  316. package/docs/api/interfaces/IEcSignedPreKeyStore.md +0 -133
  317. package/docs/api/interfaces/IGroupServer.md +0 -120
  318. package/docs/api/interfaces/IGroupStateStore.md +0 -128
  319. package/docs/api/interfaces/IIdentityKeyStore.md +0 -312
  320. package/docs/api/interfaces/IKemPreKeyStore.md +0 -144
  321. package/docs/api/interfaces/IKyberLastResortPreKeyStore.md +0 -112
  322. package/docs/api/interfaces/ILogger.md +0 -117
  323. package/docs/api/interfaces/IProtocolStore.md +0 -1033
  324. package/docs/api/interfaces/IRelayGroupServer.md +0 -60
  325. package/docs/api/interfaces/ISenderKeyStore.md +0 -417
  326. package/docs/api/interfaces/ISesameStore.md +0 -249
  327. package/docs/api/interfaces/ISessionStore.md +0 -178
  328. package/docs/api/interfaces/ISignalProtocolClient.md +0 -1185
  329. package/docs/api/interfaces/ISignalProtocolLocalSecretVault.md +0 -71
  330. package/docs/api/interfaces/ISignalProtocolLocalStore.md +0 -2053
  331. package/docs/api/interfaces/ISignalProtocolManager.md +0 -272
  332. package/docs/api/interfaces/ISignalProtocolRelayServer.md +0 -1337
  333. package/docs/api/interfaces/IdentityKeyPair.md +0 -49
  334. package/docs/api/interfaces/IncomingEnvelope.md +0 -91
  335. package/docs/api/interfaces/InspectedSignalProtocolContent.md +0 -43
  336. package/docs/api/interfaces/KDFChain.md +0 -31
  337. package/docs/api/interfaces/KemLastResortPreKeyUpload.md +0 -50
  338. package/docs/api/interfaces/KeyPair.md +0 -23
  339. package/docs/api/interfaces/KyberPreKey.md +0 -42
  340. package/docs/api/interfaces/MLKEMBraidAgentState.md +0 -191
  341. package/docs/api/interfaces/MLKEMBraidMessage.md +0 -49
  342. package/docs/api/interfaces/MediaAttachmentDeleteSyncInput.md +0 -31
  343. package/docs/api/interfaces/MessageHeader.md +0 -49
  344. package/docs/api/interfaces/MessageRecord.md +0 -86
  345. package/docs/api/interfaces/ParsedReceiptContent.md +0 -19
  346. package/docs/api/interfaces/ParsedTypingContent.md +0 -19
  347. package/docs/api/interfaces/PreKeyMaintenanceStore.md +0 -88
  348. package/docs/api/interfaces/PreKeyMessage.md +0 -159
  349. package/docs/api/interfaces/PreKeyStatusResult.md +0 -21
  350. package/docs/api/interfaces/PreKeyUpload.md +0 -42
  351. package/docs/api/interfaces/ProcessEnvelopeOptions.md +0 -72
  352. package/docs/api/interfaces/ProtocolAddress.md +0 -38
  353. package/docs/api/interfaces/ProtocolStrategyConfig.md +0 -91
  354. package/docs/api/interfaces/RatchetMessage.md +0 -96
  355. package/docs/api/interfaces/ReadSyncEntryInput.md +0 -19
  356. package/docs/api/interfaces/ReceiverChain.md +0 -43
  357. package/docs/api/interfaces/RecipientUsernameSyncInput.md +0 -31
  358. package/docs/api/interfaces/RelayPreKeyBundle.md +0 -254
  359. package/docs/api/interfaces/RemoteObjectDownload.md +0 -33
  360. package/docs/api/interfaces/RemoteObjectUpload.md +0 -49
  361. package/docs/api/interfaces/ResolvedSPQRInfoStrings.md +0 -27
  362. package/docs/api/interfaces/ResolvedSPQRLimits.md +0 -37
  363. package/docs/api/interfaces/RetryRequest.md +0 -80
  364. package/docs/api/interfaces/SCKAState.md +0 -65
  365. package/docs/api/interfaces/SPQRLimits.md +0 -40
  366. package/docs/api/interfaces/SPQRState.md +0 -191
  367. package/docs/api/interfaces/SafetyNumber.md +0 -60
  368. package/docs/api/interfaces/SafetyNumberConfirmation.md +0 -46
  369. package/docs/api/interfaces/SealedSenderConfig.md +0 -70
  370. package/docs/api/interfaces/SendOptions.md +0 -191
  371. package/docs/api/interfaces/SendResult.md +0 -93
  372. package/docs/api/interfaces/SenderKeyDistributionMessage.md +0 -43
  373. package/docs/api/interfaces/SenderKeyState.md +0 -76
  374. package/docs/api/interfaces/SenderKeysConfig.md +0 -65
  375. package/docs/api/interfaces/SentSyncTranscriptInput.md +0 -31
  376. package/docs/api/interfaces/ServiceId.md +0 -19
  377. package/docs/api/interfaces/SesameMessage.md +0 -84
  378. package/docs/api/interfaces/SesameStats.md +0 -57
  379. package/docs/api/interfaces/SessionHealthResult.md +0 -120
  380. package/docs/api/interfaces/SessionRecord.md +0 -80
  381. package/docs/api/interfaces/SessionRecordMetadata.md +0 -109
  382. package/docs/api/interfaces/SessionState.md +0 -368
  383. package/docs/api/interfaces/SessionTrustCommit.md +0 -58
  384. package/docs/api/interfaces/SignalProtocolBlockingHooks.md +0 -44
  385. package/docs/api/interfaces/SignalProtocolBlockingManagerOptions.md +0 -31
  386. package/docs/api/interfaces/SignalProtocolBlockingMirror.md +0 -30
  387. package/docs/api/interfaces/SignalProtocolBlockingStore.md +0 -83
  388. package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +0 -44
  389. package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +0 -731
  390. package/docs/api/interfaces/SignalProtocolClientConfig.md +0 -895
  391. package/docs/api/interfaces/SignalProtocolClientDeleteLocalAttachmentInput.md +0 -25
  392. package/docs/api/interfaces/SignalProtocolClientHooks.md +0 -506
  393. package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +0 -51
  394. package/docs/api/interfaces/SignalProtocolClientLoadLocalAttachmentInput.md +0 -187
  395. package/docs/api/interfaces/SignalProtocolClientLoadedLocalAttachment.md +0 -19
  396. package/docs/api/interfaces/SignalProtocolClientMedia.md +0 -83
  397. package/docs/api/interfaces/SignalProtocolClientMediaCompletedResult.md +0 -25
  398. package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +0 -157
  399. package/docs/api/interfaces/SignalProtocolClientMediaDownloadCompletedResult.md +0 -37
  400. package/docs/api/interfaces/SignalProtocolClientMediaDownloadNotNeededResult.md +0 -25
  401. package/docs/api/interfaces/SignalProtocolClientMediaFailedResult.md +0 -19
  402. package/docs/api/interfaces/SignalProtocolClientMediaOperationOptions.md +0 -53
  403. package/docs/api/interfaces/SignalProtocolClientMediaPendingResult.md +0 -19
  404. package/docs/api/interfaces/SignalProtocolClientMediaProcessResult.md +0 -43
  405. package/docs/api/interfaces/SignalProtocolClientMediaSkippedResult.md +0 -25
  406. package/docs/api/interfaces/SignalProtocolClientMediaUploadCompletedResult.md +0 -31
  407. package/docs/api/interfaces/SignalProtocolClientProcessPendingMediaOptions.md +0 -87
  408. package/docs/api/interfaces/SignalProtocolClientSaveDownloadedAttachmentInput.md +0 -25
  409. package/docs/api/interfaces/SignalProtocolClientSaveUploadedAttachmentInput.md +0 -25
  410. package/docs/api/interfaces/SignalProtocolClientSyncDeleteInput.md +0 -19
  411. package/docs/api/interfaces/SignalProtocolConfig.md +0 -50
  412. package/docs/api/interfaces/SignalProtocolContentAdapter.md +0 -325
  413. package/docs/api/interfaces/SignalProtocolRemoteObjectStore.md +0 -88
  414. package/docs/api/interfaces/SkippedSenderMessageKey.md +0 -26
  415. package/docs/api/interfaces/TaskNotificationAckSyncInput.md +0 -31
  416. package/docs/api/interfaces/TripleRatchetState.md +0 -64
  417. package/docs/api/interfaces/UserRecord.md +0 -71
  418. package/docs/api/interfaces/UsernameStateSyncInput.md +0 -19
  419. package/docs/api/interfaces/VerificationStateSyncInput.md +0 -31
  420. package/docs/api/interfaces/VersionNegotiationState.md +0 -84
  421. package/docs/api/interfaces/ViewOnceOpenSyncInput.md +0 -19
  422. package/docs/api/namespaces/ProtocolAddress/README.md +0 -33
  423. package/docs/api/namespaces/ProtocolAddress/functions/create.md +0 -41
  424. package/docs/api/namespaces/ProtocolAddress/functions/equals.md +0 -39
  425. package/docs/api/namespaces/ProtocolAddress/functions/fromStorageKey.md +0 -36
  426. package/docs/api/namespaces/ProtocolAddress/functions/isUser.md +0 -39
  427. package/docs/api/namespaces/ProtocolAddress/functions/isValid.md +0 -34
  428. package/docs/api/namespaces/ProtocolAddress/functions/parse.md +0 -41
  429. package/docs/api/namespaces/ProtocolAddress/functions/toStorageKey.md +0 -38
  430. package/docs/api/namespaces/ProtocolAddress/functions/toString.md +0 -34
  431. package/docs/api/namespaces/SessionRecord/README.md +0 -30
  432. package/docs/api/namespaces/SessionRecord/functions/archiveCurrent.md +0 -40
  433. package/docs/api/namespaces/SessionRecord/functions/archiveCurrentState.md +0 -34
  434. package/docs/api/namespaces/SessionRecord/functions/create.md +0 -25
  435. package/docs/api/namespaces/SessionRecord/functions/deserialize.md +0 -29
  436. package/docs/api/namespaces/SessionRecord/functions/findSession.md +0 -34
  437. package/docs/api/namespaces/SessionRecord/functions/getAllSessions.md +0 -25
  438. package/docs/api/namespaces/SessionRecord/functions/getArchivedCount.md +0 -25
  439. package/docs/api/namespaces/SessionRecord/functions/hasCurrentSession.md +0 -25
  440. package/docs/api/namespaces/SessionRecord/functions/hasUsableSenderChain.md +0 -36
  441. package/docs/api/namespaces/SessionRecord/functions/promoteSession.md +0 -34
  442. package/docs/api/namespaces/SessionRecord/functions/serialize.md +0 -28
  443. package/docs/api/namespaces/SessionRecord/variables/MAX_ARCHIVED_SESSIONS.md +0 -14
  444. package/docs/api/namespaces/SessionState/README.md +0 -15
  445. package/docs/api/namespaces/SessionState/functions/getSessionId.md +0 -32
  446. package/docs/api/namespaces/blocking/README.md +0 -43
  447. package/docs/api/namespaces/encoding/README.md +0 -33
  448. package/docs/api/namespaces/encoding/functions/base64ToUrlSafe.md +0 -28
  449. package/docs/api/namespaces/encoding/functions/bytesToBase64.md +0 -21
  450. package/docs/api/namespaces/encoding/functions/bytesToString.md +0 -21
  451. package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +0 -33
  452. package/docs/api/namespaces/encoding/functions/concatBytes.md +0 -21
  453. package/docs/api/namespaces/encoding/functions/stringToBytes.md +0 -21
  454. package/docs/api/namespaces/encoding/functions/urlSafeToBase64.md +0 -27
  455. package/docs/api/namespaces/keys/README.md +0 -130
  456. package/docs/api/namespaces/keys/functions/acceptContactIdentityRotation.md +0 -33
  457. package/docs/api/namespaces/keys/functions/assertIdentityCommitment.md +0 -25
  458. package/docs/api/namespaces/keys/functions/canonicalizeDeviceIdentityKey.md +0 -30
  459. package/docs/api/namespaces/keys/functions/compareDeviceIdentityKeys.md +0 -28
  460. package/docs/api/namespaces/keys/functions/compositeIdentitiesEqual.md +0 -23
  461. package/docs/api/namespaces/keys/functions/createCompositeIdentityV1.md +0 -19
  462. package/docs/api/namespaces/keys/functions/createPreKeySignatureContext.md +0 -31
  463. package/docs/api/namespaces/keys/functions/createUnverifiedContactIdentityRecord.md +0 -23
  464. package/docs/api/namespaces/keys/functions/decodeCompositeIdentityV1.md +0 -19
  465. package/docs/api/namespaces/keys/functions/deriveIdentityCommitment.md +0 -19
  466. package/docs/api/namespaces/keys/functions/encodeCompositeIdentityV1.md +0 -19
  467. package/docs/api/namespaces/keys/functions/evaluateContactIdentityCandidate.md +0 -27
  468. package/docs/api/namespaces/keys/functions/generateEcOneTimePreKeys.md +0 -37
  469. package/docs/api/namespaces/keys/functions/generateEcSignedPreKey.md +0 -39
  470. package/docs/api/namespaces/keys/functions/generateEcSignedPreKeyId.md +0 -21
  471. package/docs/api/namespaces/keys/functions/generateIdentityKeyPair.md +0 -24
  472. package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +0 -47
  473. package/docs/api/namespaces/keys/functions/generateKyberLastResortPreKey.md +0 -37
  474. package/docs/api/namespaces/keys/functions/generateRegistrationId.md +0 -13
  475. package/docs/api/namespaces/keys/functions/isValidDeviceIdentityKey.md +0 -22
  476. package/docs/api/namespaces/keys/functions/signMlKem1024PreKey.md +0 -29
  477. package/docs/api/namespaces/keys/functions/signPreKey.md +0 -31
  478. package/docs/api/namespaces/keys/functions/validateContactIdentityRecord.md +0 -19
  479. package/docs/api/namespaces/keys/functions/verifyContactIdentityRecord.md +0 -31
  480. package/docs/api/namespaces/keys/functions/verifyMlKem1024PreKey.md +0 -33
  481. package/docs/api/namespaces/keys/functions/verifyPreKeySignature.md +0 -35
  482. package/docs/api/namespaces/keys/interfaces/CompositeIdentityV1.md +0 -33
  483. package/docs/api/namespaces/keys/interfaces/ContactIdentityRecord.md +0 -53
  484. package/docs/api/namespaces/keys/interfaces/KemOneTimePreKey.md +0 -43
  485. package/docs/api/namespaces/keys/type-aliases/IdentityCandidateStatus.md +0 -9
  486. package/docs/api/namespaces/keys/type-aliases/IdentityTrustState.md +0 -9
  487. package/docs/api/namespaces/keys/type-aliases/IdentityType.md +0 -9
  488. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_ED25519_TAG.md +0 -9
  489. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_LENGTH.md +0 -9
  490. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_VERSION.md +0 -9
  491. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_X25519_TAG.md +0 -9
  492. package/docs/api/namespaces/keys/variables/IDENTITY_COMMITMENT_V1_DOMAIN.md +0 -9
  493. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_ML_KEM_1024.md +0 -9
  494. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_X25519.md +0 -9
  495. package/docs/api/namespaces/keys/variables/PREKEY_SIGNATURE_V1_DOMAIN.md +0 -9
  496. package/docs/api/namespaces/keys/variables/UNPINNED_DEVICE_IDENTITY_KEY.md +0 -18
  497. package/docs/api/namespaces/media/README.md +0 -105
  498. package/docs/api/namespaces/media/classes/MediaAttachmentError.md +0 -57
  499. package/docs/api/namespaces/media/functions/createByteRangeMediaAttachmentTransfer.md +0 -19
  500. package/docs/api/namespaces/media/functions/createMediaAttachmentDeliveryId.md +0 -29
  501. package/docs/api/namespaces/media/functions/createMediaAttachmentId.md +0 -19
  502. package/docs/api/namespaces/media/functions/createMediaAttachmentMessage.md +0 -25
  503. package/docs/api/namespaces/media/functions/createMediaAttachmentPointer.md +0 -19
  504. package/docs/api/namespaces/media/functions/createTusMediaAttachmentTransfer.md +0 -19
  505. package/docs/api/namespaces/media/functions/deleteMediaAttachment.md +0 -23
  506. package/docs/api/namespaces/media/functions/executeMediaAttachmentJob.md +0 -23
  507. package/docs/api/namespaces/media/functions/isMediaAttachmentFlagSet.md +0 -19
  508. package/docs/api/namespaces/media/functions/parseMediaAttachmentMessage.md +0 -19
  509. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanup.md +0 -23
  510. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanupJobs.md +0 -19
  511. package/docs/api/namespaces/media/functions/planMediaAttachmentDeleteSync.md +0 -19
  512. package/docs/api/namespaces/media/functions/planMediaAttachmentDownloadJob.md +0 -19
  513. package/docs/api/namespaces/media/functions/planMediaAttachmentOpen.md +0 -19
  514. package/docs/api/namespaces/media/functions/planMediaAttachmentProcessing.md +0 -19
  515. package/docs/api/namespaces/media/functions/planMediaAttachmentUploadJob.md +0 -19
  516. package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +0 -30
  517. package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +0 -30
  518. package/docs/api/namespaces/media/functions/serializeMediaAttachmentMessage.md +0 -25
  519. package/docs/api/namespaces/media/functions/validateMediaAttachmentPolicy.md +0 -23
  520. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentPartialStore.md +0 -68
  521. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentTransferOptions.md +0 -91
  522. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +0 -25
  523. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentResult.md +0 -19
  524. package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +0 -157
  525. package/docs/api/namespaces/media/interfaces/MediaAttachmentBackgroundJob.md +0 -85
  526. package/docs/api/namespaces/media/interfaces/MediaAttachmentCleanupPlan.md +0 -37
  527. package/docs/api/namespaces/media/interfaces/MediaAttachmentJobExecutionResult.md +0 -55
  528. package/docs/api/namespaces/media/interfaces/MediaAttachmentMessage.md +0 -31
  529. package/docs/api/namespaces/media/interfaces/MediaAttachmentOpenDecision.md +0 -31
  530. package/docs/api/namespaces/media/interfaces/MediaAttachmentPointer.md +0 -133
  531. package/docs/api/namespaces/media/interfaces/MediaAttachmentPolicy.md +0 -67
  532. package/docs/api/namespaces/media/interfaces/MediaAttachmentProcessingPlan.md +0 -73
  533. package/docs/api/namespaces/media/interfaces/MediaAttachmentProgress.md +0 -69
  534. package/docs/api/namespaces/media/interfaces/MediaAttachmentResumeState.md +0 -37
  535. package/docs/api/namespaces/media/interfaces/MediaAttachmentRetryOptions.md +0 -31
  536. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransfer.md +0 -51
  537. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferCheckpoint.md +0 -69
  538. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferOptions.md +0 -67
  539. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadJobData.md +0 -19
  540. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadResponse.md +0 -25
  541. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentCleanupJobsInput.md +0 -61
  542. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDeleteSyncInput.md +0 -25
  543. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDownloadJobInput.md +0 -161
  544. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentOpenInput.md +0 -25
  545. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentProcessingInput.md +0 -83
  546. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentUploadJobInput.md +0 -147
  547. package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +0 -144
  548. package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +0 -55
  549. package/docs/api/namespaces/media/interfaces/ResolvedMediaAttachment.md +0 -109
  550. package/docs/api/namespaces/media/interfaces/TusMediaAttachmentTransferOptions.md +0 -85
  551. package/docs/api/namespaces/media/type-aliases/CreateMediaAttachmentPointerInput.md +0 -15
  552. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCheckpointCallback.md +0 -19
  553. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCleanupReason.md +0 -9
  554. package/docs/api/namespaces/media/type-aliases/MediaAttachmentErrorCode.md +0 -9
  555. package/docs/api/namespaces/media/type-aliases/MediaAttachmentFlag.md +0 -9
  556. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobExecutionStatus.md +0 -9
  557. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobOperation.md +0 -9
  558. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobPriority.md +0 -9
  559. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSkipReason.md +0 -9
  560. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSource.md +0 -9
  561. package/docs/api/namespaces/media/type-aliases/MediaAttachmentKnownIds.md +0 -9
  562. package/docs/api/namespaces/media/type-aliases/MediaAttachmentMessageType.md +0 -9
  563. package/docs/api/namespaces/media/type-aliases/MediaAttachmentProgressCallback.md +0 -19
  564. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_DEFAULTS.md +0 -47
  565. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_PRESETS.md +0 -95
  566. package/docs/api/namespaces/media/variables/MediaAttachmentCleanupReason.md +0 -27
  567. package/docs/api/namespaces/media/variables/MediaAttachmentErrorCode.md +0 -75
  568. package/docs/api/namespaces/media/variables/MediaAttachmentFlag.md +0 -23
  569. package/docs/api/namespaces/media/variables/MediaAttachmentJobExecutionStatus.md +0 -19
  570. package/docs/api/namespaces/media/variables/MediaAttachmentJobOperation.md +0 -31
  571. package/docs/api/namespaces/media/variables/MediaAttachmentJobPriority.md +0 -23
  572. package/docs/api/namespaces/media/variables/MediaAttachmentJobSource.md +0 -51
  573. package/docs/api/namespaces/media/variables/MediaAttachmentMessageType.md +0 -15
  574. package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +0 -30
  575. package/docs/api/namespaces/safety/README.md +0 -61
  576. package/docs/api/namespaces/safety/classes/DisplayableFingerprint.md +0 -108
  577. package/docs/api/namespaces/safety/classes/Fingerprint.md +0 -104
  578. package/docs/api/namespaces/safety/classes/ScannableFingerprint.md +0 -209
  579. package/docs/api/namespaces/safety/functions/base64ToBytes.md +0 -21
  580. package/docs/api/namespaces/safety/functions/clearFingerprintCache.md +0 -15
  581. package/docs/api/namespaces/safety/functions/compareSafetyNumbers.md +0 -25
  582. package/docs/api/namespaces/safety/functions/createFingerprintData.md +0 -60
  583. package/docs/api/namespaces/safety/functions/extractQrData.md +0 -34
  584. package/docs/api/namespaces/safety/functions/generateCompositeSafetyNumber.md +0 -39
  585. package/docs/api/namespaces/safety/functions/generateEmojiFingerprint.md +0 -24
  586. package/docs/api/namespaces/safety/functions/generateSingleKeyReferenceSafetyNumber.md +0 -51
  587. package/docs/api/namespaces/safety/functions/generateVerifySchemeUrl.md +0 -32
  588. package/docs/api/namespaces/safety/functions/generateVerifyUrl.md +0 -49
  589. package/docs/api/namespaces/safety/functions/isValidSafetyNumber.md +0 -21
  590. package/docs/api/namespaces/safety/functions/isVerifyUrl.md +0 -45
  591. package/docs/api/namespaces/safety/functions/parseVerifyUrl.md +0 -31
  592. package/docs/api/namespaces/safety/interfaces/FingerprintData.md +0 -52
  593. package/docs/api/namespaces/safety/interfaces/SafetyNumber.md +0 -49
  594. package/docs/api/namespaces/safety/interfaces/VerifyLinkConfig.md +0 -28
  595. package/docs/api/namespaces/safety/interfaces/VerifyUrlParams.md +0 -49
  596. package/docs/api/namespaces/safety/type-aliases/CompareResult.md +0 -21
  597. package/docs/api/namespaces/safety/variables/DEFAULT_VERIFY_LINK_CONFIG.md +0 -12
  598. package/docs/api/namespaces/safety/variables/FINGERPRINT_ITERATIONS.md +0 -12
  599. package/docs/api/namespaces/safety/variables/FINGERPRINT_VERSION.md +0 -12
  600. package/docs/api/namespaces/safety/variables/VERIFY_BASE_URL.md +0 -11
  601. package/docs/api/namespaces/safety/variables/VERIFY_SCHEME_URL.md +0 -11
  602. package/docs/api/type-aliases/Base64.md +0 -20
  603. package/docs/api/type-aliases/BraidPolicy.md +0 -11
  604. package/docs/api/type-aliases/Bytes.md +0 -20
  605. package/docs/api/type-aliases/Ciphertext.md +0 -21
  606. package/docs/api/type-aliases/DeviceType.md +0 -11
  607. package/docs/api/type-aliases/DownloadedAttachment.md +0 -11
  608. package/docs/api/type-aliases/GroupId.md +0 -27
  609. package/docs/api/type-aliases/Hex.md +0 -20
  610. package/docs/api/type-aliases/HookName.md +0 -11
  611. package/docs/api/type-aliases/PostQuantumPolicy.md +0 -11
  612. package/docs/api/type-aliases/PreparedAttachmentUpload.md +0 -14
  613. package/docs/api/type-aliases/PrivateKey.md +0 -22
  614. package/docs/api/type-aliases/ProgressCallback.md +0 -45
  615. package/docs/api/type-aliases/PublicKey.md +0 -22
  616. package/docs/api/type-aliases/RemoteObjectCompleteUploadRequest.md +0 -19
  617. package/docs/api/type-aliases/RemoteObjectDeleteRequest.md +0 -19
  618. package/docs/api/type-aliases/RemoteObjectDownloadRequest.md +0 -19
  619. package/docs/api/type-aliases/RemoteObjectUploadRequest.md +0 -42
  620. package/docs/api/type-aliases/SCKAMode.md +0 -11
  621. package/docs/api/type-aliases/SealedSenderAuth.md +0 -15
  622. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupInput.md +0 -9
  623. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupResult.md +0 -9
  624. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadInput.md +0 -9
  625. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadResult.md +0 -9
  626. package/docs/api/type-aliases/SignalProtocolClientMediaOperationResult.md +0 -9
  627. package/docs/api/type-aliases/SignalProtocolClientMediaUploadInput.md +0 -9
  628. package/docs/api/type-aliases/SignalProtocolClientMediaUploadResult.md +0 -9
  629. package/docs/api/type-aliases/Signature.md +0 -21
  630. package/docs/api/type-aliases/Unsubscribe.md +0 -15
  631. package/docs/api/variables/BraidPolicy.md +0 -21
  632. package/docs/api/variables/DEFAULT_DEVICE_ID.md +0 -12
  633. package/docs/api/variables/DOUBLE_RATCHET_SPEC.md +0 -11
  634. package/docs/api/variables/GROUP_ID_PREFIX.md +0 -11
  635. package/docs/api/variables/GROUP_TRUST_ROOT_VERSION.md +0 -11
  636. package/docs/api/variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md +0 -11
  637. package/docs/api/variables/MAX_MESSAGE_KEYS.md +0 -14
  638. package/docs/api/variables/MAX_PREKEY_AGE_MS_DEFAULT.md +0 -11
  639. package/docs/api/variables/MAX_RECEIVER_CHAINS.md +0 -14
  640. package/docs/api/variables/MAX_REGISTRATION_ID.md +0 -16
  641. package/docs/api/variables/MAX_SKIP.md +0 -11
  642. package/docs/api/variables/MESSAGE_FORMAT.md +0 -11
  643. package/docs/api/variables/MIN_REGISTRATION_ID.md +0 -16
  644. package/docs/api/variables/ML_KEM_BRAID_SPEC.md +0 -11
  645. package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +0 -21
  646. package/docs/api/variables/PQXDH_SPEC.md +0 -11
  647. package/docs/api/variables/PostQuantumPolicy.md +0 -21
  648. package/docs/api/variables/SENDER_KEY_FORMAT.md +0 -11
  649. package/docs/api/variables/SENDER_KEY_SPEC.md +0 -11
  650. package/docs/api/variables/SESAME_SPEC.md +0 -11
  651. package/docs/api/variables/SESSION_FORMAT.md +0 -11
  652. package/docs/api/variables/SPQR_LIMITS_DEFAULTS.md +0 -11
  653. package/docs/api/variables/X3DH_SPEC.md +0 -9
  654. package/docs/api/variables/defaultSignalProtocolLogger.md +0 -32
  655. package/remote/relay/convex/server/README.md +0 -146
@@ -1,2654 +0,0 @@
1
- [**@open-e2ee/signal-protocol-sdk**](../README.md)
2
-
3
- ***
4
-
5
- [@open-e2ee/signal-protocol-sdk](../README.md) / SignalProtocolClient
6
-
7
- # Class: SignalProtocolClient
8
-
9
- Modern Signal Protocol Client
10
-
11
- Provides a clean, testable, and flexible API for Signal Protocol operations.
12
- Uses static factory pattern for type-safe async initialization:
13
- - Guaranteed initialization via create() method
14
- - Dependency injection support
15
- - Configuration object pattern
16
- - Clear error handling
17
- - Type-safe API
18
-
19
- This client implements the ISignalProtocolClient interface and wraps
20
- SignalProtocolManager with additional high-level functionality.
21
-
22
- ## Implements
23
-
24
- - [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md)
25
-
26
- ## Properties
27
-
28
- ### deviceId
29
-
30
- > `readonly` **deviceId**: `number`
31
-
32
- Device ID for this client instance (1 = primary, 2-5 = linked)
33
-
34
- #### Implementation of
35
-
36
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`deviceId`](../interfaces/ISignalProtocolClient.md#deviceid)
37
-
38
- ***
39
-
40
- ### logger
41
-
42
- > `readonly` **logger**: `Required`\<[`ILogger`](../interfaces/ILogger.md)\>
43
-
44
- Resolved logger for this client instance.
45
-
46
- This is the client-scoped logger used throughout the Signal Protocol runtime.
47
-
48
- #### Implementation of
49
-
50
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`logger`](../interfaces/ISignalProtocolClient.md#logger)
51
-
52
- ***
53
-
54
- ### media
55
-
56
- > `readonly` **media**: [`SignalProtocolClientMedia`](../interfaces/SignalProtocolClientMedia.md)
57
-
58
- Durable media job facade backed by the configured Signal Protocol local store.
59
-
60
- Use this for background-safe attachment uploads, downloads, and cleanup
61
- when the app provides media lifecycle callbacks in `config.media`.
62
-
63
- ## Accessors
64
-
65
- ### isSealedSenderEnabled
66
-
67
- #### Get Signature
68
-
69
- > **get** **isSealedSenderEnabled**(): `boolean`
70
-
71
- Whether sealed sender is enabled and configured.
72
-
73
- ##### Returns
74
-
75
- `boolean`
76
-
77
- ***
78
-
79
- ### syncStatus
80
-
81
- #### Get Signature
82
-
83
- > **get** **syncStatus**(): `"synced"` \| `"failed"` \| `"none"`
84
-
85
- ##### Returns
86
-
87
- `"synced"` \| `"failed"` \| `"none"`
88
-
89
- ***
90
-
91
- ### userId
92
-
93
- #### Get Signature
94
-
95
- > **get** **userId**(): `string`
96
-
97
- Get user ID for this client instance
98
-
99
- ##### See
100
-
101
- ISignalProtocolClient.userId
102
-
103
- ##### Returns
104
-
105
- `string`
106
-
107
- User ID for this client instance
108
-
109
- #### Implementation of
110
-
111
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`userId`](../interfaces/ISignalProtocolClient.md#userid)
112
-
113
- ## Methods
114
-
115
- ### acceptIdentityRotation()
116
-
117
- > **acceptIdentityRotation**(`userId`, `identity`, `identityType?`): `Promise`\<[`ContactIdentityRecord`](../namespaces/keys/interfaces/ContactIdentityRecord.md)\>
118
-
119
- Accept an authenticated composite-identity rotation and reset bound sessions.
120
-
121
- #### Parameters
122
-
123
- ##### userId
124
-
125
- `string`
126
-
127
- ##### identity
128
-
129
- [`CompositeIdentityV1`](../namespaces/keys/interfaces/CompositeIdentityV1.md)
130
-
131
- ##### identityType?
132
-
133
- [`IdentityType`](../namespaces/keys/type-aliases/IdentityType.md) = `'aci'`
134
-
135
- #### Returns
136
-
137
- `Promise`\<[`ContactIdentityRecord`](../namespaces/keys/interfaces/ContactIdentityRecord.md)\>
138
-
139
- ***
140
-
141
- ### addGroupMember()
142
-
143
- > **addGroupMember**(`groupId`, `editorAci`, `newMemberAci`, `newMemberProfileKey`): `Promise`\<`void`\>
144
-
145
- Add a member to a group.
146
-
147
- #### Parameters
148
-
149
- ##### groupId
150
-
151
- [`GroupId`](../type-aliases/GroupId.md)
152
-
153
- ##### editorAci
154
-
155
- `Uint8Array`
156
-
157
- ##### newMemberAci
158
-
159
- `Uint8Array`
160
-
161
- ##### newMemberProfileKey
162
-
163
- `Uint8Array`
164
-
165
- #### Returns
166
-
167
- `Promise`\<`void`\>
168
-
169
- ***
170
-
171
- ### address()
172
-
173
- > **address**(): [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
174
-
175
- Get the ProtocolAddress for this client's device.
176
-
177
- Useful when an integration needs to reference the local device.
178
-
179
- #### Returns
180
-
181
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
182
-
183
- ProtocolAddress for this client (userId:deviceId)
184
-
185
- #### Example
186
-
187
- ```typescript
188
- const alice = await SignalProtocolClient.create('alice', { storage: aliceStorage });
189
- const bob = await SignalProtocolClient.create('bob', { storage: bobStorage });
190
-
191
- // Use address() to reference the local device
192
- await alice.encryptMessage(bob.address(), 'Hello');
193
- await bob.decryptMessage(alice.address(), encrypted);
194
-
195
- // Access userId if needed
196
- console.log(alice.address().userId); // 'alice'
197
- ```
198
-
199
- ***
200
-
201
- ### archiveSession()
202
-
203
- > **archiveSession**(`remoteAddress`): `Promise`\<`void`\>
204
-
205
- Archive a session after a stale-device response.
206
-
207
- Moves current session to inactive list, preserving it for delayed message decryption.
208
- Per SESAME §3.2: "previously active session is moved to the head of the inactive sessions list"
209
-
210
- Use this when handling stale device errors (410) - the old session may still be needed
211
- to decrypt messages that were in-flight during the session refresh.
212
-
213
- #### Parameters
214
-
215
- ##### remoteAddress
216
-
217
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
218
-
219
- Remote device's protocol address
220
-
221
- #### Returns
222
-
223
- `Promise`\<`void`\>
224
-
225
- ***
226
-
227
- ### checkPreKeyStatus()
228
-
229
- > **checkPreKeyStatus**(): `Promise`\<[`PreKeyStatusResult`](../interfaces/PreKeyStatusResult.md)\>
230
-
231
- Check prekey status and trigger warning if running low
232
-
233
- Returns the current prekey count and whether replenishment is needed.
234
- If configured with `onPreKeyLow` callback, it will be called when
235
- the count drops below the threshold.
236
-
237
- #### Returns
238
-
239
- `Promise`\<[`PreKeyStatusResult`](../interfaces/PreKeyStatusResult.md)\>
240
-
241
- Prekey status with remaining count and replenishment flag
242
-
243
- #### Example
244
-
245
- ```typescript
246
- const status = await signal.checkPreKeyStatus();
247
- if (status.needsReplenishment) {
248
- // Generate and upload more prekeys
249
- await backend.replenishPrekeys(userId);
250
- }
251
- ```
252
-
253
- ***
254
-
255
- ### cleanupExpiredKeys()
256
-
257
- > **cleanupExpiredKeys**(`remoteAddress`): `Promise`\<`boolean`\>
258
-
259
- Clean up expired message keys for a session
260
-
261
- Signal Protocol Section 8.4 recommends deleting message keys older than
262
- one week to avoid excessive storage. This method explicitly triggers cleanup.
263
-
264
- Note: Cleanup also happens automatically during encrypt/decrypt operations.
265
-
266
- #### Parameters
267
-
268
- ##### remoteAddress
269
-
270
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
271
-
272
- Remote party's protocol address (userId:deviceId)
273
-
274
- #### Returns
275
-
276
- `Promise`\<`boolean`\>
277
-
278
- true if cleanup succeeded, false otherwise
279
-
280
- ***
281
-
282
- ### cleanupExpiredSesameSessions()
283
-
284
- > **cleanupExpiredSesameSessions**(): `Promise`\<`number`\>
285
-
286
- Cleanup expired Sesame sessions
287
-
288
- Removes inactive sessions that are older than the configured TTL.
289
- Should be called periodically (e.g., daily) to prevent database bloat.
290
-
291
- #### Returns
292
-
293
- `Promise`\<`number`\>
294
-
295
- Number of sessions cleaned up
296
-
297
- ***
298
-
299
- ### clearAllData()
300
-
301
- > **clearAllData**(): `Promise`\<`void`\>
302
-
303
- Clear all encryption data
304
-
305
- WARNING: This permanently deletes all keys and sessions.
306
- Use only for local development or when resetting the app.
307
-
308
- #### Returns
309
-
310
- `Promise`\<`void`\>
311
-
312
- ***
313
-
314
- ### confirmSafetyNumber()
315
-
316
- > **confirmSafetyNumber**(`confirmation`): `Promise`\<`void`\>
317
-
318
- Confirm an authenticated comparison of the currently displayed tuple.
319
-
320
- #### Parameters
321
-
322
- ##### confirmation
323
-
324
- [`SafetyNumberConfirmation`](../interfaces/SafetyNumberConfirmation.md)
325
-
326
- #### Returns
327
-
328
- `Promise`\<`void`\>
329
-
330
- ***
331
-
332
- ### createGroup()
333
-
334
- > **createGroup**(`creatorAci`, `creatorProfileKey`, `members`, `title`, `options?`): `Promise`\<\{ `groupId`: [`GroupId`](../type-aliases/GroupId.md); `masterKey`: `Uint8Array`; \}\>
335
-
336
- Create a new group.
337
-
338
- #### Parameters
339
-
340
- ##### creatorAci
341
-
342
- `Uint8Array`
343
-
344
- ##### creatorProfileKey
345
-
346
- `Uint8Array`
347
-
348
- ##### members
349
-
350
- `object`[]
351
-
352
- ##### title
353
-
354
- `string`
355
-
356
- ##### options?
357
-
358
- ###### accessControl?
359
-
360
- `Partial`\<`AccessControl`\>
361
-
362
- ###### avatarUrl?
363
-
364
- `string`
365
-
366
- ###### description?
367
-
368
- `string`
369
-
370
- ###### disappearingMessagesDuration?
371
-
372
- `number`
373
-
374
- #### Returns
375
-
376
- `Promise`\<\{ `groupId`: [`GroupId`](../type-aliases/GroupId.md); `masterKey`: `Uint8Array`; \}\>
377
-
378
- ***
379
-
380
- ### createGroupInviteLink()
381
-
382
- > **createGroupInviteLink**(`groupId`, `editorAci`): `Promise`\<`string`\>
383
-
384
- Create an invite link for a group.
385
-
386
- #### Parameters
387
-
388
- ##### groupId
389
-
390
- [`GroupId`](../type-aliases/GroupId.md)
391
-
392
- ##### editorAci
393
-
394
- `Uint8Array`
395
-
396
- #### Returns
397
-
398
- `Promise`\<`string`\>
399
-
400
- ***
401
-
402
- ### createGroupSenderKey()
403
-
404
- > **createGroupSenderKey**(`groupId`): `Promise`\<\{ `distributionMessage`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `senderKeyId`: `string`; \}\>
405
-
406
- Create a new sender key for group messaging
407
-
408
- Call this when joining a group or when key rotation is needed.
409
- Distribute the returned message to all group members via pairwise sessions.
410
-
411
- #### Parameters
412
-
413
- ##### groupId
414
-
415
- `string`
416
-
417
- Unique identifier for the group
418
-
419
- #### Returns
420
-
421
- `Promise`\<\{ `distributionMessage`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `senderKeyId`: `string`; \}\>
422
-
423
- Distribution message to share with group members
424
-
425
- #### Example
426
-
427
- ```typescript
428
- // Create sender key when joining a group
429
- const { distributionMessage } = await signal.createGroupSenderKey('group-123');
430
-
431
- // Distribute to all members via pairwise encryption
432
- for (const member of groupMembers) {
433
- const encrypted = await signal.encryptMessage(member.address, JSON.stringify(distributionMessage));
434
- await sendToMember(member, encrypted);
435
- }
436
- ```
437
-
438
- #### Implementation of
439
-
440
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`createGroupSenderKey`](../interfaces/ISignalProtocolClient.md#creategroupsenderkey)
441
-
442
- ***
443
-
444
- ### decryptFile()
445
-
446
- > **decryptFile**(`remoteAddress`, `encryptedBlob`, `encryptedKey`): `Promise`\<`Blob`\>
447
-
448
- Decrypt file blob
449
-
450
- #### Parameters
451
-
452
- ##### remoteAddress
453
-
454
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
455
-
456
- Remote device's protocol address
457
-
458
- ##### encryptedBlob
459
-
460
- `Blob`
461
-
462
- Encrypted file data
463
-
464
- ##### encryptedKey
465
-
466
- [`Ciphertext`](../type-aliases/Ciphertext.md)
467
-
468
- Encrypted symmetric key
469
-
470
- #### Returns
471
-
472
- `Promise`\<`Blob`\>
473
-
474
- Decrypted file blob with correct MIME type
475
-
476
- #### Implementation of
477
-
478
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`decryptFile`](../interfaces/ISignalProtocolClient.md#decryptfile)
479
-
480
- ***
481
-
482
- ### decryptFiles()
483
-
484
- > **decryptFiles**(`remoteAddress`, `files`): `Promise`\<`Blob`[]\>
485
-
486
- Decrypt multiple files in batch
487
-
488
- More efficient than calling decryptFile() multiple times.
489
-
490
- #### Parameters
491
-
492
- ##### remoteAddress
493
-
494
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
495
-
496
- Remote device's protocol address
497
-
498
- ##### files
499
-
500
- `object`[]
501
-
502
- Array of encrypted file data
503
-
504
- #### Returns
505
-
506
- `Promise`\<`Blob`[]\>
507
-
508
- Array of decrypted file blobs in the same order
509
-
510
- ***
511
-
512
- ### decryptGroupMessage()
513
-
514
- > **decryptGroupMessage**(`groupId`, `senderId`, `senderDeviceId`, `framedMessage`): `Promise`\<`string`\>
515
-
516
- Decrypt a group message from a sender
517
-
518
- Use this to decrypt messages from other group members.
519
- You must have processed the sender's distribution message first.
520
-
521
- #### Parameters
522
-
523
- ##### groupId
524
-
525
- `string`
526
-
527
- Group identifier
528
-
529
- ##### senderId
530
-
531
- `string`
532
-
533
- Sender's user ID
534
-
535
- ##### senderDeviceId
536
-
537
- `number`
538
-
539
- Sender's device ID
540
-
541
- ##### framedMessage
542
-
543
- `Uint8Array`
544
-
545
- Framed SenderKeyMessage bytes
546
-
547
- #### Returns
548
-
549
- `Promise`\<`string`\>
550
-
551
- Decrypted plaintext
552
-
553
- #### Example
554
-
555
- ```typescript
556
- const plaintext = await signal.decryptGroupMessage(
557
- 'group-123',
558
- senderId,
559
- senderDeviceId,
560
- encryptedMessage
561
- );
562
- console.log('Message:', plaintext);
563
- ```
564
-
565
- #### Implementation of
566
-
567
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`decryptGroupMessage`](../interfaces/ISignalProtocolClient.md#decryptgroupmessage)
568
-
569
- ***
570
-
571
- ### decryptMessage()
572
-
573
- > **decryptMessage**(`remoteAddress`, `ciphertext`): `Promise`\<`string`\>
574
-
575
- Decrypt a message from a session
576
-
577
- Uses the Double Ratchet algorithm to decrypt ciphertext, handling
578
- out-of-order messages and updating session state.
579
-
580
- #### Parameters
581
-
582
- ##### remoteAddress
583
-
584
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
585
-
586
- Remote device's protocol address
587
-
588
- ##### ciphertext
589
-
590
- [`Ciphertext`](../type-aliases/Ciphertext.md)
591
-
592
- Message to decrypt
593
-
594
- #### Returns
595
-
596
- `Promise`\<`string`\>
597
-
598
- Decrypted plaintext
599
-
600
- #### Implementation of
601
-
602
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`decryptMessage`](../interfaces/ISignalProtocolClient.md#decryptmessage)
603
-
604
- ***
605
-
606
- ### decryptMessages()
607
-
608
- > **decryptMessages**(`remoteAddress`, `ciphertexts`): `Promise`\<`string`[]\>
609
-
610
- Decrypt multiple messages in batch
611
-
612
- More efficient than calling decryptMessage() multiple times.
613
- Handles out-of-order messages correctly.
614
-
615
- #### Parameters
616
-
617
- ##### remoteAddress
618
-
619
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
620
-
621
- Remote device's protocol address
622
-
623
- ##### ciphertexts
624
-
625
- [`Ciphertext`](../type-aliases/Ciphertext.md)[]
626
-
627
- Array of messages to decrypt
628
-
629
- #### Returns
630
-
631
- `Promise`\<`string`[]\>
632
-
633
- Array of decrypted plaintexts in the same order
634
-
635
- ***
636
-
637
- ### deleteGroupSenderKey()
638
-
639
- > **deleteGroupSenderKey**(`groupId`): `Promise`\<`void`\>
640
-
641
- Delete sender key when leaving a group
642
-
643
- #### Parameters
644
-
645
- ##### groupId
646
-
647
- `string`
648
-
649
- Group identifier
650
-
651
- #### Returns
652
-
653
- `Promise`\<`void`\>
654
-
655
- #### Implementation of
656
-
657
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`deleteGroupSenderKey`](../interfaces/ISignalProtocolClient.md#deletegroupsenderkey)
658
-
659
- ***
660
-
661
- ### deleteRemoteAttachment()
662
-
663
- > **deleteRemoteAttachment**(`attachment`, `options?`): `Promise`\<`void`\>
664
-
665
- Delete the encrypted remote object referenced by an attachment pointer.
666
-
667
- This only touches remote object storage. App-owned local message rows and
668
- local media caches must be deleted by the application.
669
-
670
- #### Parameters
671
-
672
- ##### attachment
673
-
674
- [`MediaAttachmentPointer`](../namespaces/media/interfaces/MediaAttachmentPointer.md)
675
-
676
- ##### options?
677
-
678
- `Pick`\<[`AttachmentTransferOptions`](../interfaces/AttachmentTransferOptions.md), `"signal"` \| `"onProgress"`\>
679
-
680
- #### Returns
681
-
682
- `Promise`\<`void`\>
683
-
684
- #### Implementation of
685
-
686
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`deleteRemoteAttachment`](../interfaces/ISignalProtocolClient.md#deleteremoteattachment)
687
-
688
- ***
689
-
690
- ### deleteSession()
691
-
692
- > **deleteSession**(`remoteAddress`): `Promise`\<`void`\>
693
-
694
- Delete a session
695
-
696
- Use this to reset encryption for a session (e.g., after a security incident).
697
- You'll need to establish a new session before sending/receiving messages.
698
-
699
- #### Parameters
700
-
701
- ##### remoteAddress
702
-
703
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
704
-
705
- Remote device's protocol address
706
-
707
- #### Returns
708
-
709
- `Promise`\<`void`\>
710
-
711
- #### Implementation of
712
-
713
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`deleteSession`](../interfaces/ISignalProtocolClient.md#deletesession)
714
-
715
- ***
716
-
717
- ### distributeGroupSenderKey()
718
-
719
- > **distributeGroupSenderKey**(`groupId`, `memberUserIds`): `Promise`\<`void`\>
720
-
721
- Distribute sender key to all group members.
722
-
723
- Called after group creation or after key rotation.
724
- Skips self and sends to all other members via pairwise encryption.
725
-
726
- #### Parameters
727
-
728
- ##### groupId
729
-
730
- `string`
731
-
732
- Group identifier
733
-
734
- ##### memberUserIds
735
-
736
- `string`[]
737
-
738
- Array of all member user IDs
739
-
740
- #### Returns
741
-
742
- `Promise`\<`void`\>
743
-
744
- #### Example
745
-
746
- ```typescript
747
- // After creating a group
748
- const memberIds = ['alice', 'bob', 'charlie'];
749
- await signal.distributeGroupSenderKey('group-123', memberIds);
750
- ```
751
-
752
- #### Implementation of
753
-
754
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`distributeGroupSenderKey`](../interfaces/ISignalProtocolClient.md#distributegroupsenderkey)
755
-
756
- ***
757
-
758
- ### distributeSenderKeyToUser()
759
-
760
- > **distributeSenderKeyToUser**(`groupId`, `recipientUserId`): `Promise`\<`void`\>
761
-
762
- Distribute sender key to a specific user via pairwise encryption.
763
-
764
- Distribution messages are transmitted through authenticated, encrypted
765
- pairwise channels.
766
-
767
- This method:
768
- 1. Gets or creates sender key for this group
769
- 2. Encrypts the distribution message using pairwise Signal Protocol
770
- 3. Sends via SESAME to all of the recipient's devices
771
-
772
- #### Parameters
773
-
774
- ##### groupId
775
-
776
- `string`
777
-
778
- Group identifier
779
-
780
- ##### recipientUserId
781
-
782
- `string`
783
-
784
- Recipient user ID to distribute key to
785
-
786
- #### Returns
787
-
788
- `Promise`\<`void`\>
789
-
790
- #### Example
791
-
792
- ```typescript
793
- // Distribute key to a specific user
794
- await signal.distributeSenderKeyToUser('group-123', 'bob');
795
- ```
796
-
797
- #### Implementation of
798
-
799
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`distributeSenderKeyToUser`](../interfaces/ISignalProtocolClient.md#distributesenderkeytouser)
800
-
801
- ***
802
-
803
- ### downloadAttachment()
804
-
805
- > **downloadAttachment**(`attachment`, `options?`): `Promise`\<[`ResolvedMediaAttachment`](../namespaces/media/interfaces/ResolvedMediaAttachment.md)\>
806
-
807
- Download, verify, and decrypt an uploaded attachment pointer.
808
-
809
- The client validates pointer metadata, verifies the encrypted blob digest,
810
- and only returns plaintext after streaming AEAD authentication succeeds.
811
-
812
- #### Parameters
813
-
814
- ##### attachment
815
-
816
- [`MediaAttachmentPointer`](../namespaces/media/interfaces/MediaAttachmentPointer.md)
817
-
818
- ##### options?
819
-
820
- [`AttachmentTransferOptions`](../interfaces/AttachmentTransferOptions.md)
821
-
822
- #### Returns
823
-
824
- `Promise`\<[`ResolvedMediaAttachment`](../namespaces/media/interfaces/ResolvedMediaAttachment.md)\>
825
-
826
- #### Implementation of
827
-
828
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`downloadAttachment`](../interfaces/ISignalProtocolClient.md#downloadattachment)
829
-
830
- ***
831
-
832
- ### encryptFile()
833
-
834
- > **encryptFile**(`remoteAddress`, `fileBlob`, `mimeType?`): `Promise`\<\{ `encryptedBlob`: `Blob`; `encryptedKey`: [`Ciphertext`](../type-aliases/Ciphertext.md); `keyId`: `string`; \}\>
835
-
836
- Encrypt file blob with two-layer encryption
837
-
838
- Layer 1: Random symmetric key encrypts the file
839
- Layer 2: Signal Protocol encrypts the symmetric key
840
-
841
- This allows efficient storage of large files with Signal Protocol key rotation.
842
-
843
- #### Parameters
844
-
845
- ##### remoteAddress
846
-
847
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
848
-
849
- Remote device's protocol address
850
-
851
- ##### fileBlob
852
-
853
- `Blob`
854
-
855
- File data to encrypt
856
-
857
- ##### mimeType?
858
-
859
- `string`
860
-
861
- Optional MIME type (defaults to fileBlob.type)
862
-
863
- #### Returns
864
-
865
- `Promise`\<\{ `encryptedBlob`: `Blob`; `encryptedKey`: [`Ciphertext`](../type-aliases/Ciphertext.md); `keyId`: `string`; \}\>
866
-
867
- Encrypted blob, key ID, and encrypted key
868
-
869
- #### Implementation of
870
-
871
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`encryptFile`](../interfaces/ISignalProtocolClient.md#encryptfile)
872
-
873
- ***
874
-
875
- ### encryptFiles()
876
-
877
- > **encryptFiles**(`remoteAddress`, `files`): `Promise`\<`object`[]\>
878
-
879
- Encrypt multiple files in batch
880
-
881
- More efficient than calling encryptFile() multiple times.
882
- Each file gets its own encryption key for granular access control.
883
-
884
- #### Parameters
885
-
886
- ##### remoteAddress
887
-
888
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
889
-
890
- Remote device's protocol address
891
-
892
- ##### files
893
-
894
- `object`[]
895
-
896
- Array of file blobs with optional MIME types
897
-
898
- #### Returns
899
-
900
- `Promise`\<`object`[]\>
901
-
902
- Array of encrypted file results in the same order
903
-
904
- ***
905
-
906
- ### encryptGroupMessage()
907
-
908
- > **encryptGroupMessage**(`groupId`, `plaintext`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
909
-
910
- Encrypt a message for group using sender key (O(1) encryption)
911
-
912
- After creating your sender key and distributing it to members,
913
- use this to encrypt messages. All group members can decrypt
914
- the same ciphertext, making it efficient for large groups.
915
-
916
- #### Parameters
917
-
918
- ##### groupId
919
-
920
- `string`
921
-
922
- Group identifier
923
-
924
- ##### plaintext
925
-
926
- `string`
927
-
928
- Message to encrypt
929
-
930
- #### Returns
931
-
932
- `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
933
-
934
- Framed SenderKeyMessage bytes
935
-
936
- #### Example
937
-
938
- ```typescript
939
- // Encrypt once, send to all members
940
- const encrypted = await signal.encryptGroupMessage('group-123', 'Hello everyone!');
941
-
942
- // Broadcast same ciphertext to all members
943
- for (const member of groupMembers) {
944
- await sendToMember(member, encrypted);
945
- }
946
- ```
947
-
948
- #### Implementation of
949
-
950
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`encryptGroupMessage`](../interfaces/ISignalProtocolClient.md#encryptgroupmessage)
951
-
952
- ***
953
-
954
- ### encryptMessage()
955
-
956
- > **encryptMessage**(`remoteAddress`, `plaintext`): `Promise`\<[`Ciphertext`](../type-aliases/Ciphertext.md)\>
957
-
958
- #### Parameters
959
-
960
- ##### remoteAddress
961
-
962
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
963
-
964
- ##### plaintext
965
-
966
- `string`
967
-
968
- #### Returns
969
-
970
- `Promise`\<[`Ciphertext`](../type-aliases/Ciphertext.md)\>
971
-
972
- #### See
973
-
974
- MessageOps.encryptMessage
975
-
976
- #### Implementation of
977
-
978
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`encryptMessage`](../interfaces/ISignalProtocolClient.md#encryptmessage)
979
-
980
- ***
981
-
982
- ### encryptMessages()
983
-
984
- > **encryptMessages**(`remoteAddress`, `plaintexts`): `Promise`\<[`Ciphertext`](../type-aliases/Ciphertext.md)[]\>
985
-
986
- Encrypt multiple messages in batch
987
-
988
- More efficient than calling encryptMessage() multiple times.
989
- Operations are performed atomically - if any encryption fails,
990
- none of the messages are encrypted.
991
-
992
- #### Parameters
993
-
994
- ##### remoteAddress
995
-
996
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
997
-
998
- Remote device's protocol address
999
-
1000
- ##### plaintexts
1001
-
1002
- `string`[]
1003
-
1004
- Array of messages to encrypt
1005
-
1006
- #### Returns
1007
-
1008
- `Promise`\<[`Ciphertext`](../type-aliases/Ciphertext.md)[]\>
1009
-
1010
- Array of encrypted ciphertexts in the same order
1011
-
1012
- ***
1013
-
1014
- ### establishSession()
1015
-
1016
- > **establishSession**(`remoteAddress`, `prekeyBundle`, `recipientIdentityType?`): `Promise`\<`void`\>
1017
-
1018
- Establish a new session with a specific remote device.
1019
-
1020
- Advanced direct-device API. Normal app code can call `send(recipientUserId, content)`;
1021
- the client will fetch remote device bundles through the configured relay and
1022
- use the selected protocol policy. Direct callers must provide the remote
1023
- device's prekey bundle themselves.
1024
-
1025
- #### Parameters
1026
-
1027
- ##### remoteAddress
1028
-
1029
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
1030
-
1031
- Partner's protocol address (userId + deviceId)
1032
-
1033
- ##### prekeyBundle
1034
-
1035
- [`RelayPreKeyBundle`](../interfaces/RelayPreKeyBundle.md)
1036
-
1037
- Partner's prekey bundle (fetched from server)
1038
-
1039
- ##### recipientIdentityType?
1040
-
1041
- [`IdentityType`](../namespaces/keys/type-aliases/IdentityType.md) = `'aci'`
1042
-
1043
- #### Returns
1044
-
1045
- `Promise`\<`void`\>
1046
-
1047
- #### Example
1048
-
1049
- ```typescript
1050
- import { ProtocolAddress } from '@open-e2ee/signal-protocol-sdk';
1051
-
1052
- const remoteAddress = ProtocolAddress.create('bob', 1);
1053
- const bundle = await relay.fetchPreKeyBundle(remoteAddress.userId);
1054
- await signal.establishSession(remoteAddress, bundle);
1055
- ```
1056
-
1057
- #### Implementation of
1058
-
1059
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`establishSession`](../interfaces/ISignalProtocolClient.md#establishsession)
1060
-
1061
- ***
1062
-
1063
- ### fetchSenderCertificate()
1064
-
1065
- > **fetchSenderCertificate**(): `Promise`\<`string`\>
1066
-
1067
- Fetch (or return cached) sender certificate for sealed sender.
1068
-
1069
- Uses the configured certificateProvider or relay.fetchSenderCertificate().
1070
- Caches the result until expiry (24h certificate, 5min safety margin).
1071
-
1072
- #### Returns
1073
-
1074
- `Promise`\<`string`\>
1075
-
1076
- Base64-encoded serialized SenderCertificate
1077
-
1078
- #### Throws
1079
-
1080
- if no certificate provider is available
1081
-
1082
- ***
1083
-
1084
- ### forceCompleteKeyReset()
1085
-
1086
- > **forceCompleteKeyReset**(): `Promise`\<[`ForceKeyResetResult`](../interfaces/ForceKeyResetResult.md)\>
1087
-
1088
- Force complete key reset (development/debugging only).
1089
-
1090
- Delegates to PreKeyOps.forceCompleteKeyReset for implementation.
1091
-
1092
- #### Returns
1093
-
1094
- `Promise`\<[`ForceKeyResetResult`](../interfaces/ForceKeyResetResult.md)\>
1095
-
1096
- ***
1097
-
1098
- ### getGroupSenderKeyDistribution()
1099
-
1100
- > **getGroupSenderKeyDistribution**(`groupId`): `Promise`\<[`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md) \| `null`\>
1101
-
1102
- Get the current sender key distribution message for a group
1103
-
1104
- If no sender key exists, returns null. Use createGroupSenderKey() first.
1105
-
1106
- #### Parameters
1107
-
1108
- ##### groupId
1109
-
1110
- `string`
1111
-
1112
- Group identifier
1113
-
1114
- #### Returns
1115
-
1116
- `Promise`\<[`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md) \| `null`\>
1117
-
1118
- Distribution message or null if no key exists
1119
-
1120
- #### Implementation of
1121
-
1122
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`getGroupSenderKeyDistribution`](../interfaces/ISignalProtocolClient.md#getgroupsenderkeydistribution)
1123
-
1124
- ***
1125
-
1126
- ### getGroupSenderKeyStats()
1127
-
1128
- > **getGroupSenderKeyStats**(`groupId`, `senderId`, `senderDeviceId`): `Promise`\<\{ `chainIndex`: `number`; `generation`: `number`; `skippedKeysCount`: `number`; \}\>
1129
-
1130
- Get statistics for a group sender key.
1131
-
1132
- Useful for debugging and monitoring group messaging health.
1133
-
1134
- #### Parameters
1135
-
1136
- ##### groupId
1137
-
1138
- `string`
1139
-
1140
- Group identifier
1141
-
1142
- ##### senderId
1143
-
1144
- `string`
1145
-
1146
- Sender user identifier
1147
-
1148
- ##### senderDeviceId
1149
-
1150
- `number`
1151
-
1152
- Sender device identifier
1153
-
1154
- #### Returns
1155
-
1156
- `Promise`\<\{ `chainIndex`: `number`; `generation`: `number`; `skippedKeysCount`: `number`; \}\>
1157
-
1158
- Stats including chain position, generation, and skipped keys count
1159
-
1160
- #### Example
1161
-
1162
- ```typescript
1163
- const stats = await signal.getGroupSenderKeyStats('group-123', 'alice', 1);
1164
- console.log(`Chain at ${stats.chainIndex}, gen ${stats.generation}`);
1165
- console.log(`${stats.skippedKeysCount} skipped keys stored`);
1166
- ```
1167
-
1168
- ***
1169
-
1170
- ### getGroupState()
1171
-
1172
- > **getGroupState**(`groupId`): `Promise`\<[`DecryptedGroup`](../interfaces/DecryptedGroup.md)\>
1173
-
1174
- Get decrypted group state (from cache or server).
1175
-
1176
- #### Parameters
1177
-
1178
- ##### groupId
1179
-
1180
- [`GroupId`](../type-aliases/GroupId.md)
1181
-
1182
- #### Returns
1183
-
1184
- `Promise`\<[`DecryptedGroup`](../interfaces/DecryptedGroup.md)\>
1185
-
1186
- ***
1187
-
1188
- ### getIdentityPublicKey()
1189
-
1190
- > **getIdentityPublicKey**(): `Promise`\<[`PublicKey`](../type-aliases/PublicKey.md)\>
1191
-
1192
- Get client's identity public key
1193
-
1194
- #### Returns
1195
-
1196
- `Promise`\<[`PublicKey`](../type-aliases/PublicKey.md)\>
1197
-
1198
- Public key for this device's identity
1199
-
1200
- ***
1201
-
1202
- ### getSesameStats()
1203
-
1204
- > **getSesameStats**(): `Promise`\<[`SesameStats`](../interfaces/SesameStats.md)\>
1205
-
1206
- Get Sesame session statistics (for debugging)
1207
-
1208
- Returns information about users, devices, and sessions.
1209
-
1210
- #### Returns
1211
-
1212
- `Promise`\<[`SesameStats`](../interfaces/SesameStats.md)\>
1213
-
1214
- Session statistics
1215
-
1216
- ***
1217
-
1218
- ### getSessionHealth()
1219
-
1220
- > **getSessionHealth**(`userId`): `Promise`\<[`SessionHealthResult`](../interfaces/SessionHealthResult.md)\>
1221
-
1222
- Get health status for encryption sessions with a specific user.
1223
-
1224
- Delegates to SessionOps.getSessionHealth for implementation.
1225
-
1226
- #### Parameters
1227
-
1228
- ##### userId
1229
-
1230
- `string`
1231
-
1232
- #### Returns
1233
-
1234
- `Promise`\<[`SessionHealthResult`](../interfaces/SessionHealthResult.md)\>
1235
-
1236
- #### Implementation of
1237
-
1238
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`getSessionHealth`](../interfaces/ISignalProtocolClient.md#getsessionhealth)
1239
-
1240
- ***
1241
-
1242
- ### getStats()
1243
-
1244
- > **getStats**(): `Promise`\<\{ `hasIdentityKey`: `boolean`; `oneTimePreKeysCount`: `number`; `sessionCount`: `number`; \}\>
1245
-
1246
- Get encryption statistics
1247
-
1248
- #### Returns
1249
-
1250
- `Promise`\<\{ `hasIdentityKey`: `boolean`; `oneTimePreKeysCount`: `number`; `sessionCount`: `number`; \}\>
1251
-
1252
- Statistics about sessions, keys, and usage
1253
-
1254
- ***
1255
-
1256
- ### handleGroupMembershipChange()
1257
-
1258
- > **handleGroupMembershipChange**(`groupId`, `change`): `Promise`\<\{ `distributionMessage?`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `rotated`: `boolean`; \}\>
1259
-
1260
- Handle group membership change with appropriate sender key actions.
1261
-
1262
- This convenience method applies the sender-key lifecycle for membership
1263
- changes:
1264
- - Member removed: Rotate sender key (forward secrecy)
1265
- - Member added: No rotation needed (just distribute current key)
1266
- - Metadata changed: Rotate recommended
1267
-
1268
- #### Parameters
1269
-
1270
- ##### groupId
1271
-
1272
- `string`
1273
-
1274
- Group identifier
1275
-
1276
- ##### change
1277
-
1278
- `"member_added"` \| `"member_removed"` \| `"metadata_changed"`
1279
-
1280
- Type of membership change
1281
-
1282
- #### Returns
1283
-
1284
- `Promise`\<\{ `distributionMessage?`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `rotated`: `boolean`; \}\>
1285
-
1286
- Distribution message if rotation occurred, for sending to members
1287
-
1288
- #### Example
1289
-
1290
- ```typescript
1291
- // When a member is removed
1292
- const result = await signal.handleGroupMembershipChange(
1293
- 'group-123',
1294
- 'member_removed'
1295
- );
1296
-
1297
- if (result.rotated) {
1298
- // Distribute new key to remaining members
1299
- for (const member of remainingMembers) {
1300
- const encrypted = await signal.encryptMessage(
1301
- member.address,
1302
- JSON.stringify(result.distributionMessage)
1303
- );
1304
- await sendToMember(member, encrypted);
1305
- }
1306
- }
1307
- ```
1308
-
1309
- #### Implementation of
1310
-
1311
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`handleGroupMembershipChange`](../interfaces/ISignalProtocolClient.md#handlegroupmembershipchange)
1312
-
1313
- ***
1314
-
1315
- ### hasGroupSenderKey()
1316
-
1317
- > **hasGroupSenderKey**(`groupId`): `Promise`\<`boolean`\>
1318
-
1319
- Check if we have a sender key for a group
1320
-
1321
- #### Parameters
1322
-
1323
- ##### groupId
1324
-
1325
- `string`
1326
-
1327
- Group identifier
1328
-
1329
- #### Returns
1330
-
1331
- `Promise`\<`boolean`\>
1332
-
1333
- True if sender key exists for this device
1334
-
1335
- #### Implementation of
1336
-
1337
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`hasGroupSenderKey`](../interfaces/ISignalProtocolClient.md#hasgroupsenderkey)
1338
-
1339
- ***
1340
-
1341
- ### hasSession()
1342
-
1343
- > **hasSession**(`remoteAddress`): `Promise`\<`boolean`\>
1344
-
1345
- Check if a session exists
1346
-
1347
- #### Parameters
1348
-
1349
- ##### remoteAddress
1350
-
1351
- [`ProtocolAddress`](../interfaces/ProtocolAddress.md)
1352
-
1353
- Remote device's protocol address
1354
-
1355
- #### Returns
1356
-
1357
- `Promise`\<`boolean`\>
1358
-
1359
- True if session exists
1360
-
1361
- #### Implementation of
1362
-
1363
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`hasSession`](../interfaces/ISignalProtocolClient.md#hassession)
1364
-
1365
- ***
1366
-
1367
- ### isInitialized()
1368
-
1369
- > **isInitialized**(): `Promise`\<`boolean`\>
1370
-
1371
- Check if client is initialized
1372
-
1373
- #### Returns
1374
-
1375
- `Promise`\<`boolean`\>
1376
-
1377
- True if identity keys exist and client is ready to use
1378
-
1379
- ***
1380
-
1381
- ### joinGroupViaInviteLink()
1382
-
1383
- > **joinGroupViaInviteLink**(`url`, `userAci`, `userProfileKey`): `Promise`\<\{ `groupId`: [`GroupId`](../type-aliases/GroupId.md); `status`: `"joined"` \| `"pending_approval"`; \}\>
1384
-
1385
- Join a group via invite link.
1386
-
1387
- #### Parameters
1388
-
1389
- ##### url
1390
-
1391
- `string`
1392
-
1393
- ##### userAci
1394
-
1395
- `Uint8Array`
1396
-
1397
- ##### userProfileKey
1398
-
1399
- `Uint8Array`
1400
-
1401
- #### Returns
1402
-
1403
- `Promise`\<\{ `groupId`: [`GroupId`](../type-aliases/GroupId.md); `status`: `"joined"` \| `"pending_approval"`; \}\>
1404
-
1405
- ***
1406
-
1407
- ### leaveGroup()
1408
-
1409
- > **leaveGroup**(`groupId`, `userAci`): `Promise`\<`void`\>
1410
-
1411
- Leave a group.
1412
-
1413
- #### Parameters
1414
-
1415
- ##### groupId
1416
-
1417
- [`GroupId`](../type-aliases/GroupId.md)
1418
-
1419
- ##### userAci
1420
-
1421
- `Uint8Array`
1422
-
1423
- #### Returns
1424
-
1425
- `Promise`\<`void`\>
1426
-
1427
- ***
1428
-
1429
- ### markAsRead()
1430
-
1431
- > **markAsRead**(`messageId`): `Promise`\<`void`\>
1432
-
1433
- Mark a message as read/delivered
1434
-
1435
- Signals to the server that the message was successfully received
1436
- and processed. Server may delete the message based on privacy settings.
1437
-
1438
- #### Parameters
1439
-
1440
- ##### messageId
1441
-
1442
- `string`
1443
-
1444
- The message ID from SendResult
1445
-
1446
- #### Returns
1447
-
1448
- `Promise`\<`void`\>
1449
-
1450
- #### Example
1451
-
1452
- ```typescript
1453
- // After processing received message
1454
- await signal.markAsRead(envelope.id);
1455
- ```
1456
-
1457
- ***
1458
-
1459
- ### processGroupSenderKeyDistribution()
1460
-
1461
- > **processGroupSenderKeyDistribution**(`groupId`, `senderId`, `senderDeviceId`, `message`): `Promise`\<`void`\>
1462
-
1463
- Process a sender key distribution message from another group member
1464
-
1465
- Call this when receiving a sender key distribution message from a group member.
1466
- After processing, you can decrypt messages from that member.
1467
-
1468
- #### Parameters
1469
-
1470
- ##### groupId
1471
-
1472
- `string`
1473
-
1474
- Group identifier
1475
-
1476
- ##### senderId
1477
-
1478
- `string`
1479
-
1480
- Sender's user ID
1481
-
1482
- ##### senderDeviceId
1483
-
1484
- `number`
1485
-
1486
- Sender's device ID
1487
-
1488
- ##### message
1489
-
1490
- [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md)
1491
-
1492
- Distribution message containing the sender key
1493
-
1494
- #### Returns
1495
-
1496
- `Promise`\<`void`\>
1497
-
1498
- #### Example
1499
-
1500
- ```typescript
1501
- // Receive and process distribution message
1502
- const distributionMessage = JSON.parse(decryptedContent);
1503
- await signal.processGroupSenderKeyDistribution(
1504
- 'group-123',
1505
- senderId,
1506
- senderDeviceId,
1507
- distributionMessage
1508
- );
1509
- ```
1510
-
1511
- #### Implementation of
1512
-
1513
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`processGroupSenderKeyDistribution`](../interfaces/ISignalProtocolClient.md#processgroupsenderkeydistribution)
1514
-
1515
- ***
1516
-
1517
- ### processIncomingEnvelope()
1518
-
1519
- > **processIncomingEnvelope**(`envelope`, `options?`): `Promise`\<`string`\>
1520
-
1521
- Process an incoming encrypted message envelope.
1522
-
1523
- Unified entry point for both foreground (relay) and background (HTTP) message processing.
1524
- Handles decryption and automatically sends SESAME retry requests on retryable failures.
1525
-
1526
- This method:
1527
- 1. Decodes base64 ciphertext from the envelope
1528
- 2. Decrypts message using Double Ratchet
1529
- 3. On retryable error: sends retry request via relay or options callback
1530
- 4. Re-throws error for caller to handle
1531
-
1532
- #### Parameters
1533
-
1534
- ##### envelope
1535
-
1536
- [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md)
1537
-
1538
- The encrypted message envelope
1539
-
1540
- ##### options?
1541
-
1542
- [`ProcessEnvelopeOptions`](../interfaces/ProcessEnvelopeOptions.md)
1543
-
1544
- Transport callbacks for background (no relay) scenarios
1545
-
1546
- #### Returns
1547
-
1548
- `Promise`\<`string`\>
1549
-
1550
- Decrypted plaintext
1551
-
1552
- #### Throws
1553
-
1554
- EncryptionError after sending retry request if decryption fails
1555
-
1556
- #### Implementation of
1557
-
1558
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`processIncomingEnvelope`](../interfaces/ISignalProtocolClient.md#processincomingenvelope)
1559
-
1560
- ***
1561
-
1562
- ### processIncomingEnvelopes()
1563
-
1564
- > **processIncomingEnvelopes**(`envelopes`, `options?`): `Promise`\<(\{ `envelope`: [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md); `plaintext`: `string`; \} \| \{ `envelope`: [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md); `error`: `Error`; \})[]\>
1565
-
1566
- Process multiple incoming encrypted message envelopes.
1567
-
1568
- This is the preferred method for batch message processing. It handles:
1569
- 1. Sorting PreKeyMessages before ciphertexts (SESAME session convergence)
1570
- 2. Processing each envelope in order
1571
- 3. Collecting results/errors for caller to handle
1572
-
1573
- The sorting ensures PreKeyMessages (which establish sessions) are processed
1574
- before ciphertexts that depend on those sessions. This is required for
1575
- SESAME Section 3.4 session convergence when archived sessions are promoted.
1576
-
1577
- #### Parameters
1578
-
1579
- ##### envelopes
1580
-
1581
- [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md)[]
1582
-
1583
- Array of encrypted message envelopes
1584
-
1585
- ##### options?
1586
-
1587
- [`ProcessEnvelopeOptions`](../interfaces/ProcessEnvelopeOptions.md)
1588
-
1589
- Transport callbacks for background scenarios
1590
-
1591
- #### Returns
1592
-
1593
- `Promise`\<(\{ `envelope`: [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md); `plaintext`: `string`; \} \| \{ `envelope`: [`IncomingEnvelope`](../interfaces/IncomingEnvelope.md); `error`: `Error`; \})[]\>
1594
-
1595
- Array of results, each either success (plaintext) or failure (error)
1596
-
1597
- #### Example
1598
-
1599
- ```typescript
1600
- const results = await signal.processIncomingEnvelopes(pendingMessages);
1601
- for (const result of results) {
1602
- if ('plaintext' in result) {
1603
- handleDecryptedMessage(result.envelope, result.plaintext);
1604
- } else {
1605
- handleDecryptionError(result.envelope, result.error);
1606
- }
1607
- }
1608
- ```
1609
-
1610
- #### See
1611
-
1612
- https://signal.org/docs/specifications/sesame/ Section 3.4
1613
-
1614
- ***
1615
-
1616
- ### receive()
1617
-
1618
- > **receive**(`message`): `Promise`\<`string`\>
1619
-
1620
- Receive and decrypt message from another device (multi-device support)
1621
-
1622
- Implements session convergence per SESAME spec.
1623
-
1624
- #### Parameters
1625
-
1626
- ##### message
1627
-
1628
- [`SesameMessage`](../interfaces/SesameMessage.md)
1629
-
1630
- The encrypted Sesame message envelope
1631
-
1632
- #### Returns
1633
-
1634
- `Promise`\<`string`\>
1635
-
1636
- Decrypted plaintext
1637
-
1638
- ***
1639
-
1640
- ### registerHook()
1641
-
1642
- > **registerHook**\<`K`\>(`name`, `callback`): `void`
1643
-
1644
- Register a hook callback after construction
1645
-
1646
- Enables dependency injection patterns where hooks are registered
1647
- after SignalProtocolClient is created. This is used by ServicesProvider
1648
- to wire up ContentManager's decryption hook.
1649
-
1650
- #### Type Parameters
1651
-
1652
- ##### K
1653
-
1654
- `K` *extends* keyof [`SignalProtocolClientHooks`](../interfaces/SignalProtocolClientHooks.md)
1655
-
1656
- #### Parameters
1657
-
1658
- ##### name
1659
-
1660
- `K`
1661
-
1662
- The hook name to register
1663
-
1664
- ##### callback
1665
-
1666
- `NonNullable`\<[`SignalProtocolClientHooks`](../interfaces/SignalProtocolClientHooks.md)\[`K`\]\>
1667
-
1668
- The callback function to invoke
1669
-
1670
- #### Returns
1671
-
1672
- `void`
1673
-
1674
- #### Example
1675
-
1676
- ```typescript
1677
- // In ServicesProvider: wire up ContentManager after creation
1678
- const signal = await SignalProtocolClient.create(userId, { storage, relay });
1679
- const content = new ContentManager({ db, signal });
1680
-
1681
- signal.registerHook('onMessageDecrypted', content.getDecryptionHook());
1682
- signal.startRelaySubscription(); // Now safe to start
1683
- ```
1684
-
1685
- #### See
1686
-
1687
- ISignalProtocolClient.registerHook
1688
-
1689
- #### Implementation of
1690
-
1691
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`registerHook`](../interfaces/ISignalProtocolClient.md#registerhook)
1692
-
1693
- ***
1694
-
1695
- ### removeGroupMember()
1696
-
1697
- > **removeGroupMember**(`groupId`, `editorAci`, `targetAci`): `Promise`\<`void`\>
1698
-
1699
- Remove a member from a group. Triggers sender key rotation.
1700
-
1701
- #### Parameters
1702
-
1703
- ##### groupId
1704
-
1705
- [`GroupId`](../type-aliases/GroupId.md)
1706
-
1707
- ##### editorAci
1708
-
1709
- `Uint8Array`
1710
-
1711
- ##### targetAci
1712
-
1713
- `Uint8Array`
1714
-
1715
- #### Returns
1716
-
1717
- `Promise`\<`void`\>
1718
-
1719
- ***
1720
-
1721
- ### rotateAccountIdentity()
1722
-
1723
- > **rotateAccountIdentity**(`expectedCurrentCommitment`, `identityType?`): `Promise`\<`void`\>
1724
-
1725
- Explicitly rotate this account's relay identity using a caller-authenticated
1726
- compare-and-swap commitment, then publish fresh prekeys for that namespace.
1727
- Normal sync and linked-device provisioning never call this operation.
1728
-
1729
- #### Parameters
1730
-
1731
- ##### expectedCurrentCommitment
1732
-
1733
- `Uint8Array`
1734
-
1735
- ##### identityType?
1736
-
1737
- [`IdentityType`](../namespaces/keys/type-aliases/IdentityType.md) = `'aci'`
1738
-
1739
- #### Returns
1740
-
1741
- `Promise`\<`void`\>
1742
-
1743
- #### Implementation of
1744
-
1745
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`rotateAccountIdentity`](../interfaces/ISignalProtocolClient.md#rotateaccountidentity)
1746
-
1747
- ***
1748
-
1749
- ### rotateEcSignedPreKey()
1750
-
1751
- > **rotateEcSignedPreKey**(): `Promise`\<`boolean`\>
1752
-
1753
- Rotate EC signed prekey
1754
-
1755
- Rotates only once the current prekey is older than the configured refresh
1756
- interval ([KEY\_REFRESH\_INTERVAL\_MS\_DEFAULT](../variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md), 2 days by default), so
1757
- it is safe to call more often than that. Generates a new EC signed prekey
1758
- and uploads it to the relay if configured.
1759
-
1760
- #### Returns
1761
-
1762
- `Promise`\<`boolean`\>
1763
-
1764
- True if rotation was performed, false if not needed yet
1765
-
1766
- #### Implementation of
1767
-
1768
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`rotateEcSignedPreKey`](../interfaces/ISignalProtocolClient.md#rotateecsignedprekey)
1769
-
1770
- ***
1771
-
1772
- ### rotateGroupSenderKey()
1773
-
1774
- > **rotateGroupSenderKey**(`groupId`): `Promise`\<\{ `distributionMessage`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `senderKeyId`: `string`; \}\>
1775
-
1776
- Rotate sender key for a group (forward secrecy on membership changes).
1777
-
1778
- ## When to Call
1779
-
1780
- Per Signal Protocol specification, rotate sender keys on **membership changes**:
1781
-
1782
- | Event | Action |
1783
- |-------|--------|
1784
- | Member REMOVED | **ALL members** must rotate (forward secrecy) |
1785
- | Member ADDED | Distribute current key to new member (no rotation needed) |
1786
- | Group metadata changed | Rotate recommended |
1787
-
1788
- **Important**: The reference implementation does NOT use periodic or message-count-based rotation.
1789
- Only rotate when membership changes to maintain forward secrecy.
1790
-
1791
- ## Why Rotate on Member Removal?
1792
-
1793
- When a member is removed, they still have the old sender key and could decrypt
1794
- future messages if the key isn't rotated. ALL remaining members must generate
1795
- new sender keys to prevent the removed member from reading future messages.
1796
-
1797
- #### Parameters
1798
-
1799
- ##### groupId
1800
-
1801
- `string`
1802
-
1803
- Group identifier
1804
-
1805
- #### Returns
1806
-
1807
- `Promise`\<\{ `distributionMessage`: [`SenderKeyDistributionMessage`](../interfaces/SenderKeyDistributionMessage.md); `senderKeyId`: `string`; \}\>
1808
-
1809
- New distribution message to share with remaining members
1810
-
1811
- #### Example
1812
-
1813
- ```typescript
1814
- // When removing a member from a group
1815
- async function onMemberRemoved(groupId: string, remainingMembers: Member[]) {
1816
- // Rotate our sender key (forward secrecy)
1817
- const { distributionMessage } = await signal.rotateGroupSenderKey(groupId);
1818
-
1819
- // Distribute new key to remaining members via pairwise encryption
1820
- for (const member of remainingMembers) {
1821
- const encrypted = await signal.encryptMessage(
1822
- member.address,
1823
- JSON.stringify(distributionMessage)
1824
- );
1825
- await sendToMember(member, encrypted);
1826
- }
1827
- }
1828
-
1829
- // When adding a member - no rotation needed, just distribute current key
1830
- async function onMemberAdded(groupId: string, newMember: Member) {
1831
- const { distributionMessage } = await signal.createGroupSenderKey(groupId);
1832
- // Or get existing: signal.getGroupSenderKeyDistribution(groupId)
1833
- const encrypted = await signal.encryptMessage(
1834
- newMember.address,
1835
- JSON.stringify(distributionMessage)
1836
- );
1837
- await sendToMember(newMember, encrypted);
1838
- }
1839
- ```
1840
-
1841
- #### See
1842
-
1843
- handleGroupMembershipChange - Helper method for common membership patterns
1844
-
1845
- #### Implementation of
1846
-
1847
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`rotateGroupSenderKey`](../interfaces/ISignalProtocolClient.md#rotategroupsenderkey)
1848
-
1849
- ***
1850
-
1851
- ### rotateKyberPreKey()
1852
-
1853
- > **rotateKyberPreKey**(): `Promise`\<`boolean`\>
1854
-
1855
- Rotate the post-quantum KEM last-resort prekey.
1856
-
1857
- Shares the signed prekey's refresh interval
1858
- ([KEY\_REFRESH\_INTERVAL\_MS\_DEFAULT](../variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md), 2 days by default) and rotates
1859
- only once that interval has elapsed. Generates fresh ML-KEM/Kyber-compatible
1860
- key material and uploads it to the relay if configured.
1861
-
1862
- #### Returns
1863
-
1864
- `Promise`\<`boolean`\>
1865
-
1866
- True if rotation was performed, false if not needed yet
1867
-
1868
- #### Implementation of
1869
-
1870
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`rotateKyberPreKey`](../interfaces/ISignalProtocolClient.md#rotatekyberprekey)
1871
-
1872
- ***
1873
-
1874
- ### runPeriodicCleanup()
1875
-
1876
- > **runPeriodicCleanup**(): `number`
1877
-
1878
- Run periodic cleanup of internal tracking state.
1879
-
1880
- Safe to call frequently - internally throttled to avoid overhead.
1881
- Recommended call sites:
1882
- - App foreground transition
1883
- - After successful message batch processing
1884
- - Periodically during long sessions
1885
-
1886
- Cleans up:
1887
- - Expired retry dedup entries (recentRetryRequests)
1888
-
1889
- #### Returns
1890
-
1891
- `number`
1892
-
1893
- Number of entries cleaned up
1894
-
1895
- #### Implementation of
1896
-
1897
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`runPeriodicCleanup`](../interfaces/ISignalProtocolClient.md#runperiodiccleanup)
1898
-
1899
- ***
1900
-
1901
- ### send()
1902
-
1903
- > **send**(`recipientId`, `content`, `options?`): `Promise`\<[`SendResult`](../interfaces/SendResult.md)\>
1904
-
1905
- Send encrypted content to a user or group
1906
-
1907
- This is the ONE way to send content. Handles:
1908
- - DataMessageInput: Structured proto content (serialized to protobuf)
1909
- - String content: Text or structured data (encoded to UTF-8 bytes)
1910
- - Uint8Array: Pre-serialized binary content (passed through)
1911
- - User recipients: Encrypts for all user's devices via SESAME
1912
- - Group recipients: Uses Sender Keys for O(1) encryption
1913
-
1914
- All inputs are normalized to Uint8Array before reaching the cipher layer.
1915
-
1916
- #### Parameters
1917
-
1918
- ##### recipientId
1919
-
1920
- `string`
1921
-
1922
- User ID or group ID (groups use the package group ID prefix)
1923
-
1924
- ##### content
1925
-
1926
- `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`DataMessageInput`](../interfaces/DataMessageInput.md)
1927
-
1928
- DataMessageInput, string, or Uint8Array to encrypt and send
1929
-
1930
- ##### options?
1931
-
1932
- [`SendOptions`](../interfaces/SendOptions.md)
1933
-
1934
- Optional send options (isBinary for blob encryption, etc.)
1935
-
1936
- #### Returns
1937
-
1938
- `Promise`\<[`SendResult`](../interfaces/SendResult.md)\>
1939
-
1940
- SendResult with messageId, timestamp, and device count
1941
-
1942
- #### Example
1943
-
1944
- ```typescript
1945
- import { createGroupId } from '@open-e2ee/signal-protocol-sdk';
1946
-
1947
- // Send text message
1948
- await signal.send('bob', 'Hello!');
1949
-
1950
- // Send structured data
1951
- await signal.send('bob', { body: 'Hello!', timestamp: Date.now() });
1952
-
1953
- // Send binary attachment (two-layer encryption)
1954
- await signal.send('bob', photoBytes, { isBinary: true, mimeType: 'image/jpeg' });
1955
-
1956
- // Send to group (use createGroupId helper)
1957
- await signal.send(createGroupId('abc123'), 'Hello everyone!');
1958
- ```
1959
-
1960
- #### Implementation of
1961
-
1962
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`send`](../interfaces/ISignalProtocolClient.md#send)
1963
-
1964
- ***
1965
-
1966
- ### sendReadReceipt()
1967
-
1968
- > **sendReadReceipt**(`recipientUserId`, `timestamps`): `Promise`\<`void`\>
1969
-
1970
- Send read receipt to original message sender (all devices)
1971
-
1972
- Called when the user views messages in a conversation.
1973
- Similar to delivery receipts but indicates message was actually read.
1974
-
1975
- Respects SDK privacy settings: if read receipts are disabled,
1976
- this method returns early without sending.
1977
-
1978
- #### Parameters
1979
-
1980
- ##### recipientUserId
1981
-
1982
- `string`
1983
-
1984
- Original sender's user ID
1985
-
1986
- ##### timestamps
1987
-
1988
- `number`[]
1989
-
1990
- Server timestamps of messages that were read
1991
-
1992
- #### Returns
1993
-
1994
- `Promise`\<`void`\>
1995
-
1996
- #### Implementation of
1997
-
1998
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`sendReadReceipt`](../interfaces/ISignalProtocolClient.md#sendreadreceipt)
1999
-
2000
- ***
2001
-
2002
- ### sendTypingIndicator()
2003
-
2004
- > **sendTypingIndicator**(`recipientUserId`, `recipientDeviceId`, `conversationId`, `action`, `groupId?`): `Promise`\<`void`\>
2005
-
2006
- Send typing indicator to conversation recipient
2007
-
2008
- Delegates to MessageOps.sendTypingIndicator for implementation.
2009
-
2010
- #### Parameters
2011
-
2012
- ##### recipientUserId
2013
-
2014
- `string`
2015
-
2016
- ##### recipientDeviceId
2017
-
2018
- `number`
2019
-
2020
- ##### conversationId
2021
-
2022
- `string`
2023
-
2024
- ##### action
2025
-
2026
- [`TypingAction`](../enumerations/TypingAction.md)
2027
-
2028
- ##### groupId?
2029
-
2030
- `string`
2031
-
2032
- #### Returns
2033
-
2034
- `Promise`\<`void`\>
2035
-
2036
- #### Implementation of
2037
-
2038
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`sendTypingIndicator`](../interfaces/ISignalProtocolClient.md#sendtypingindicator)
2039
-
2040
- ***
2041
-
2042
- ### sendViewedReceipt()
2043
-
2044
- > **sendViewedReceipt**(`recipientUserId`, `timestamps`): `Promise`\<`void`\>
2045
-
2046
- Send viewed receipt to original message sender (all devices).
2047
-
2048
- Uses the same privacy gate as read receipts.
2049
-
2050
- #### Parameters
2051
-
2052
- ##### recipientUserId
2053
-
2054
- `string`
2055
-
2056
- ##### timestamps
2057
-
2058
- `number`[]
2059
-
2060
- #### Returns
2061
-
2062
- `Promise`\<`void`\>
2063
-
2064
- #### Implementation of
2065
-
2066
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`sendViewedReceipt`](../interfaces/ISignalProtocolClient.md#sendviewedreceipt)
2067
-
2068
- ***
2069
-
2070
- ### startRelaySubscription()
2071
-
2072
- > **startRelaySubscription**(): `void`
2073
-
2074
- Start relay subscription for automatic message decryption
2075
-
2076
- When configured with both `relay` and `onMessageDecrypted` hook, SignalProtocolClient will:
2077
- 1. Subscribe to incoming envelopes from the relay
2078
- 2. Decrypt messages appropriately (pairwise vs group/sender key)
2079
- 3. Call onMessageDecrypted hook with DecryptedEnvelope (for ContentManager storage)
2080
- 4. Mark messages as delivered on the relay
2081
-
2082
- This enables ContentManager to store decrypted content in an encrypted SQLite
2083
- database without any knowledge of cryptography.
2084
-
2085
- Can be called manually after registering hooks via registerHook().
2086
- Called automatically by create() when relay + hook configured.
2087
-
2088
- #### Returns
2089
-
2090
- `void`
2091
-
2092
- #### See
2093
-
2094
- ISignalProtocolClient.startRelaySubscription
2095
-
2096
- #### Implementation of
2097
-
2098
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`startRelaySubscription`](../interfaces/ISignalProtocolClient.md#startrelaysubscription)
2099
-
2100
- ***
2101
-
2102
- ### startRetryRequestSubscription()
2103
-
2104
- > **startRetryRequestSubscription**(): `void`
2105
-
2106
- Start listening for retry requests from recipients (SESAME spec §6.2)
2107
-
2108
- When a recipient cannot decrypt a message, they send a retry request.
2109
- This method subscribes to incoming retry requests and processes them
2110
- by resending the original message with a new session.
2111
-
2112
- Automatically started if relay.subscribeRetryRequests is available.
2113
- Can be called manually if you need to restart the subscription.
2114
-
2115
- #### Returns
2116
-
2117
- `void`
2118
-
2119
- ***
2120
-
2121
- ### stop()
2122
-
2123
- > **stop**(): `Promise`\<`void`\>
2124
-
2125
- Stop the Signal Protocol client and clean up resources
2126
-
2127
- Call this when the user logs out or the app is being destroyed.
2128
- Unsubscribes from relay server and cleans up any pending operations.
2129
-
2130
- #### Returns
2131
-
2132
- `Promise`\<`void`\>
2133
-
2134
- #### Example
2135
-
2136
- ```typescript
2137
- // On logout
2138
- await signal.stop();
2139
- ```
2140
-
2141
- #### Implementation of
2142
-
2143
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`stop`](../interfaces/ISignalProtocolClient.md#stop)
2144
-
2145
- ***
2146
-
2147
- ### stopRelaySubscription()
2148
-
2149
- > **stopRelaySubscription**(): `void`
2150
-
2151
- Stop the relay subscription
2152
-
2153
- Pauses message processing via the relay subscription without destroying
2154
- SignalProtocolClient state. The subscription can be restarted with startRelaySubscription().
2155
-
2156
- Use this when the app backgrounds to let the background task handle messages.
2157
- Resume when the app foregrounds for real-time message delivery.
2158
-
2159
- #### Returns
2160
-
2161
- `void`
2162
-
2163
- #### See
2164
-
2165
- ISignalProtocolClient.stopRelaySubscription
2166
-
2167
- #### Implementation of
2168
-
2169
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`stopRelaySubscription`](../interfaces/ISignalProtocolClient.md#stoprelaysubscription)
2170
-
2171
- ***
2172
-
2173
- ### syncBlockedRecipientsToLinkedDevices()
2174
-
2175
- > **syncBlockedRecipientsToLinkedDevices**(`blocked`): `Promise`\<`void`\>
2176
-
2177
- Sync the current blocked-recipient snapshot to the account's other linked devices.
2178
-
2179
- The payload is a full snapshot, not a block/unblock delta.
2180
-
2181
- #### Parameters
2182
-
2183
- ##### blocked
2184
-
2185
- [`BlockedRecipientsSyncInput`](../interfaces/BlockedRecipientsSyncInput.md)
2186
-
2187
- #### Returns
2188
-
2189
- `Promise`\<`void`\>
2190
-
2191
- #### Implementation of
2192
-
2193
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncBlockedRecipientsToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncblockedrecipientstolinkeddevices)
2194
-
2195
- ***
2196
-
2197
- ### syncConfigurationToLinkedDevices()
2198
-
2199
- > **syncConfigurationToLinkedDevices**(`configuration`): `Promise`\<`void`\>
2200
-
2201
- Sync local account-level communication/privacy configuration to our other linked devices.
2202
-
2203
- #### Parameters
2204
-
2205
- ##### configuration
2206
-
2207
- [`ConfigurationSyncInput`](../interfaces/ConfigurationSyncInput.md)
2208
-
2209
- #### Returns
2210
-
2211
- `Promise`\<`void`\>
2212
-
2213
- #### Implementation of
2214
-
2215
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncConfigurationToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncconfigurationtolinkeddevices)
2216
-
2217
- ***
2218
-
2219
- ### syncGroup()
2220
-
2221
- > **syncGroup**(`groupId`): `Promise`\<[`DecryptedGroup`](../interfaces/DecryptedGroup.md)\>
2222
-
2223
- Sync group state from server.
2224
-
2225
- #### Parameters
2226
-
2227
- ##### groupId
2228
-
2229
- [`GroupId`](../type-aliases/GroupId.md)
2230
-
2231
- #### Returns
2232
-
2233
- `Promise`\<[`DecryptedGroup`](../interfaces/DecryptedGroup.md)\>
2234
-
2235
- ***
2236
-
2237
- ### syncMediaAttachmentDeleteToLinkedDevices()
2238
-
2239
- > **syncMediaAttachmentDeleteToLinkedDevices**(`entry`): `Promise`\<`void`\>
2240
-
2241
- Sync a local media attachment delete event to our other linked devices.
2242
-
2243
- #### Parameters
2244
-
2245
- ##### entry
2246
-
2247
- [`MediaAttachmentDeleteSyncInput`](../interfaces/MediaAttachmentDeleteSyncInput.md)
2248
-
2249
- #### Returns
2250
-
2251
- `Promise`\<`void`\>
2252
-
2253
- #### Implementation of
2254
-
2255
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncMediaAttachmentDeleteToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncmediaattachmentdeletetolinkeddevices)
2256
-
2257
- ***
2258
-
2259
- ### syncReadToLinkedDevices()
2260
-
2261
- > **syncReadToLinkedDevices**(`entries`): `Promise`\<`void`\>
2262
-
2263
- Sync local read state to our other linked devices.
2264
-
2265
- Unlike read receipts, this is account-local multi-device state and should
2266
- happen regardless of the user's remote read-receipt privacy preference.
2267
-
2268
- #### Parameters
2269
-
2270
- ##### entries
2271
-
2272
- [`ReadSyncEntryInput`](../interfaces/ReadSyncEntryInput.md)[]
2273
-
2274
- #### Returns
2275
-
2276
- `Promise`\<`void`\>
2277
-
2278
- #### Implementation of
2279
-
2280
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncReadToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncreadtolinkeddevices)
2281
-
2282
- ***
2283
-
2284
- ### syncRecipientUsernameToLinkedDevices()
2285
-
2286
- > **syncRecipientUsernameToLinkedDevices**(`recipientUsername`): `Promise`\<`void`\>
2287
-
2288
- Sync learned recipient username metadata to the account's other linked devices.
2289
-
2290
- Remote usernames are transient metadata, but once one local device learns
2291
- them they should converge across the account's linked devices.
2292
-
2293
- #### Parameters
2294
-
2295
- ##### recipientUsername
2296
-
2297
- [`RecipientUsernameSyncInput`](../interfaces/RecipientUsernameSyncInput.md)
2298
-
2299
- #### Returns
2300
-
2301
- `Promise`\<`void`\>
2302
-
2303
- #### Implementation of
2304
-
2305
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncRecipientUsernameToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncrecipientusernametolinkeddevices)
2306
-
2307
- ***
2308
-
2309
- ### syncTaskNotificationAckToLinkedDevices()
2310
-
2311
- > **syncTaskNotificationAckToLinkedDevices**(`input`): `Promise`\<`void`\>
2312
-
2313
- Sync task-notification acknowledgment state to our other linked devices.
2314
-
2315
- This is account-local notification state: if one device dismisses or acts
2316
- on a task reminder, the user's other devices should cancel their copies.
2317
-
2318
- #### Parameters
2319
-
2320
- ##### input
2321
-
2322
- `Omit`\<[`TaskNotificationAckSyncInput`](../interfaces/TaskNotificationAckSyncInput.md), `"acknowledgedOnDevice"`\>
2323
-
2324
- #### Returns
2325
-
2326
- `Promise`\<`void`\>
2327
-
2328
- #### Implementation of
2329
-
2330
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncTaskNotificationAckToLinkedDevices`](../interfaces/ISignalProtocolClient.md#synctasknotificationacktolinkeddevices)
2331
-
2332
- ***
2333
-
2334
- ### syncToServer()
2335
-
2336
- > **syncToServer**(`onProgress?`): `Promise`\<`void`\>
2337
-
2338
- Sync the public prekey bundle to the configured relay.
2339
-
2340
- Called automatically by create() when a relay is configured.
2341
- Can also be called manually to retry after a failed initial sync.
2342
-
2343
- Delegates to PreKeyOps.syncToServer for implementation.
2344
-
2345
- #### Parameters
2346
-
2347
- ##### onProgress?
2348
-
2349
- [`ProgressCallback`](../type-aliases/ProgressCallback.md)
2350
-
2351
- #### Returns
2352
-
2353
- `Promise`\<`void`\>
2354
-
2355
- ***
2356
-
2357
- ### syncUsernameStateToLinkedDevices()
2358
-
2359
- > **syncUsernameStateToLinkedDevices**(`usernameState`): `Promise`\<`void`\>
2360
-
2361
- Sync local username and username-link state to the account's other linked devices.
2362
-
2363
- Linked devices converge on the same username-link handle and entropy
2364
- without rotating it.
2365
-
2366
- #### Parameters
2367
-
2368
- ##### usernameState
2369
-
2370
- [`UsernameStateSyncInput`](../interfaces/UsernameStateSyncInput.md)
2371
-
2372
- #### Returns
2373
-
2374
- `Promise`\<`void`\>
2375
-
2376
- #### Implementation of
2377
-
2378
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncUsernameStateToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncusernamestatetolinkeddevices)
2379
-
2380
- ***
2381
-
2382
- ### syncVerificationStateToLinkedDevices()
2383
-
2384
- > **syncVerificationStateToLinkedDevices**(`verificationState`): `Promise`\<`void`\>
2385
-
2386
- Sync local safety-number verification state to our other linked devices.
2387
-
2388
- Only explicit `verified` and cleared-to-`default` states are synced;
2389
- key-conflict/untrusted state remains local and derived from identity-key
2390
- changes.
2391
-
2392
- #### Parameters
2393
-
2394
- ##### verificationState
2395
-
2396
- [`VerificationStateSyncInput`](../interfaces/VerificationStateSyncInput.md)
2397
-
2398
- #### Returns
2399
-
2400
- `Promise`\<`void`\>
2401
-
2402
- #### Implementation of
2403
-
2404
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncVerificationStateToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncverificationstatetolinkeddevices)
2405
-
2406
- ***
2407
-
2408
- ### syncViewOnceOpenToLinkedDevices()
2409
-
2410
- > **syncViewOnceOpenToLinkedDevices**(`entry`): `Promise`\<`void`\>
2411
-
2412
- Sync a local view-once open event to our other linked devices.
2413
-
2414
- #### Parameters
2415
-
2416
- ##### entry
2417
-
2418
- [`ViewOnceOpenSyncInput`](../interfaces/ViewOnceOpenSyncInput.md)
2419
-
2420
- #### Returns
2421
-
2422
- `Promise`\<`void`\>
2423
-
2424
- #### Implementation of
2425
-
2426
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`syncViewOnceOpenToLinkedDevices`](../interfaces/ISignalProtocolClient.md#syncviewonceopentolinkeddevices)
2427
-
2428
- ***
2429
-
2430
- ### updateGroupAccessControl()
2431
-
2432
- > **updateGroupAccessControl**(`groupId`, `editorAci`, `updates`): `Promise`\<`void`\>
2433
-
2434
- Update a group's access control.
2435
-
2436
- #### Parameters
2437
-
2438
- ##### groupId
2439
-
2440
- [`GroupId`](../type-aliases/GroupId.md)
2441
-
2442
- ##### editorAci
2443
-
2444
- `Uint8Array`
2445
-
2446
- ##### updates
2447
-
2448
- `Partial`\<`AccessControl`\>
2449
-
2450
- #### Returns
2451
-
2452
- `Promise`\<`void`\>
2453
-
2454
- ***
2455
-
2456
- ### updateGroupDescription()
2457
-
2458
- > **updateGroupDescription**(`groupId`, `editorAci`, `description`): `Promise`\<`void`\>
2459
-
2460
- Update a group's description.
2461
-
2462
- #### Parameters
2463
-
2464
- ##### groupId
2465
-
2466
- [`GroupId`](../type-aliases/GroupId.md)
2467
-
2468
- ##### editorAci
2469
-
2470
- `Uint8Array`
2471
-
2472
- ##### description
2473
-
2474
- `string`
2475
-
2476
- #### Returns
2477
-
2478
- `Promise`\<`void`\>
2479
-
2480
- ***
2481
-
2482
- ### updateGroupTitle()
2483
-
2484
- > **updateGroupTitle**(`groupId`, `editorAci`, `title`): `Promise`\<`void`\>
2485
-
2486
- Update a group's title.
2487
-
2488
- #### Parameters
2489
-
2490
- ##### groupId
2491
-
2492
- [`GroupId`](../type-aliases/GroupId.md)
2493
-
2494
- ##### editorAci
2495
-
2496
- `Uint8Array`
2497
-
2498
- ##### title
2499
-
2500
- `string`
2501
-
2502
- #### Returns
2503
-
2504
- `Promise`\<`void`\>
2505
-
2506
- ***
2507
-
2508
- ### uploadAttachment()
2509
-
2510
- > **uploadAttachment**(`data`, `options`): `Promise`\<[`MediaAttachmentPointer`](../namespaces/media/interfaces/MediaAttachmentPointer.md)\>
2511
-
2512
- Encrypt and upload an attachment without sending a standalone message.
2513
-
2514
- Used by higher-level content types that want to carry attachment metadata
2515
- atomically inside another message payload.
2516
-
2517
- #### Parameters
2518
-
2519
- ##### data
2520
-
2521
- `Uint8Array`
2522
-
2523
- ##### options
2524
-
2525
- [`SendOptions`](../interfaces/SendOptions.md) & `object`
2526
-
2527
- #### Returns
2528
-
2529
- `Promise`\<[`MediaAttachmentPointer`](../namespaces/media/interfaces/MediaAttachmentPointer.md)\>
2530
-
2531
- #### Implementation of
2532
-
2533
- [`ISignalProtocolClient`](../interfaces/ISignalProtocolClient.md).[`uploadAttachment`](../interfaces/ISignalProtocolClient.md#uploadattachment)
2534
-
2535
- ***
2536
-
2537
- ### verify()
2538
-
2539
- > **verify**(`userId`, `identityType?`): `Promise`\<[`SafetyNumber`](../interfaces/SafetyNumber.md)\>
2540
-
2541
- Generate safety number for verifying identity with another user
2542
-
2543
- Safety numbers allow users to verify they're communicating with the
2544
- intended person and detect man-in-the-middle attacks.
2545
-
2546
- #### Parameters
2547
-
2548
- ##### userId
2549
-
2550
- `string`
2551
-
2552
- The user ID to generate safety number for
2553
-
2554
- ##### identityType?
2555
-
2556
- [`IdentityType`](../namespaces/keys/type-aliases/IdentityType.md) = `'aci'`
2557
-
2558
- #### Returns
2559
-
2560
- `Promise`\<[`SafetyNumber`](../interfaces/SafetyNumber.md)\>
2561
-
2562
- SafetyNumber with numeric code and fingerprint for QR
2563
-
2564
- #### Example
2565
-
2566
- ```typescript
2567
- const safetyNum = await signal.verify('bob');
2568
-
2569
- // Show numeric code for phone/voice verification
2570
- console.log(`Safety Number: ${safetyNum.numeric}`);
2571
-
2572
- // Generate QR code from fingerprint
2573
- const qrCode = generateQR(safetyNum.fingerprint);
2574
- ```
2575
-
2576
- ***
2577
-
2578
- ### create()
2579
-
2580
- > `static` **create**(`userId`, `config`): `Promise`\<`SignalProtocolClient`\>
2581
-
2582
- Create and initialize a new SignalProtocolClient instance.
2583
-
2584
- This low-level factory ensures the client is fully initialized before it is
2585
- returned. Most app code should prefer `createSignalProtocolClient()` so identity,
2586
- adapters, and protocol policy are grouped in one object.
2587
-
2588
- If `relay` is provided in config, the client automatically uploads the
2589
- public prekey bundle needed for end-to-end encrypted messaging.
2590
-
2591
- #### Parameters
2592
-
2593
- ##### userId
2594
-
2595
- `string`
2596
-
2597
- User identifier for this device/client
2598
-
2599
- ##### config
2600
-
2601
- [`SignalProtocolClientConfig`](../interfaces/SignalProtocolClientConfig.md)
2602
-
2603
- Optional configuration for the client
2604
-
2605
- #### Returns
2606
-
2607
- `Promise`\<`SignalProtocolClient`\>
2608
-
2609
- Fully initialized SignalProtocolClient instance
2610
-
2611
- #### Example
2612
-
2613
- ```typescript
2614
- import { SignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
2615
- import { convexRelay } from '@open-e2ee/signal-protocol-sdk/remote/relay/convex';
2616
-
2617
- // Local-only primary device.
2618
- const signal = await SignalProtocolClient.create('user-123', {
2619
- storage,
2620
- });
2621
-
2622
- // Linked device; storage must already contain provisioned identity material.
2623
- const signal = await SignalProtocolClient.create('user-123', {
2624
- deviceId: 2,
2625
- storage: provisionedLinkedDeviceStorage
2626
- });
2627
-
2628
- // With relay sync.
2629
- const relay = convexRelay({ convex, api: signalApi, currentUserId: userId });
2630
- const signal = await SignalProtocolClient.create('user-123', {
2631
- storage,
2632
- relay,
2633
- onProgress: ({ stage, percent, message }) => {
2634
- console.log(`${stage}: ${percent}% - ${message}`);
2635
- }
2636
- });
2637
-
2638
- // With full configuration
2639
- const signal = await SignalProtocolClient.create('user-123', {
2640
- deviceId: 1,
2641
- storage,
2642
- relay,
2643
- protocol: { postQuantum: 'required', braid: 'required' },
2644
- onProgress,
2645
- enableDebugLogging: true,
2646
- ratchetConfig: { maxSkip: 2000 }
2647
- });
2648
-
2649
- // For local development with in-memory adapters
2650
- const signal = await SignalProtocolClient.create('local-user', {
2651
- protocolManager: mockManager,
2652
- storage: mockStorage
2653
- });
2654
- ```