lightning-out-components-for-the-rest-of-the-world

Most of the Salesforce Developers have a question regarding the Lightning Custom Application that how they can use the salesforce custom app out of the Salesforce community. Actually, I also got the same problem while developing custom application in the Salesforce, where I found the way to use this lightning app out of the community of the Salesforce. I did a lot of research to crack this problem because I don’t want to develop the same application again which I already have developed in the Salesforce previously.As you all know the time is money and no one in this world would want to waste the money for developing the same app with same functionalities again and again.

I unlocked the Smart way to use the same lightning custom app which we developed under salesforce community to use it outside of Salesforce platform. After research and many experiments, I came to know that we can make it possible by using Heroku Server and lightning out script. We can host our lightning custom app on the Heroku platform with help of the lightning out Script. I used that custom app on the platform of Node.js but if you don’t have a Node.js it doesn’t mean that you cannot use the custom application and I am 100% sure it would also work with other platforms but for Node.js platforms it has many benefits because it is a server side language which is used for the compiling purpose to operate custom app on the Heroku server. The app which we want to use out of the salesforce it’s just like the clone of the same lightning custom app which we already developed under the community of the Salesforce because the whole backend process will be automatically taken from the Salesforce community where we developed the custom Application.

Also, there are also some benefits for using Custom Lightning App out of the salesforce platforms

1.It is secure because as already mentioned above the whole process will be taken under the Salesforce platform which makes it Secure from any piracy.

2.When we are able to use it outside the platform due to Node.Js its speed becomes twice faster than the original developed Lightning Custom App under the Salesforce.

  1. We don’t need to use REST API as it is based on the Javascript.
  2. By this criteria, you are able to use one application several time for further development

By using following lightning out Script you are able to host any Salesforce custom Application on heroku Server for Node.Js platform.

<script src=”/lightning/lightning.out.js” type=”text/javascript”></script>

<script>

$Lightning.use(“namespace:app name”, function() {$Lightning.createComponent(“namespace:component name”,

{ label : “Shopping Cart” },

“lightning”,

function(cmp) {

document.getElementsByClassName(“img1”)[0].style.display = “none”;

});

});

</script>

This is the Script which is very helpful for all the salesforce developer who want to use their Salesforce Lightning Custom App outside the salesforce.

Feedback