Skip to content

Commit aee1e2b

Browse files
authored
VAP10-28: Adding reo.dev on docs
1 parent 2b9059f commit aee1e2b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

fern/custom.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const WIDGET_SCRIPT_URL = isLocalhost
66
: 'https://docs-widget.vercel.app/widget.js';
77

88
const HOCKEYSTACK_API_KEY = '96e358f635f3f5ea7fda26023b10da';
9+
const REO_CLIENT_ID = '0dc28e3fda800b9';
910

1011
function injectVapiWidget() {
1112
console.log('[custom.js] injectVapiWidget called');
@@ -51,8 +52,27 @@ function initializeHockeyStack() {
5152
document.getElementsByTagName('head')[0].append(hsscript);
5253
}
5354

55+
function initializeReo() {
56+
if (isLocalhost) {
57+
console.log('[custom.js] Skipping Reo on localhost');
58+
return;
59+
}
60+
61+
var reoScript = document.createElement("script");
62+
reoScript.type = "text/javascript";
63+
reoScript.src = "https://static.reo.dev/" + REO_CLIENT_ID + "/reo.js";
64+
reoScript.defer = true;
65+
reoScript.onload = function() {
66+
if (typeof Reo !== 'undefined') {
67+
Reo.init({ clientID: REO_CLIENT_ID });
68+
}
69+
};
70+
document.head.appendChild(reoScript);
71+
}
72+
5473
function initializeAll() {
5574
initializeHockeyStack();
75+
initializeReo();
5676
if (ENABLE_VOICE_WIDGET) {
5777
injectVapiWidget();
5878
}

0 commit comments

Comments
 (0)