The SDK is a collection of developer tools that will make it easier for you to build, test and publish apps on the Freshdesk Marketplace. You will need to have basic knowledge of the following to build an app:
1. You will need to install Node.js to use the SDK. You can install it from here. Any version below 6.10 will not be supported.
2. By installing and using the SDK, you agree to these Terms and Conditions.
In your terminal (Mac/UNIX), run the following command to install the SDK:
If you are using command prompt (Windows), run this command to install the SDK: Copied Copy1
sudo npm install http://dl.freshdev.io/sdk/frsh-sdk-3.1.0.tgz -g
The -g command option ensures that your installation is global. With a global installation, you will be able to call commands and work on your Apps and SDK from anywhere within your machine.1
npm install http://dl.freshdev.io/sdk/frsh-sdk-3.1.0.tgz -g
- Install this Chrome browser extension to enable local testing abilities in your browser.
- Initialize a new App Project with the command $ frsh init <project-folder-name>
Understanding frshThe frsh command will be available for use as soon as you install the SDK. The format of frsh is $ frsh [global_options] <command> [command_options] [parameters]
CommandsThe commands available for frsh are:
- init: Lets you create a new project. You can call this by executing $ frsh init <project-folder-name>
- info: Displays information about the project. While within the project folder, you execute this command $ frsh info
- run: To local test your app, run this command within your project folder $ frsh run
- validate: Will run validation checks on your project and inform you of any errors before you submit your app to the Marketplace $ frsh validate
- pack: Will package your build into a .zip file that you can submit to the Freshdesk Marketplace for review and publication $ frsh pack
- clean: Removes the /dist and /work dirs $ frsh clean
- version: Prints the version of the SDK $ frsh version
help: Provides more information based on how it is used
$ frsh help //Will print all commands
$ frsh help init //Will print syntax and information about the init command
The frsh command supports three global options
- -v for verbose output
- -x for stack trace
- -h for help
The frsh command is designed on the UNIX philosophy of not being verbose by default. For example, to create a new project called "myprj" you will have to run $ frsh init myprj
However, executing that command will not give you any feedback. The silent exit with status 0 indicates that the command succeeded. If you desire explicit feedback, you will have to execute the command with the -v global option. So the verbose version of the above command will be $ frsh -v init myprj
The frsh command accepts the global option -x for printing exception stack trace. On failures, when -x is supplied, the command also writes the stack trace of the exception to the STDERR.
Displays the help text for the command.