How does data persist on freshworks developer platform?

Hello,

we face a problem when using data storage (in dev mode) the data is not anymore available after page refresh ?
is it a normal behaviour ? how to make the data persistent ?

here is the code used to save it

this.client.db.set(`rocketUser:${this.loggedInUser.id}`, rocketDdata).then(
            function(data) {
              this.$emit('success', true)
            }.bind(this),
            function(error) {
              throw new Error(error)
            });

Thanks for the help

1 Like

this is completely dependent on how this is accessed or called. Since I do not have access to a broader code context, I may not answer your question accurately.

But broadly, I understand your question as to How do I persist my data? How does it usually work?

client.db.set(`rocketUser: ${loggedInUser.id}`, rocketData).then(function success(..){}, function failure(..){});
  1. Above line will store the data in the .fdk/localstore file in local simulation, likewise stored within the developer platform in production.
  2. Once the data stored, the page refresh will not affect it. Thus persisted.
client.db.get(`rocketUser: ${loggedInUser.id}`).then(function fetched(data){
   console.log(data); // rocketData
}, function failure(){});

We recently wrote a tutorial hope it might be helpful - Introduction to Data Storage and Request Method..
(*The app in the tutorial is in :freshdesk: But the platform is the same at the convenience of developers for any host Freshworks product.)

Documentation is handy anyway - Data Storage.

Sample apps - marketplace-sample-apps/Freshworks-Samples/App-Development-Features/Advanced-Features/data_storage at master · freshworks/marketplace-sample-apps · GitHub

Kudos on your first post in this community! Welcome! :tada:

4 Likes

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.