Skip to content

Commit 2522910

Browse files
committed
changed to use env var for org_id
1 parent 07b869c commit 2522910

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

assets/js/coveo.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
document.addEventListener('DOMContentLoaded', async function () {
22

33
// Netlify function to get the coveo search token via API
4-
async function getSearchToken() {
4+
async function getsearchObj() {
55
const response = await fetch(
66
window.location.origin+"/api/v1/auth/search_token"
77
);
88
return response.json();
99
}
1010

11-
const searchToken = await getSearchToken()
12-
Coveo.SearchEndpoint.configureCloudV2Endpoint("f5networkx1h1607h", searchToken.token, "https://f5networkx1h1607h.org.coveo.com/rest/search");
11+
const searchObj = await getsearchObj()
12+
Coveo.SearchEndpoint.configureCloudV2Endpoint(searchObj.org_id, searchObj.token, `https://${searchObj.org_id}.org.coveo.com/rest/search`);
1313

1414
const root = document.getElementById("search");
1515
const searchBoxRoot = document.getElementById("searchbox");

0 commit comments

Comments
 (0)