New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@thoughtspot/rest-api-sdk

Package Overview
Dependencies
Maintainers
13
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thoughtspot/rest-api-sdk

Api sdk for thoughtspot's public v2 rest api

  • 2.11.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-7.5%
Maintainers
13
Weekly downloads
 
Created
Source

@thoughtspot/rest-api-sdk@2.11.1

TypeScript/JavaScript client for ThoughtSpot's v2 Rest APIs.

Consuming

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

Usage

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"

Live Playground

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.

Keywords

FAQs

Package last updated on 31 Jan 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc