Node.js Salesforce Lightning Ou

by tiaanswart



A barebones Node.js app using Express 4.

This application is to demonstrate the Salesforce Lightning Out feature.

Checkout the Salesforce repo: SF Lightning Out

Pre-deployment steps

  1. Make sure you follow the Post Deployment steps from SF Lightning Out
  2. Use the Community URL you copied and replace the Community URL in: views/partials/header.ejs
  3. Replace the Community URL with you Community URL views/partials/lightning-out.ejs

Post-deployment steps

  1. Make sure you add the Heroku URL to SF CORS Setup -> CORS -> New
  2. Make sure you add the Heroku URL to SF CSP Trusted Sites Setup -> CSP Trusted Sites -> New Trusted Site

Running Locally

Make sure you have Node.js and the Heroku CLI installed.

$ git clone # or clone your own fork
$ cd lighnting-out-heroku
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open


Deploy to Heroku


CORS must be enabled in Salesforce as well as the Node.js app, best to develop in Safari with CORS disabled


For more information about Salesforce Lightning Out, see these articles: