JavaScript & TypeScript SDK
Use the official QuickStack JavaScript and TypeScript SDK for app workloads.
The official QuickStack SDK is a typed JavaScript and TypeScript client for the QuickStack API. This guide covers its app-workload methods only.
Install
npm install @quickstackdev/sdkConfigure a client
Pass the QuickStack base URL and REST API key directly:
import { QuickStackClient } from "@quickstackdev/sdk";
const client = QuickStackClient.create(
"https://your-quickstack-host",
"your-api-key",
);Or set QUICKSTACK_BASE_URL and QUICKSTACK_API_TOKEN, then create the client without arguments:
const client = QuickStackClient.create();The SDK sends the key as a bearer token. Create and limit that key as described in Authentication.
Work with apps
The SDK returns response data directly from its convenience methods.
const apps = await client.listApps({ projectId: "project-id" });
const app = await client.getApp({ appId: "app-id" });
const updatedApp = await client.saveApp({
id: app.id,
name: "renamed-app",
appType: "SERVICE",
projectId: app.projectId,
sourceType: "GIT",
buildMethod: "DOCKERFILE",
gitUrl: "https://github.com/acme/my-app",
gitBranch: "main",
dockerfilePath: "Dockerfile",
replicas: 1,
envVars: "{}",
useNetworkPolicy: true,
appNetworkPolicy: {
allowInternetAccess: true,
rules: [
{
type: "EGRESS",
targetAppId: "target-app-id",
port: 5432,
protocol: "TCP",
},
],
},
healthCheckPeriodSeconds: 10,
healthCheckTimeoutSeconds: 5,
healthCheckFailureThreshold: 3,
appDomains: [],
appNodePorts: [],
appFileMounts: [],
appVolumes: [],
appBasicAuths: [],
});
await client.deleteApp({ id: updatedApp.id });saveApp is an upsert: omit id when creating and include it when updating. The appNetworkPolicy field is required on write: pass an object to replace the app's policy and rules, or null to remove it. Obtain the complete app request schema from your instance's OpenAPI documentation.
Network policy rules target apps by ID
Each rule references a target via targetAppId and carries a port and protocol (TCP or UDP). The older ingressNetworkPolicy, egressNetworkPolicy, networkPolicyMode, and appPorts fields have been removed. When reading an app, rules are returned under appNetworkPolicy.rules with nested target details.
Deployments and logs
const deployment = await client.deployApp({ appId: "app-id" });
const history = await client.listAppDeployments({ appId: "app-id" });
const details = await client.getAppDeployment({
appId: "app-id",
deployemtId: deployment.deploymentId,
});
const logs = await client.getAppLogs({ appId: "app-id", lines: 200 });
const deploymentLogs = await client.getAppDeploymentLogs({
appId: "app-id",
deployemtId: details.deploymentId,
tailLines: 200,
});The generated SDK currently uses the API's deployemtId parameter spelling for deployment-detail and deployment-log methods.
See the SDK repository for source code, releases, and the complete generated client surface.