Product events are events such as creating a contact, updating a contact, creating a deal, and so on, that occur in the product on which your app is deployed. You can enable product events to trigger your app, call a corresponding callback function, and execute the app logic.
To do this,
- From your app’s root directory, navigate to the manifest.json file. 
- Subscribe to an event by configuring an event listener: Include the events attribute, specifying the product-event's name and the corresponding callback methods as follows: manifest.json- "events": { "<productEventName>": { "handler": "<eventCallbackMethod>" } }- When the event occurs, the corresponding event listener invokes the callback method and passes a standard payload to the method. 
- Navigate to the server.js file. In the exports block, enter the callback function definition as follows: Sample server.js- exports = { // args is a JSON block containing the payload information // args["iparam"] will contain the installation parameter values //eventCallbackMethod is the call-back function name specified in manifest.json eventCallbackMethod: function(args) { console.log("Logging arguments from the event: " + JSON.stringify(payload)); }};
- The serverless component of the app is executed in a sandbox mode where some methods, such as setTimeout and setInterval, cannot be used.
- The default app execution timeout is 20 seconds. If the request timeout is increased to 20, 25, or 30 seconds, the app execution timeout is extended to 40 seconds.
- The payload passed to the severless component should not exceed 256 KB.
- To know all the platform restrictions and constraints, see Rate limits and constraints.
- Avoid using symbols, such as arrows, in the code when defining the event, as they may cause errors.
Payload attributes
When a product event occurs, an event-specific payload is passed to the callback method.
The payload is a JSON object with the following attributes.
- app_settingsobjectInformation pertaining to the app settings as a JSON object of key-value pairs. 
 If your app does not use the app settings functionality, an empty JSON object is returned.
- account_idstringIdentifier of the Freshsales Classic account, auto-generated when the account is configured for an organization. 
- dataobjectEvent-specific Freshsales Classic data, specified as a JSON object of key:value pairs. 
- domainstringDomain name for the Freshsales Classic account. 
- eventstringName of the Freshsales Classic event. 
- iparamsobjectInstallation parameters specified as a JSON object of <parameter name>: <parameter value> pairs. 
- productContextobjectProduct context of the product for which the app is installed. 
- regionstringRegion where the Freshsales Classic account is deployed. Possible values: US, EUC, AUS, IND, and MEC. 
- timestampnumberTimestamp of when the product event occurs, specified in the epoch format.