Quick Start

You can build a Freshteam app by using the following steps.

  1. Install NVM
  2. Install Node
  3. Install the CLI
  4. Create an App
  5. Test the App
  6. Validate and Pack

Apps built on the Freshworks platform are compatible with the latest and immediately preceding version of the following browsers.

  • Google Chrome
  • Firefox
  • Edge
  • Safari

Note: We do not support Internet Explorer.

Install NVM

We recommend that you use Node Version Manager (NVM) to install Node.js. NVM enables you to install and work with multiple versions of Node.

Note: To check if Node is installed on your computer, run the node --version command. Uninstall all Node versions on your computer and remove all the folders related to Node and Node Package Manager (npm).

  1. To install NVM:
    • On Mac or Linux, follow the installation and upgrade steps.
    • On Windows, navigate to the release channel > Assets, download the nvm-setup.zip file, extract the contents of the file, and use the installer in the extracted files.
  2. To verify the NVM installation, run the following command. $ nvm --version
Install Node
  1. To install Node, run the following command. $ nvm install 10.18
  2. To verify the Node installation, run the following command. $ node --version

    Note: On Windows, if the Node version is not displayed, run the nvm on command to enable NVM.

  3. To set the default Node version, run the following command. $ nvm alias default 10.18
  4. On Windows, to install the required tools and configurations to start using Node, run the following command. $ npm install --global --production windows-build-tools For more information, see the write-up on node-gyp.
Install the Freshworks CLI

Note:
1. Uninstall the previous CLI version by using the npm uninstall fdk -g command.
2. The Developer portal and SDK Terms of Use apply to the use of the Freshworks CLI.

To build, test, and publish apps in Freshworks Marketplace, you need to install the CLI.

  1. To install the CLI, run the following command.
  2. Copied Copy
    1
    npm install https://dl.freshdev.io/cli/fdk-6.0.1.tgz -g
  3. To verify the CLI installation, run the following command.
  4. $ fdk version
Create an App

Note: At present, you can create only serverless apps.

  1. From the command line, navigate to the empty directory in which you want to create an app.
  2. Run the fdk create command.
  3. From the displayed product list, select Freshteam and press Enter.

A new app is created based on the your_first_serverless_app template and the following app files are created in the directory.

DIRECTORY/FILE DESCRIPTION
config/ Contains the installation parameters and OAuth configuration files.
config/iparams.json Specifies all the installation parameters which you set when you install the app. For more information, see Installation Parameters.
server/lib/ Uses this folder to store library files which contain helper methods that you could use in your server.js file.
server/server.js Contains code which is executed on a Freshworks server every time a specific event occurs. The file also contains registration wherein callback methods bind themselves to specific events.
server/test_data/ To test a serverless app, you have to simulate events that trigger the app. When an event is simulated, a sample payload containing details about the corresponding event is sent to the registered callback. The files containing the payload are present in this folder.
manifest.json Contains details about the app and its characteristics.
README.md Contains additional instructions, information, and specifications.

For a detailed walkthrough of the app, see Code Walkthrough.

Note:
1. The iparam_test_data.json file has been deprecated. Before testing the app, navigate to http://localhost:10001/custom_configs and enter appropriate values for the configured installation parameters.
2. If you use React, Ember, Vue, or any other front-end framework, include the source files of your app in the src directory to ensure quick app reviews.

Test the App

Note: Use the latest version of Chrome browser.

You can test your app on your computer by simulating events, and you can test different scenarios by directly modifying the payload.

Note: As the testing is only a simulation of events, an actual event will not be recorded in the back end. If you need an actual record to be created, then it is recommended to publish your app as a custom app and test the operation manually.

To simulate events for testing, follow the given steps.

  1. From the command line, navigate to your project directory and run the following command. $ fdk run
  2. In the browser, enter the following URL to test the app: http://localhost:10001/web/test.
  3. Select the event that you want to simulate.
  4. Once you select an event, the corresponding event payload is displayed. Edit the values and then click Simulate. When you edit the payload, ensure that you adhere to the JSON format.

Validate and Pack
  1. To verify that the app is error free, navigate to the project folder and run the following command. $ fdk validate [--app-dir DIR] Here, DIR is the absolute or relative path to the project folder.
  2. To pack the project for submission, run the following command. $ fdk pack [--app-dir DIR] The command generates the dist/<app_directory>.zip file.
  3. To publish the app in Freshworks Marketplace, navigate to the Freshteam Developer portal and upload the packed file. For more information on the app submission process, see Types of Apps.