To develop and run Salesforce Functions, you'll need a Salesforce org configured to work with Salesforce Functions, along with some local development tools on your development workstation.
Install Local Functions Tools
If you're using a local development workstation, use the following information to set up your local machine.
Before you start working with Salesforce Functions, you'll need:
- An operating system supported by Salesforce CLI: Windows 10 64bit or later, MacOS 10.11 or later, or Ubuntu 14.0.4 or later.
- OpenJDK 8 or better and Apache Maven 3.6.3 or better for developing Functions that will use Java.
- Salesforce CLI installed and updated. See Install the Salesforce CLI for more information. Note that you'll need to install npm to install the CLI, if you didn't already install Node.js.
- Docker Desktop for building and running Functions locally.
- (Optional) VS Code and the Salesforce VS Code extension installed, if you want to develop and debug your Function in VS Code. See Install Salesforce Extensions for VS Code. If you plan on developing Java Functions using VS Code you'll want to install the Java Extension Pack for VS Code.
- Git CLI or GUI client and (optionally) a github.com account, needed for tracking changes in your Function code. See Set up Git for more details.
- (Optional) If you need to save Function log output to a log drain, you'll need to set up a log drain receiver or sign up with a service that can accept log drains. See Function Logging for examples of 3rd party services that support log drains.
Install the Salesforce Functions SFDX Plugin
Install or update to the latest version of the SFDX plugin. Confirm "y" on being prompted for unsigned plugin and then install the Salesforce Functions plugin:
Confirm you have the version 7.102 or later of SFDX and version 0.1.5 or later of the Salesforce Functions plugin using the following commands:
If you encounter an error while trying to install the Salesforce Functions plugin, it might be because your corporate network is blocking Salesforce hosts from installing or updating the CLI. Contact your IT department to add the
https://s3.amazonaws.com/heroku-fn-devex-staging/* domain to your approved domain list. See Use the Salesforce CLI from Behind a Company Firewall or Web Proxy for more information.
If Node is not installed on your local development system, please follow the directions from the Node.js documentation to install it: https://nodejs.org/en/download/
It’s recommended to use the latest active version of Node. To check the version of Node you have installed use
node -v, for example:
Salesforce recommends to use 12 or higher. A package manager, npm, is also installed by default with Node. Confirm that latest version is installed:
Salesforce recommends using 6.13.4 or higher.
Install the Salesforce SDK For Node.js Functions
Install the Salesforce SDK for Java Functions
Java Functions will automatically install the SDK during builds if the Maven pom.xml file includes the SDK as a dependency. If you need to install the SDK manually, you can download the jar file from Maven central:
Configure Your Salesforce Org
When developing or validating Functions, you'll need a Salesforce org configured to invoke your Function. You'll need:
- Developer Edition (or better) org with Dev Hub enabled. For beta, Dev Hub orgs set up for Salesforce Functions development will be provided.
- A Salesforce Functions account. For beta, Salesforce Functions accounts will be provided using the same login credentials as the provided Dev Hub orgs.
- Connection established between the Dev Hub org and the Salesforce Functions account. For details see Configure Orgs for Functions and Getting Started with Salesforce Functions: Set Up Your Developer Hub