Skip to content

Instantly share code, notes, and snippets.

@gbutt
Created March 17, 2020 00:05
Show Gist options
  • Save gbutt/b533c9e3b8cb4fe22c32643656443436 to your computer and use it in GitHub Desktop.
Save gbutt/b533c9e3b8cb4fe22c32643656443436 to your computer and use it in GitHub Desktop.
Lightning Out with Guest User Access
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta content="initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0, minimal-ui" name="viewport" />
<title>Events Calendar</title>
<script src="https://yoursite.force.com/lightning/lightning.out.js"></script>
<style>
/* hide aura error messages */
#auraErrorMessage {
display: none;
}
#calendar {
margin: auto;
width: 95%;
max-width: 1024px;
}
</style>
</head>
<body>
<div id="calendar" />
<script>
var lightningEndPointURI = 'https://yoursite.force.com';
// https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_markup.htm
$Lightning.use('c:LightningOutApp', function () {
$Lightning.createComponent('c:EventsCalendar', {}, 'calendar');
}, lightningEndPointURI);
</script>
</body>
</html>
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
<aura:dependency resource="c:EventsCalendar" />
</aura:application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment