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 Base
Create, inspect, list, update environment variables, and delete projects.
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 Module
Provision L4/L7 load balancers, balance traffic across containers, attach custom domains, and configure target weights.
// 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 & Firewall Module
Manage private VPN subnets, access keys, firewall ingress/egress policies, proxy configurations, and network audit 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');Port Reservations
Reserve dedicated TCP/UDP ports, map public edge ports to internal container ports, and unmap ports dynamically.
// 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,
});Container Registry
Manage Docker registry credentials, inspect uploaded container images, trigger vulnerability scans, and issue scoped registry tokens.
// 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 & Persistent Storage
Provision block storage volumes, attach persistent storage to containers, resize volumes on the fly, and transfer volume snapshots.
// 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');Project Hibernation
Pause container runtime state to save disk and memory, preview cost savings, and instantly restore active workloads.
// 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 Acceleration
List GPU instances visible to the account. Project GPU provisioning is available through the REST API contract, not the current SDK convenience modules.
// 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);
}