Official TypeScript client for the Hotdata HTTP API: workspaces, connections, datasets, SQL queries, results, secrets, uploads, indexes, jobs, embedding providers, and workspace context.
The package is produced with OpenAPI Generator from the Hotdata OpenAPI spec. For the Python client, see hotdata-dev/sdk-python.
A JavaScript runtime with a global fetch (for example Node.js 18+).
From npm (when published):
npm install @hotdata/sdkFrom the GitHub repository:
npm install github:hotdata-dev/sdk-typescriptFrom a local checkout:
npm install
npm run buildThe API uses Bearer JWTs and an X-Workspace-Id header on requests that are scoped to a workspace.
import { Configuration } from "@hotdata/sdk";
const configuration = new Configuration({
accessToken: "YOUR_ACCESS_TOKEN",
headers: {
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
},
});basePath defaults to https://app.hotdata.dev. Pass basePath in the configuration if you target another environment.
import { Configuration, ResponseError, WorkspacesApi } from "@hotdata/sdk";
const configuration = new Configuration({
accessToken: "YOUR_ACCESS_TOKEN",
headers: {
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
},
});
const workspaces = new WorkspacesApi(configuration);
try {
const response = await workspaces.listWorkspaces();
console.log(response);
} catch (e) {
if (e instanceof ResponseError) {
console.error(`${e.response.status} ${e.response.statusText}\n${await e.response.text()}`);
} else {
throw e;
}
}Each *Api class groups endpoints by resource. Construct a Configuration, pass it into the API class you need, then call the typed methods.
Generated Markdown for every operation and model is in docs/:
- Resource APIs:
docs/*Api.md(for exampledocs/QueryApi.md) - Request and response models:
docs/<ModelName>.md
Use your editor or GitHub file search there instead of duplicating large tables in this file.
Questions and issues: github.com/hotdata-dev/sdk-typescript.