Hubfly spaceDocs
Console

SDK · Reference

Module explorer

Selected SDK modules, the REST endpoints behind them, and runnable examples in either language. Filter by area or search for a method, a path or an operation ID.

Interactive SDK Explorer

Explore typed SDK client modules, REST API mappings, and code snippets.

This explorer covers selected convenience modules. The SDKs are not a complete one-to-one mirror of every Dashboard API route; use the API reference for any operation that is not listed here.

Projects

Projects Base

Create, inspect, list, update environment variables, and delete projects.

GET/api/v1/projectsPOST/api/v1/projects/createGET/api/v1/projects/:projectIdDELETE/api/v1/projects/:projectId/deleteGET/api/v1/projects/:projectId/envPUT/api/v1/projects/:projectId/env
import { HubflyClient } from '@hubfly/sdk';

const client = new HubflyClient({ token: process.env.HUBFLY_TOKEN });

// List all projects
const { data: projects } = await client.projects.list();

// Create a new project
const { data: newProject } = await client.projects.create({
  name: 'my-production-app',
  region: 'us-east-1',
});

// Update environment variables
await client.projects.updateEnv(newProject.id, [
  { key: 'NODE_ENV', value: 'production' },
  { key: 'DATABASE_URL', value: 'postgres://...', isSecret: true },
]);
Load Balancers

Load Balancers Module

Provision L4/L7 load balancers, balance traffic across containers, attach custom domains, and configure target weights.

GET/api/v1/projects/:projectId/load-balancersPOST/api/v1/projects/:projectId/load-balancers/createGET/api/v1/projects/:projectId/load-balancers/:lbIdDELETE/api/v1/projects/:projectId/load-balancers/:lbId/deletePOST/api/v1/projects/:projectId/load-balancers/:lbId/targets/createPOST/api/v1/projects/:projectId/load-balancers/:lbId/domains/create
// Provision a load balancer
const { data: lb } = await client.projects.loadBalancers.create({
  projectId: 'proj_123',
  name: 'web-lb',
  algorithm: 'round_robin',
});

// Attach a target container
await client.projects.loadBalancers.createTarget('proj_123', lb.id, {
  targetId: 'container_abc',
  port: 8080,
  weight: 100,
});

// Attach custom domain with SSL
await client.projects.loadBalancers.createDomain('proj_123', lb.id, {
  domainName: 'api.example.com',
  sslEnabled: true,
});
Network

Network & Firewall Module

Manage private VPN subnets, access keys, firewall ingress/egress policies, proxy configurations, and network audit logs.

GET/api/v1/projects/:projectId/networkGET/api/v1/projects/:projectId/network/accessPOST/api/v1/projects/:projectId/network/access/keys/createGET/api/v1/projects/:projectId/network/firewallPOST/api/v1/projects/:projectId/network/firewall/updateGET/api/v1/projects/:projectId/network/logs
// Retrieve project network access state
const { data: net } = await client.projects.network.getAccess('proj_123');

// Configure firewall rules
await client.projects.network.updateFirewall('proj_123', {
  projectId: 'proj_123',
  enabled: true,
  rules: [
    { id: 'r1', direction: 'inbound', protocol: 'tcp', portRange: '443', cidr: '0.0.0.0/0', action: 'allow' },
    { id: 'r2', direction: 'inbound', protocol: 'tcp', portRange: '22', cidr: '10.0.0.0/16', action: 'allow' },
  ],
});

// Fetch network activity logs
const { data: logs } = await client.projects.network.getLogs('proj_123');
Ports

Port Reservations

Reserve dedicated TCP/UDP ports, map public edge ports to internal container ports, and unmap ports dynamically.

GET/api/v1/projects/:projectId/portsPOST/api/v1/projects/:projectId/ports/reservePOST/api/v1/projects/:projectId/ports/:reservationId/mapPOST/api/v1/projects/:projectId/ports/:reservationId/unmapDELETE/api/v1/projects/:projectId/ports/:reservationId
// Reserve a dedicated public TCP port
const { data: reservation } = await client.projects.ports.reserve('proj_123', {
  protocol: 'tcp',
  port: 27017,
});

// Map public port to container port 27017
await client.projects.ports.map('proj_123', reservation.reservationId, {
  containerId: 'cnt_mongo',
  containerPort: 27017,
});
Registry

Container Registry

Manage Docker registry credentials, inspect uploaded container images, trigger vulnerability scans, and issue scoped registry tokens.

GET/api/v1/projects/:projectId/registry/imagesGET/api/v1/projects/:projectId/registry/images/:imageId/scanGET/api/v1/projects/:projectId/registry/images/:imageId/scan/triggerPOST/api/v1/projects/:projectId/registry-credentials/create
// Store private registry credentials (e.g. Docker Hub, GHCR, ECR)
await client.projects.registry.createCredential('proj_123', {
  name: 'ghcr-access',
  registryUrl: 'ghcr.io',
  username: 'my-org',
  password: process.env.GHCR_PAT,
});

// List uploaded registry images
const { data: images } = await client.projects.registry.listImages('proj_123');

// Trigger vulnerability scan on image tag
const { data: scan } = await client.projects.registry.triggerScan('proj_123', images[0].imageId);
console.log('Vulnerabilities status:', scan.status);
Volumes

Volumes & Persistent Storage

Provision block storage volumes, attach persistent storage to containers, resize volumes on the fly, and transfer volume snapshots.

GET/api/v1/projects/:projectId/volumesPOST/api/v1/projects/:projectId/volumes/createGET/api/v1/projects/:projectId/volumes/:volumeIdDELETE/api/v1/projects/:projectId/volumes/:volumeId/remove
// Create a 20GB persistent volume
const { data: volume } = await client.projects.volumes.create({
  projectId: 'proj_123',
  name: 'postgres-data',
  sizeGb: 20,
});

// List all project volumes
const { data: volumes } = await client.projects.volumes.list('proj_123');
Hibernation

Project Hibernation

Pause container runtime state to save disk and memory, preview cost savings, and instantly restore active workloads.

GET/api/v1/projects/:projectId/hibernation/previewGET/api/v1/projects/:projectId/hibernation/hibernateGET/api/v1/projects/:projectId/hibernation/restore
// Check hibernation savings preview
const { data: preview } = await client.projects.hibernation.preview('proj_123');
console.log('Estimated disk saved:', preview.estimatedDiskSavedMb, 'MB');

// Hibernate project
await client.projects.hibernation.hibernate('proj_123');

// Restore project from hibernation
await client.projects.hibernation.restore('proj_123');
GPU

GPU Acceleration

List GPU instances visible to the account. Project GPU provisioning is available through the REST API contract, not the current SDK convenience modules.

GET/api/v1/gpu
// List GPU instances visible to the account
const { data: instances } = await client.gpu.list();

for (const instance of instances) {
  console.log(instance.id, instance.status);
}
Something unclear or out of date? Emailsupport@hubfly.spaceBack to top