dmPairKey
Pure helper: deterministic, order-independent thread key for a pair of user keys.
import { dmPairKey } from 'flowstack-sdk'Computes the deterministic pair_key for two user keys by sorting them and joining with ::. Mirrors the backend's thread-key derivation, so dmPairKey(a, b) === dmPairKey(b, a). Pure — no credentials, no network. Useful for locally matching a thread to a counterpart.
Signature
dmPairKey(a: string, b: string): stringParameters
| Param | Type | Notes | Description |
|---|---|---|---|
a | string | required, since 0.2.2 | One user key. |
b | string | required, since 0.2.2 | The other user key. |
Returns
| Field | Type | Description |
|---|---|---|
| — | string | The sorted, ::-joined pair key (order-independent). |
Examples
Derive a thread key
dmPairKey('userA', 'userB'); // 'userA::userB'
dmPairKey('userB', 'userA'); // 'userA::userB' (same)See also
openThread · useThreads · DmThread
Source: README.md#private-messaging-dms · Also available in llms-full.txt and registry.json.