Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  How to implement keep-alive detection (browser close / connectivity loss) in custom Genesys SDK + WebRTC SDK integration

    Posted 09-02-2025 16:12

    Hi everyone,

    We have a fully custom integration built with the Genesys SDK and WebRTC SDK. The implementation is working, but we need to add a keep-alive mechanism similar to what Genesys Desktop and the Embeddable Framework provide.

    Specifically, we want to:

    • Detect when the agent closes the browser or loses connectivity.

    • Automatically move the agent to Offline in those cases.

    Is there any WebSocket, API, or supported method we can leverage to handle this keep-alive functionality?

    Any guidance or best practices would be greatly appreciated.

    Thanks in advance!


    #CXasCode
    #Integrations
    #PlatformSDK

    ------------------------------
    Rogelio Gutierrez
    N/A
    ------------------------------


  • 2.  RE: How to implement keep-alive detection (browser close / connectivity loss) in custom Genesys SDK + WebRTC SDK integration

    Posted 09-26-2025 08:41

    We've implemented a custom keep-alive mechanism in our app to detect whether an agent is still logged in. If the app determines that the agent is no longer active, their status is automatically set to offline.



    ------------------------------
    Rogelio Gutierrez
    Software Engineer
    IHG ® Hotels & Resorts
    ------------------------------



  • 3.  RE: How to implement keep-alive detection (browser close / connectivity loss) in custom Genesys SDK + WebRTC SDK integration

    Posted 09-29-2025 11:56

    Rogelio, could you please share how you did it?

    Best regards, Edward.



    ------------------------------
    Edward Enrique Herrera
    Chief Support Leader
    ------------------------------



  • 4.  RE: How to implement keep-alive detection (browser close / connectivity loss) in custom Genesys SDK + WebRTC SDK integration

    Posted 09-29-2025 15:29

    Hi Enrique,

    Sure! At a high level, we implemented a server-side solution. Our application sends a ping every minute, and we update the corresponding user record in AWS DynamoDB with the latest timestamp. In parallel, a scheduler runs every three minutes to check for records older than four minutes. If such records are found, it indicates that the agent closed the application. In that case, the scheduler updates the agent's status to offline by calling the Genesys API (PATCH /api/v2/users/{userId}/presences/purecloud) with the offline presence ID.

    Times can be adjusted based on your specific needs.

    Let me know if you have any questions.



    ------------------------------
    Rogelio Gutierrez
    Software Engineer
    IHG ® Hotels & Resorts
    ------------------------------



  • 5.  RE: How to implement keep-alive detection (browser close / connectivity loss) in custom Genesys SDK + WebRTC SDK integration

    Posted 09-29-2025 17:14

    Thank you Rogelio.



    ------------------------------
    Edward Enrique Herrera
    Chief Support Leader
    ------------------------------