We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19e7409 commit a6f7d1cCopy full SHA for a6f7d1c
assets/js/coveo.js
@@ -1,15 +1,15 @@
1
document.addEventListener('DOMContentLoaded', async function () {
2
3
// Netlify function to get the coveo search token via API
4
- async function getSearchToken() {
+ async function getsearchObj() {
5
const response = await fetch(
6
window.location.origin+"/api/v1/auth/search_token"
7
);
8
return response.json();
9
}
10
11
- const searchToken = await getSearchToken()
12
- Coveo.SearchEndpoint.configureCloudV2Endpoint("", searchToken.token);
+ const searchObj = await getsearchObj()
+ Coveo.SearchEndpoint.configureCloudV2Endpoint(searchObj.org_id, searchObj.token, `https://${searchObj.org_id}.org.coveo.com/rest/search`);
13
14
const root = document.getElementById("search");
15
const searchBoxRoot = document.getElementById("searchbox");
0 commit comments