salesforce-ibm-verse
This example application showcases how to use Salesforce Lightning in combination with the IBM Verse Extensibility API.
The IBM Verse Extensibility API gives access to the context of a selected mail (read or new mode) or a persons details. You'll find the documentation of the available capabilities in the vendors documentation.
The code in this repo and the linked resources showcase how you can leverage the capabilities i. e. to log existing emails from Verse as an activity to a Salesforce Account objects.
This image showcases the setup:
![](resources/verse_integration.png)The IBM Verse application sends a JSON object of the mail data to a node.js app running on Heroku. The node.js app is also the host for a Salesforce Lightning Out application. The sent JSON object gets passed to the Lightning Out component which then logs the email to a selected Account object.
Checkout this video to see how the integration works and how it has been built.
Live application
You can find the application on https://salesforce-ibm-verse.herokuapp.com/verse. For using it you'll need an existing Salesforce account (i. e. a Developer Edition) with the below mentioned pre-requisites.
Run-On-Your-Own
Prerequisites
For running the app on your own you'll need to fulfill the following requirements:
- Access to a Salesforce org, i. e. a Developer Edition (You can signup here for free if you don't have one).
- A Connected App set up in the Salesforce Org.
- A CORS definition for the remote HTML application.
For local development I highly recommend to install the Heroku Toolbelt.
Components
The project consists out of three components:
- The node.js app (using EJS)
- The Verse Extension configuration
- A Lightning Out app with Apex backend classes
For your convenience you can install them via this unmanaged package into your Salesforce organization.
Automatic deployment to Heroku
The easiest way to test the application on your own is deploying it to Heroku via the Deploy button.
After the deployment you've to enter in the Heroku UI your Connected App's clientId and clientSecret for the OAuth2 authentication process and also the host URL for the IBM Verse server.
Local development
Clone this repo.
git clone https://github.com/muenzpraeger/salesforce-ibm-verse
Create in the root of the project a file .env as described here for storing the Heroku environment variables.
Then add the following key/value pairs to the .env file.
OAUTH_CONSUMER_KEY=your-key-from-salesforce
OAUTH_CONSUMER_SECRET=your-secret-from-salesforce
VERSE_SOURCE_SERVER=your-verse-server-dns-name
The OAUTH_xxx parameters are for used for storing the Connected App OAuth keys. The VERSE_SOURCE_SERVER parameter is used within the node.js app to prevent cross-site-scripting from other sites, so set it to the DNS name of your Verse server.
Now start the app via the Heroku Toolbelt.
heroku local web
Development
If you want to develop with this code you can do it with any text editor of your choice. ;-)
License
For licensing see the included license file.