I'm trying to replicate the Twitter connector app with React. Although react apps don't have session variables, so I wonder how to overcome this challenge.

Hi,

You could use client variables as a replacement for session variables.

Alternatively you could create a local entity to store session data in.

Regards,

Daniel

Thanks, Daniël Kuhlmann,

I guess I need some guided path to know exactly how to do what you suggest. Hopefully will get a new tutorial.


Regards,
Carlos

Solution

Hi Cpinho,

Not really knowing what you plan is on how to make a reactive version of the Twillo connector, but mostlikely you end up with client actions which run locally in the browser as oposed to server actions which run on the server.

For server actions session variables make sense, as they 'life' on the server.

Client variables are the counter part of session variables and 'life' in your browser's session storage.

You can define them on the Data tab under client variables.

So suppose you have a session variable session.MyVariable

Then you can create a client variable with the same name which is accessibly as Client.MyVariable and use it in client actions.

Regards,

Daniel

Solution

Thanks Daniël Kuhlmann!

I'm aware of the difference of the client variables in Reactive apps and Session variables on the Traditional Web apps.

My doubts are more triggered by my lack of experience. For instance, I'm unable to get the structure under the client variable.

Hi,

Client variables only support basic types and entity Identifiers.

If you need to store a structure you could do the following:

  1. define data type of client variable text
  2. Use JSONSerialize prior to updating client variable
  3. Use JSONDeserialize when reading client variable

Alternatively you could make every attribute of a structure as a client variable, this would of cours only work if the structure does not contain list attributes.

Regards,

Daniel