This basic application demonstrates how some of the fundamental features of the Could Elements platform can be used.
- If you don't have
node
andnpm
installed, do that first.
PROTIP:
node
version must be >=v4.0.0
Install the node dependencies.
# Navigate to this directory
$ cd intro-app
# Install all necessary npm packages:
$ npm install
- Create an https tunnel and point it to your localhost
Hint: Use ngrok.io
-
Create a Salesforce app per these instructions: https://developers.cloud-elements.com/docs/elements/salesforce/salesforce-endpoint-setup.html and write down the
clientId
andsecret
. Enter a redirect URI in the Salesforce app that has this structure: ngrokTunnel + "/callback" -
Create a Cloud Elements environment at cloudelements.io and retrieve the User and Org secrets
-
The app will run on localhost:3000 - if you use a different port, change it in your
.env
file or directly in theapp.js
. -
Add the ngrok tunnel and relevant Cloud Elements and SalesForce secrets and tokens to your .env file. Or add them directly to the application.
NGROK=https://12345xyz.ngrok.io
CE_USER_SECRET=your-secret-here
CE_ORG_SECRET=your-org-secret
SFDC_APP_KEY=your-sfdc-key
SFDC_APP_SECRET=your-sfdc-secret
PORT=3000
Leave the
sfdcToken
and theauthHeaderSFDC
blank. TIP: After adding your keys & secrets, add the.env
file to your.gitignore
file.
- Run the application
$ node app.js
-
Click the Salesforce icon to create an instance.
-
Create an organization level transformation for the SFDC instance and map it in the console. Name it commonContact and it should only have the fields firstname, lastname, and email (mapped to FirstName, LastName, and Email)
-
Enter a contact's first, last name, and email to create a contact from the app UI.
-
Enter a contact in the Salesforce account. Wait 2 minutes and then click on the "Get Contact" download button.