Best practice to detect logout from identity provider?

I looked how Keycloak JavaScript Adapter uses RP IFrame. It basically relies on the fact that another page in the application does a logout from Keycloak and this changes the value of document.cookie and that’s how PR frame detects the change. That exactly what it means that PR frame detects session state change on local logouts only.

In case if the session state changes remotely on Keycloak server by means of SingleLogout from Identity provider, then PR IFRAME approach does not work.

I implemented a similar approach where instead of polling document.cookie, an PR IFRAME checks OIDC session status on Keycloak server by calling ODIC authorize endpoint and passing prompt=none. The approach works fine but I’d like to avoid polling completely, if possible.

Any advice would be appreciated.