An interface that needs to be implemented by Client application. It provides definitions for the event handlers which are invoked when the JWT is about to expire or has expired respectively.

interface JwtProvider {
    onExpire: (() => unknown);
    onExpireWarning: ((remainingTime: number) => unknown);
}

Properties

onExpire: (() => unknown)

This method will be invoked to notify that the JWT has expired and the services provided by Omni SDK have been disrupted. When invoked, fetch a new JWT and immediately set it in Omni SDK to resume its services.

onExpireWarning: ((remainingTime: number) => unknown)

This method will be invoked to notify that the JWT is about to expire. It provides the remaining time before expiration. The implementations should ideally use this time to fetch a new JWT and set it in the Omni SDK to maintain a seamless user experience.

Type declaration

    • (remainingTime): unknown
    • Parameters

      • remainingTime: number

        The remaining time in milliseconds before the JWT expires.

      Returns unknown