+ Start a Discussion
ethanoneethanone 

Basic Lightning Out example

I'm trying to create a proof of concept of a lightning component running in a lightning out page not on the SFDC platform. I've got a basic component called test.cmp:
<aura:component
  implements="flexipage:availableForRecordHome, force:hasRecordId"
>
  <aura:attribute name="recordId" type="String" />
  <lightning:card title="Display, Create, or Edit Records">
    <lightning:recordForm
      recordId="{!v.recordId}"
      objectApiName="Account"
      fields="Name"
    />
  </lightning:card>
</aura:component>
A basic lightning app called ltngOutTest.app:
<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="c:test" />
</aura:application>
and web page on my server called ltngOut2.html:
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">

  <title>Lightning Out Example</title>

</head>

<body>
    <script src="https:/myDomain.my.salesforce.com/lightning/lightning.out.js"></script>
    
    <div id="cmpGoesHere"/>
    
    <script>
    $Lightning.use("c:ltngOutTest",    // name of the Lightning app
        function() {                  // Callback once framework and app loaded
            $Lightning.createComponent(
                "c:test", // top-level component of your app
                { },                  // attributes to set on the component when created
                "cmpGoesHere",   // the DOM location to insert the component
                function(cmp) {
                    // callback when component is created and active on the page
                }
            );
        },
        'https://myDomain.lightning.force.com.lightning.force.com/'
    );
</script>
</body>
</html>
I think I'm missing the OAuth component, but I don't know how to include it. What else am I missing?
Thanks in advance.