Aller au contenu

ensureIdentity

Ce contenu n’est pas encore disponible dans votre langue.

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

string

The SDK JWT from wallet status (x-wallet-sdk-auth)

Promise<void>

// Usually called automatically via watchWalletStatus side effect.
// Can also be called manually if needed:
await ensureIdentity("eyJhbGciOi...");