IBM Aspera JavaScript Library
    Preparing search index...

    Function registerStatusCallback

    • Register a callback for SDK lifecycle status changes. The callback fires immediately with the current status (if one exists) and again whenever the status changes.

      Status values:

      • INITIALIZING — The SDK is detecting a transfer client.
      • RUNNING — A transfer client is ready. Full functionality is available.
      • DEGRADED — The primary transfer client (IBM Aspera for desktop) was not detected, but HTTP Gateway is available as a fallback. This is only available if XXX...
      • FAILED — No transfer client could be reached. This could be because the user does not have a transfer client installed, it is not running, or in the case of HTTP Gateway, it was not reachable.
      • DISCONNECTED — The transfer client was previously running but lost connection. This is specific to IBM Aspera for desktop. For example, if the user quits the app this status will trigger.
      • OUTDATED — (Connect only) The Connect installation needs updating.
      • EXTENSION_INSTALL — (Connect only) The browser extension needs to be installed.

      For IBM Aspera for desktop, detection continues in the background after FAILED or DEGRADED. If the user launches the application later, the status transitions to RUNNING.

      Parameters

      • callback: (status: SdkStatus) => void

        callback function to receive status events

      Returns string

      ID representing the callback for deregistration purposes

      const id = registerStatusCallback(status => {
      if (status === 'RUNNING') {
      // Full functionality — enable all UI
      } else if (status === 'DEGRADED') {
      // Transfers work via HTTP Gateway
      } else if (status === 'FAILED') {
      // Nothing available — prompt user to install
      }
      });

      // Later, to stop listening:
      deregisterStatusCallback(id);