Documentation / @frak-labs/core-sdk / actions / ensureIdentity
Function: ensureIdentity()
ensureIdentity(
interactionToken):Promise<void>
Defined in: actions/ensureIdentity.ts:29
Ensure the current wallet ↔ clientId link exists on the backend.
Called automatically by watchWalletStatus when a connected wallet status is received. Acts as a failsafe: if the primary merge (SSO, pairing, login/register) missed or silently failed, this ensures the link is eventually established.
The call is:
- Idempotent — if already linked, backend returns immediately
- Deduplicated — only fires once per browser session per merchant
- Fire-and-forget — errors are logged but never thrown
Parameters
interactionToken
string
The SDK JWT from wallet status (x-wallet-sdk-auth)
Returns
Promise<void>
Example
// Usually called automatically via watchWalletStatus side effect.
// Can also be called manually if needed:
await ensureIdentity("eyJhbGciOi...");