Creating a Lightning Out application 

To create a Lightning Out application, the page will need a little JavaScript code, as shown here:

<script>    $Lightning.use("c:youtubesearchOutApp", // name of the Lightning Out app        function() { // Callback once framework and app loaded            $Lightning.createComponent(                "c:youtubesearch", // top-level component of your app                { }, // attributes to set on the component when created                "LightningLocator", // the DOM location to insert the component                function(cmp) {                    // callback when component is created and active on the page                }            );        },        'https://<myDomain>.Lightning.force.com/' ,// endpoint         accessToken // access Token by authenticating to Salesforce    );</script>

The HTML page will need the following JavaScript script tag ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.