Guides

Testing and health checks

Check your integration with the bridge health diagnostics before you submit a game.

Test the game in a real iframe against the HydraOne web client. The SDK ships a health check to verify the bridge.

Diagnostics

checkBridgeHealth(clientOrTransport, options) from @hydraone-sdk/core runs three checks and returns a BridgeHealthReport:

Check idVerifies
iframe-sandboxThe page is in an iframe with the sandbox permissions it needs.
postmessage-latencyA ping round trip works and is fast enough (warns above warningThresholdMs, default 150 ms; fails after timeoutMs, default 3000 ms).
storage-local and storage-relaylocalStorage and the host relay are readable and writable.

Each check has a status of PASS, WARN or FAIL, a message, and a hint when something needs fixing. report.status is FAIL if any check failed, WARN if any warned, otherwise PASS. Skip checks with skipIframeCheck, skipLatencyCheck, skipStorageCheck. client.checkHealth(options) runs the same report.

import { WalletBridgeClient } from '@hydraone-sdk/core';
import { checkBridgeHealth } from '@hydraone-sdk/core';

const client = new WalletBridgeClient({
  appCenterOrigin: 'https://alpha.hydraone.app',
});

const report = await checkBridgeHealth(client, { warningThresholdMs: 200, skipStorageCheck: true });
console.log(report.status, report.summary);

Before you submit a game

  • Run the game in a real iframe inside the HydraOne web client.
  • Open it in Safari and confirm a reload keeps the player signed in (see Safari ITP and host storage).
  • Reject a signature in the wallet and confirm the UI recovers from the cancelled request.
  • Run checkBridgeHealth against the real host and fix every FAIL.