1

I have an FSL scheduling flow that is on a public community page, and am trying to expose it on an external site via lightning out (https://help.salesforce.com/articleView?id=ls_expose_flow_on_website.htm&type=5). I followed the instructions laid out for the unauthenticated guest user, and am running into a cross-origin read blocking issue. CORS has been set up, and not sure how to get around. Any help would be appreciated. Below is copy of super basic HTML with the noted scripts that SF has you insert.

<script src="https://communitydomain.force.com/s/lightning/lightning.out.js"></script>

<head>
    <title> </title>
</head>
<body>
    BOOKINGS 123456
    <div id="lightningLocator">
        
    </div>
</body>

 <script>
    $Lightning.use("runtime_appointmentbooking:lightningOutGuest",
        function() {                  // Callback once framework and app load
            $Lightning.createComponent(
                "lightning:flow",    // top-level component of your app
                { },    // attributes to set on the component when created
                "lightningLocator",    // the DOM location to insert the component
                function(component) {            // API name of the Flow
                    component.startFlow("Lightning_Scheduler_Unauthenticated");
                }
            );
        },    'https://communitydomain.force.com/s/'  // Community endpoint
    );

enter image description here

2
  • Hi and welcome to SFSE. It is always better to include code as text, not as screenshots. It is easy to include code text using the markdown formatting available. Take a look at the editor help (when editing your question there's a "?" in a circle at the top right). Using screenshots means community users are less likely to bother with your question because they cannot read the text as well and certainly cannot copy/paste it if required. Please edit your question and update it accordingly. Ta.
    – Phil W
    Dec 1 '20 at 19:10
  • Thanks @PhilW for the feedback. I've updated with a code block as well. I want to keep the screenshot for error purposes. Dec 1 '20 at 22:05
1

Some combination of jumping into the community and setting it public, and removing the 's/' from the community URLs seemed to have fixed the issue. Lightning out is coming through ok, and am able to use '$Lightning'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.