Set Up Your Development Environment

To develop and run Salesforce Functions, install development tools. The tools vary depending on the language you use.


To work with Salesforce Functions, install these tools:

  • Node.js 14 or higher to develop Functions that use JavaScript or TypeScript. Use npm version 6.13.4 or higher.
  • OpenJDK 8 or higher and Apache Maven 3.6.3 or higher to develop Functions that use Java.
  • Git CLI or GUI client to track changes in your Function code. See Set up Git.
  • (Optional) To push changes to GitHub, create a account.
  • (Optional) To save Function log output to a log drain, set up a log drain receiver or sign up with a service that can accept log drains. See Function Logging.

Install and Update Salesforce CLI

Salesforce CLI is a bundle of two executables: sf and sfdx.

The sf executable is designed to eventually work across all Salesforce clouds. It contains all the Salesforce Functions-related commands and a handful of Salesforce Platform commands.

The sfdx executable is focused on Salesforce Platform. For now, use both executables to create and deploy Salesforce Functions, as shown in the examples in this guide.

  1. To get both executables, install Salesforce CLI.

  2. Update to the latest version.

    Run this command even if you previously installed Salesforce CLI.

  3. Confirm you have Salesforce CLI version 7.121 or later.

    The output looks like this:

  4. Now switch to the sf executable to view a list of all its plug-ins, including the functions plug-in.

    The output looks like this:

Use the Salesforce SDK for Node.js or Java Functions

To develop a Function using TypeScript or Java, you need the Salesforce SDK.

When you generate a function with sf generate function, these dependencies appear in the example code.

See Salesforce SDK for Node.js Functions for more on using Node.js.

See Salesforce SDK for Java Functions for more on using Java.

Install Salesforce Extensions for Visual Studio Code

If you use Visual Studio Code, install Salesforce Extensions for Visual Studio Code, which includes support for working with Salesforce Functions using the Command Palette.

To install, browse for the extension within Visual Studio Code, or go to Salesforce Extensions for Visual Studio Code and click Install the Salesforce Extensions.