![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@thoughtspot/rest-api-sdk
Advanced tools
TypeScript/JavaScript client for ThoughtSpot's v2 Rest APIs.
Navigate to the folder of your consuming project and run one of the following commands.
published:
npm install @thoughtspot/rest-api-sdk --save
unPublished (not recommended):
npm install PATH_TO_GENERATED_PACKAGE --save
Below code snippet shows how to create a simple config and use it to call the getUsers and getUserGroups apis.
import {
ThoughtSpotRestApi,
createBearerAuthenticationConfig
} from "@thoughtspot/rest-api-sdk";
const BASE_URL = "CLUSTER_URL";
const main = async () => {
// getting the token
const config = createBearerAuthenticationConfig(BASE_URL, {
username: "YOUR_USERNAME",
password: "YOUR_PASSWORD",
});
// create a thoughtspot client
const tsRestApiClient = new ThoughtSpotRestApi(config);
try {
const users = await tsRestApiClient.searchUsers();
console.log("Users on the cluster : ");
users.forEach((user) => {
console.log(user.name, user.email);
});
} catch (e) {
console.log(e);
}
};
main();
NOTE: For self certified ssl certificates, use the following config:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
We recommend that you browse through the code playground before you start constructing your API requests. The playground offers an interactive portal with comprehensive information about the API endpoints, request and response workflows.
FAQs
Api sdk for thoughtspot's public v2 rest api
The npm package @thoughtspot/rest-api-sdk receives a total of 1,668 weekly downloads. As such, @thoughtspot/rest-api-sdk popularity was classified as popular.
We found that @thoughtspot/rest-api-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.