I am in the process of designing my app from the ground up in lightning. Basically it would contain some html and css that displays data based on post or get api calls from its controllers to an external website. (my website that has the web app version)

I want to understand the difference between creating a connected app vs creating a lightning app? ( I want to create lightning components that have the lightning design system styling, so I can add it easily to lightning layouts). How will in each my back-end code connect to these salesforce lightning components?

I know if canvas app, and canvas app is definitely a way to do this. But how to do this without using canvas app ( and having all of our styling and everything in lightning itself )

1 Answer 1


Connected application is basically a mechanism to iframe your external application in a secure manner inside Salesforce, allowing you to securely post and get data from Salesforce into your application .

Essentially you do not build UI layer into Salesforce and instead your web app UI renders within Salesforce ui as an iframe .

Lightning components is a JavaScript framework that you use to build components which can be surfaced to users using the application builder.

For lightning components your application ui resides inside the platform.You have JavaScript controller associated with your component and that allows you to hook to Salesforce server side logic.For your use case of you we're to connect to your web app from lightning components ,you will need to expose a serve API that Salesforce server can call to .

You can make your canvas application look like SFDC by following SLDS design patterns and then use force:canvasApp tag to surface your application as lightning component so that it becomes available to the lightning application builder .

  • Thank you! So if I don't want to iframe into salesforce (which is what I currently do) and want to build all UI in salesforce, everything would be in the component, from the html, the css and the javascript. and in my backend from the web app, I will expose APIs so that I can call them from the components js controller. Right? The js will take the results of this API and pass to the front end to be displayed through the components html and css.
    – Danish
    Commented Jan 23, 2018 at 23:44
  • Also, is there any advantage of building a full lightning component ( from the html, css, js business logic all inside of salesforce ) over building a lightning component that just embeds a canvas app. ( the UI and API business logic is still outside of salesforce )
    – Danish
    Commented Jan 23, 2018 at 23:46
  • @Danish So you will need apex SFDC backend program to call your APIs .Lightning component will interact with apex and apex will call your api.The advantage of this approach is you get away with iframe Commented Jan 24, 2018 at 0:05
  • Lightning component embedding canvas is also like an iframe .You can certainly do it that way as well .Its just that it wont be a native salesforce application and you will need to set connected application and auth via the signed request Commented Jan 24, 2018 at 0:06
  • Okay, that makes sense. Firstly, Thank you Mohith for your quick responses. so with canvas I would need a connected app, thats the way I do it right now. I want to be native salesforce, which is why measuring the pro/ cons of staying this way with canvas embedded in lightning / be native salesforce and build logic in apex. And the advantage of this i can get away with iframe. So in this case, how will I connect with my backend ( since there is no signed request, refresh token etc authentication) ? (using apex)
    – Danish
    Commented Jan 24, 2018 at 0:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .