In this blog, I am going to explain Heroku and node js canvas integration. Canvas allows you to integrate web applications with Salesforce in the different places of salesforce like Chatter Tab, Visualforce Page, Lightning Component, Publisher, Chatter Feed, Console, Open CTI, Mobile Navigation, Layouts, and Mobile Cards. In this post, I am going to show the simple table that contains the product master data which is a simple HTML table. Prerequisites
Git installed on your local machine
Heroku toolbelt installed.
Node.js installed on your local machine
Creating Connected App
In order to integrate the salesforce with Heroku application, you need to create the configure the salesforce connected app as shown.
Setup -> Create -> Apps -> Connected Apps-> New
Fill Connected App Name, API Name, and Contact Email as shown in the image
Check the Enable OAuth Settings in the API (Enable OAuth Settings) section
Locations: choose Chatter Tab and publisher as of now. but you can select one or more based on the where you want to show this the canvas on salesforce.
Now finally connected App is looking as shown below.
Now you need to enable the app for the profiles or users. To do this,
Click on the Manage on the connected App which you created in above .click edit policies
In the OAuth policies select Admin approved users are pre-authorized for the Permitted Users field and save it
In the Profiles related list add the profiles or permission set which you wanted to grant access
Building Your App on Node Js
Let’s set up the basic app structure. We will use Express to set up a basic Node application. Here is the below package.json file which we will use to build the node js application. The application folder structure is shown below.