Skip to content

Commit b49ddc5

Browse files
SCAL-202456-3 Enhance ThoughtSpot client configuration with additional headers
1 parent f0c19ea commit b49ddc5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
import { ThoughtSpotRestApi, createBearerAuthenticationConfig } from "@thoughtspot/rest-api-sdk";
1+
import {
2+
ThoughtSpotRestApi,
3+
createBearerAuthenticationConfig,
4+
} from "@thoughtspot/rest-api-sdk";
25
import { THOUGHTSPOT_HOST } from "../constants";
36
import { getCachedAuthToken } from "../get-auth-token";
47

58
/**
69
* This will create a bearer authenticated client to connect to thoughtspot server
7-
*
10+
*
811
* @returns ThoughtSpotRestApi
912
*/
1013
let thoughtSpotClient: ThoughtSpotRestApi;
1114
export const getThoughtSpotClient = () => {
1215
if (!thoughtSpotClient) {
13-
const bearerConfig = createBearerAuthenticationConfig(THOUGHTSPOT_HOST, getCachedAuthToken);
16+
const bearerConfig = createBearerAuthenticationConfig(
17+
THOUGHTSPOT_HOST,
18+
getCachedAuthToken,
19+
{
20+
additionalHeaders: {
21+
"Accept-Language": "en-US",
22+
},
23+
}
24+
);
1425
thoughtSpotClient = new ThoughtSpotRestApi(bearerConfig);
1526
}
1627
return thoughtSpotClient;
17-
}
28+
};

0 commit comments

Comments
 (0)