-
Notifications
You must be signed in to change notification settings - Fork 0
/
advance_landing_page.html
35 lines (32 loc) · 1.27 KB
/
advance_landing_page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<body>
<script>
// Surfly snippet
(function(s,u,r,f,l,y){s[f]=s[f]||{init:function(){s[f].q=arguments}};
l=u.createElement(r);y=u.getElementsByTagName(r)[0];l.async=1;
l.src='https://surfly.com/surfly.js';y.parentNode.insertBefore(l,y);})
(window,document,'script','Surfly');
// The preferred way is to set session options from the Surfly web interface,
// so in most cases you only need to provide a widget key below,
// but you can also override any options here
var settings = {
widget_key: "513065a5492743e6a6340aec09b7e4d1",
hide_until_agent_joins: true,
url: "https://www.surfly.com"
};
// Surfly.init() must be called before any other API call
Surfly.init(settings, function(init) {
if (init.success && !Surfly.isInsideSession) {
Surfly.session()
.on("session_created", function(session, event) {
// display the PIN of the current session
document.querySelector("#sessidtarget").innerText = session.pin;
})
.startLeader();
}
});
</script>
<h1>Landing Page Example</h1>
Session Code: <span id="sessidtarget">...</span>
</body>
</html>