CloudNexus SDK Reference
Official client library for interacting with the CloudNexus Cloud Infrastructure API. Supports Node.js 16+, Deno, and modern browsers.
The CloudNexus SDK provides a type-safe, async-first interface to provision, manage, and scale cloud resources. All API methods return promises and support both callback and async/await patterns.
Installation
Install the SDK using your preferred package manager:
For Deno, import directly from the CDN:
Authentication
The SDK uses API keys for authentication. Create keys in the CloudNexus Console under Settings → API Keys.
dotenv or your environment's secret management system.
Quick Start
Provision a compute instance and attach persistent storage in under 50 lines:
Compute & VMs
client.compute.create(options)
Provisions a new virtual machine or bare-metal server.
| Parameter | Type | Description |
|---|---|---|
name Required | string | Unique identifier for the instance |
type Required | string | Instance family: cn-standard, cn-memory, cn-gpu |
image Required | string | OS template ID or name |
region | string | Target deployment region |
tags | string[] | Metadata tags for filtering |
Returns: Promise<InstanceResource>
Error Handling
The SDK throws typed errors for all API failures. Wrap calls in try/catch blocks:
| Code | Status | Meaning |
|---|---|---|
QUOTA_EXCEEDED | 429 | Rate limit or resource quota reached |
AUTH_FAILED | 401 | Invalid or expired API key |
INVALID_REGION | 400 | Specified region does not exist |
SERVICE_UNAVAILABLE | 503 | Temporary backend degradation |
Configuration
Advanced runtime options can be passed during initialization: