Live refresh with sockets with parameters

Hello everyone,

I would like to have a "parameter in the Live refresh with sockets"
Is there a way to have it? I tried with sockets, but the documentation only refer using socket.io with a chat.

Any tip?

For example, this server action has one parameter (home_id).

Screenshot 2025-04-08 at 18.45.42

Hi Otavio,

To refresh a Server Connect with a parameter, you need to use Emit function/step in the API. There are 3 parts to emit a message. I have listed these below with examples.

  1. SOCKET: Set up a socket with a parameter

  1. API: Use this socket in the Emit API step by selecting from the dropdown menu under Type and selecting the value for the parameter.

  1. FrontEnd:
  • Add Socket App Connect component on the page.
  • In the Socket Properties - click on the Dynamic Events -> Sockets -> Message
  • Click on the Inline Flow for the Message -> Action - Add a condition to check for the Socket parameter ($event.tenant_id as per the example) and add the Server Connect to refresh if that condition is met.
  • Multiple messages can be emitted for the same socket in different APIs if required.

Screenshot 2025-04-09 at 2.57.59 pm

2 Likes

many thanks @guptast !! Will give a try!! Have a good day! :smiley:

1 Like