Quick Start

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

  1. Install NVM
  2. Install Node
  3. Install the Freshworks 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
Install NVM

Node Version Manager (NVM) enables you to install and work with multiple versions of Node.js. You can use NVM to install Node.

  1. To install NVM:
    1. On Mac or Linux, follow the installation and upgrade steps.
    2. 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

To install Node.js, follow the given steps.

  1. To install Node using NVM, run the following command. $ nvm install 12.22

    Note: With the latest FDK version, support for building apps on earlier versions of Node.js is unavailable.

  2. Run the following command to verify the Node installation. $ node --version

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

  3. Run the following command to set the default Node version. $ nvm alias default 12.22
  4. On Windows, to install the tools and configurations required to start using Node, use the following command. $ npm install --global --production windows-build-tools For more information, see the write-up on node-gyp.
Install the Freshworks CLI
Notes:
  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 CLI.
  1. Run the following command to install the latest CLI version.
  2. Copied Copy
    1
    npm install https://dl.freshdev.io/cli/fdk.tgz -g
  3. Run the following command to verify the CLI installation.
  4. Copied Copy
    1
    fdk version
Create an App

You can use the following steps to create an app that displays a sample text and requester’s name in the right sidebar on the Ticket Details page.

  1. From the command line, navigate to the empty directory in which you want to create an app.
  2. Run the following command: $ fdk create A prompt to choose a product is displayed
  3. Select freshdesk and press Enter. A prompt to choose a template is displayed.
  4. Select your_first_app. A new app is created based on the your_first_app template.

The following directories and files are created as a result of the fdk create command.

DIRECTORY/FILE DESCRIPTION
app/* Contains all the files required for the front-end component of an app. The JS file follows the ES5 standard.
app/index.html Contains files to render front-end components of an app. This is the first page that is loaded when the app is activated. When building an app, if the app uses Data methods, Request method, Installation Parameters, or Data Storage, update the index.html file with the following reference to fresh_client.js:
1
<script src="https://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>
app/scripts Contains all the javascript files required to support the front-end functionality of an app.
app/scripts/app.js Contains the app logic to display a sample text and requester’s name in the right sidebar on the Ticket Details page.
app/styles Contains the styles required for the front-end components of an app.
app/styles/styles.css Contains CSS rules that are incorporated to HTML files, when referenced.
app/styles/images Contains images that can be used in the app.
app/styles/images/icon.svg Contains the app icon. The icon file should be of SVG type with a resolution of 64 x 64 pixels.
config/* Contains the installation parameters and oauth configuration files.
config/iparams.json* Contains all the installation parameters whose values are set when the app is installed. For more information, see Installation Parameters.
manifest.json* Contains details such as the platform version the app uses, product to which the app belongs, event listeners for serverless apps, SMI functions that can be invoked from the app’s front end component, and npm packages (dependencies) that the app uses.
README.md Contains additional instructions, information, and code-related specifications pertaining to the app.

* When building an app, do not modify these file/folder names.

Note: 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.

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

Test the App
Notes:
  • To test your app, use the latest version of Chrome.
  • Ensure that you sign up for a Freshdesk account.
  1. From the command line, navigate to the directory that contains the app related files and run the following command. $ fdk run
  2. Log in to your Freshdesk account.
  3. To the Freshdesk account URL, append ?dev=true. Example URL: https://subdomain.freshdesk.com/helpdesk/tickets/1?dev=true
  4. To allow the Chrome browser to connect to the test server that runs on HTTP,
    1. On Chrome 79 and higher versions:
      1. Navigate to Settings -> Advanced -> Privacy and security -> Site settings -> Insecure content.
      2. In the Allow section, click Add and enter the Freshdesk account URL. Example URL: https://subdomain.freshdesk.com
    2. On Chrome 78 and lower versions:
      1. In the address bar, if a shield icon is displayed, click the icon. A warning message is displayed as the Support portal runs on HTTPS and the test server runs on HTTP.
      2. Click Load Unsafe Scripts to continue testing.
  5. On the Home page, from the left global sidebar, select Tickets and click any ticket. The app is rendered on the right side of the page.
  6. Note:
    1. Each component in the coverage summary should be at least 80% for apps to be submitted in Freshworks Marketplace. See Code coverage for more information.
    2. If you have any issues when testing your app, attach detailed logs of the output in your support ticket for quick resolution from the support team.

Validate and Pack

To check if the app is error-free and package it for submission, follow the given steps.

  1. To validate the code, run the following command. $ fdk validate [--app-dir DIR]

    Here, DIR is the relative or absolute path to the project directory. If there are errors in the code, corresponding violations are displayed. To auto-fix certain errors and display only those that need manual fixing, use the $fdk validate --fix command. Ensure to fix all violations before packing the app.

  2. To pack the app for submission, run the following command. $ fdk pack [--app-dir DIR] The command generates the dist/my_first_app.zip file.
  3. To publish the app to the Freshworks Marketplace, navigate to the Freshdesk developer portal and upload the packed file. For information on the app submission process, see Types of Apps.