GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - biersoeckli/QuickStack-sdk

BranchesTags
Open more actions menu

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.github/workflows
.github/workflows
 
 
__test__
__test__
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING
CONTRIBUTING
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README_with_agent.md
README_with_agent.md
 
 
bun.lock
bun.lock
 
 
package.json
package.json
 
 
quickstack.openapi.json
quickstack.openapi.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

@quickstackdev/sdk

Official SDK for the QuickStack API: https://quickstack.dev

What is QuickStack?

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.

Installation

npm install @quickstackdev/sdk

License

This package is licensed under the GNU General Public License v3.0. See LICENSE for details.

Quick Start

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);

Authentication and Client Setup

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_URL
  • QUICKSTACK_API_TOKEN
const client = QuickStackClient.create();

List Operations and Pagination

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);
}

Apps CRUD

saveApp is an upsert endpoint:

  • Create: call saveApp without id
  • Update: call saveApp with id

Create App

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);

Read App (by ID)

const app = await client.getApp({ appId: "app-id" });
console.log(app.name);

Read Apps (list)

const apps = await client.listApps({ projectId: "project-id" });
console.log("Apps in project:", apps.items.length, "of", apps.total);

Update App

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);

Delete App

await client.deleteApp({ id: "app-id" });
console.log("App deleted");

Execute Commands in an App Workload

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.

Error Handling Pattern

try {
  const apps = await client.listApps({ projectId: "project-id" });
  console.log(apps.items);
} catch (error) {
  console.error("QuickStack API call failed", error);
}

Development

bun run build
bun test

Publish dry run:

npm pack --dry-run

Notes

  • The package is ESM-only.
  • Public entrypoint is the package root import (@quickstackdev/sdk).

About

No description, website, or topics provided.

Resources

Readme
GPL-3.0 license

Contributing

Contributing
Activity

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.