Official SDK for the QuickStack API: https://quickstack.dev
QuickStack is a platform for running and managing apps. With this SDK, JavaScript and TypeScript applications can communicate with the API of a QuickStack instance, for example to manage apps and related resources programmatically.
npm install @quickstackdev/sdk
This package is licensed under the GNU General Public License v3.0. See LICENSE for details.
import { QuickStackClient } from "@quickstackdev/sdk"; /** * Either provide the base URL and token directly, or set the environment variables: * - QUICKSTACK_BASE_URL * - QUICKSTACK_API_TOKEN * */ const client = QuickStackClient.create(); const apps = await client.listApps({ projectId: "project-id" }); console.log("Apps in project:", apps.items.length);
You can pass credentials directly:
import { QuickStackClient } from "@quickstackdev/sdk"; const client = QuickStackClient.create("https://your-quickstack-host", "your-api-token");
Or use environment variables:
QUICKSTACK_BASE_URLQUICKSTACK_API_TOKEN
const client = QuickStackClient.create();
The SDK provides these list operations:
listProjects({ limit?, cursor? })listApps({ projectId?, limit?, cursor? })listAgents({ projectId?, limit?, cursor? })listAppDeployments({ appId, limit?, cursor? })
Each method returns a paginated object, not an array. The items property contains the returned records; total is the total number of matching records, limit is the page size, and nextCursor is the cursor for the next page or null when there are no more pages. The default limit is 50 and the maximum is 100.
const firstPage = await client.listApps({ projectId: "project-id", limit: 25 }); console.log("Apps on this page:", firstPage.items.length, "of", firstPage.total); if (firstPage.nextCursor) { const nextPage = await client.listApps({ projectId: "project-id", limit: firstPage.limit, cursor: firstPage.nextCursor, }); console.log("Next page:", nextPage.items); }
saveApp is an upsert endpoint:
- Create: call
saveAppwithoutid - Update: call
saveAppwithid
import { QuickStackClient } from "@quickstackdev/sdk"; const client = QuickStackClient.create(); const createdApp = await client.saveApp({ name: "my-app", appType: "SERVICE", projectId: "project-id", sourceType: "GIT", buildMethod: "DOCKERFILE", gitUrl: "https://github.com/acme/my-app", gitBranch: "main", dockerfilePath: "Dockerfile", replicas: 1, envVars: "{}", buildArgs: "{}", ingressNetworkPolicy: "ALLOW_ALL", egressNetworkPolicy: "ALLOW_ALL", useNetworkPolicy: false, healthCheckPeriodSeconds: 10, healthCheckTimeoutSeconds: 5, healthCheckFailureThreshold: 3, appDomains: [], appPorts: [], appNodePorts: [], appFileMounts: [], appVolumes: [], appBasicAuths: [], appNetworkPolicy: null, }); console.log("Created app id:", createdApp.id);
const app = await client.getApp({ appId: "app-id" }); console.log(app.name);
const apps = await client.listApps({ projectId: "project-id" }); console.log("Apps in project:", apps.items.length, "of", apps.total);
const updated = await client.saveApp({ id: "app-id", name: "my-app-renamed", appType: "SERVICE", projectId: "project-id", sourceType: "GIT", buildMethod: "DOCKERFILE", gitUrl: "https://github.com/acme/my-app", gitBranch: "main", dockerfilePath: "Dockerfile", replicas: 2, envVars: "{}", buildArgs: "{}", ingressNetworkPolicy: "ALLOW_ALL", egressNetworkPolicy: "ALLOW_ALL", useNetworkPolicy: false, healthCheckPeriodSeconds: 10, healthCheckTimeoutSeconds: 5, healthCheckFailureThreshold: 3, appDomains: [], appPorts: [], appNodePorts: [], appFileMounts: [], appVolumes: [], appBasicAuths: [], appNetworkPolicy: null, }); console.log("Updated app:", updated.id);
await client.deleteApp({ id: "app-id" }); console.log("App deleted");
Run a shell command in the first running Pod of an app. The caller needs write access to the app, and the app must have a running workload.
import { QuickStackClient } from "@quickstackdev/sdk"; const client = QuickStackClient.create(); const result = await client.runAppCommand( { appId: "app-id" }, { command: "node --version", cwd: "/app", timeoutSec: 30, env: { NODE_ENV: "production" }, }, ); console.log("Command output:", result.stdout); console.log("Exit code:", result.exitCode);
runAppCommand returns stdout, stderr, and exitCode. A non-zero exit code is returned in the result and does not automatically throw an error.
try { const apps = await client.listApps({ projectId: "project-id" }); console.log(apps.items); } catch (error) { console.error("QuickStack API call failed", error); }
bun run build
bun testPublish dry run:
npm pack --dry-run
- The package is ESM-only.
- Public entrypoint is the package root import (
@quickstackdev/sdk).