Implementing App Install and Update Events

We are currently implementing app install and app update events in our application. We are encountering an issue where the function that is supposed to run during app install is not being called, while other parts of the app appear to be working correctly. We have verified our manifest and function definitions, but the install function still doesn’t execute as expected.

manifest.txt (573 Bytes)

server_js.txt (209 Bytes)

We would greatly appreciate any guidance or documentation that could help us properly handle app installation or update events and resolve these issues.

Hi @anchal

Can you try this code below and let me know?

exports = {
 onAppInstallCallback: function(payload) {
   console.log("Logging arguments from onAppInstallevent: " + JSON.stringify(payload));
   // If the setup is successful
   renderData();
  },
 onAppUninstall: function () {
      console.log("App uninstalled!");
      renderData();
    }
}

@Kithiyon Thanks so much for the help!

I tried using the code snippet, but when I run it, I’m getting this error:

index.88d83a6c.js:11 GET http://localhost:10001/apps/customApps?product=freshworks_crm net::ERR_CONNECTION_REFUSED

It looks like the app is trying to load resources from localhost.
How can I change this to use my server’s IP or domain instead of localhost?

Hi @anchal

Why do you want to test the app using your IP? If you’re running a Freshworks app locally using fdk run, it will run on a local server. This is the expected behavior. Could you please share more details about your use case so that I can help you better?