Skip to content

rygramer/embedFlowInExternalWebsite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Embed a Flow in an External Website

In order to embed a Flow in an external website (like Wordpress), you have to:

  1. create an Aura Component;
  2. create an Aura App; and
  3. add a few lines of code to your website.

You can use this sfdx project as a base configuration, you'll just need to make one small to the code to make it yours. In the embedFlowInExternalWebsite.cmp file of the Aura component, add YOUR_FLOW_API_NAME.

({
    init : function (component) {
        var flow = component.find("flowData");
        flow.startFlow("YOUR_FLOW_API_NAME");
    }
})

Here's the code for you to copy and paste into your website. Be sure to replace YOUR-SALESFORCE-SITE-URL; it should be something like https://xxx.na163.force.com/.

<script src="https://YOUR-SALESFORCE-SITE-URL.com/lightning/lightning.out.js"></script>

<div id="lightningLocator"></div>

<script>
    $Lightning.use("c:embedFlowInExternalWebsiteApp",
        function() {
            $Lightning.createComponent(
                "c:embedFlowInExternalWebsite",
                { },                  
                "lightningLocator",   
                function(cmp) {}
            );
        },
        'https://YOUR-SALESFORCE-SITE-URL.com'  // Site endpoint
    );
</script>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages