JavaScript and TypeScript Functions

If you're developing your Function using JavaScript or TypeScript, here are some considerations to keep in mind.

Use the Salesforce SDK for Node.js Functions

Salesforce provides the Salesforce SDK for Node.js Functions specifically for Functions written in JavaScript or TypeScript. This SDK provides classes to securely and efficiently access Salesforce org resources.

Full reference documentation for the Salesforce SDK for Node.js Functions is here: Salesforce SDK for Node.js Functions.

Environment Variables

Use the Salesforce CLI to set environment variables in your Functions compute environments, and then access them in your JavaScript Function code as regular system variables. See Environment Variables for more details.

Logging Considerations

A Logger instance is provided to JavaScript Functions at invoke-time. For more details on using this instance see Generate Log Information in Your Function Code.

Test Considerations