Repository navigation
MODEX HCloud SDK Update v1.3
Modex HCloud SDK
A TypeScript SDK for interacting with the [Hetzner Cloud API](https://docs.hetzner.cloud/), designed for internal use by MODEX services. Built for performance, type-safety, and simplicity.
🚀 What’s New in v1.3
✨ Features
-
🆕
getDatacenter+getDatacenters- Fetch individual datacenter info
- Filter, sort, and paginate across datacenters
- Returns full
location+server_typessupport
-
🆕
sshIntoServer- Execute commands over SSH using
node-ssh - Automatically handles connection, command, and cleanup
- Can be used to provision servers post-creation
- Execute commands over SSH using
-
→
serverTypesfunctions have been moved tosdk/servers/server-type/- Cleaner structure
- Better grouping with related server actions
✅ Test Coverage
- Full integration tests for:
getLocation,getLocationsgetDatacenter,getDatacenterssshIntoServer(with mocks)
📆 Installation
npm install @modex/hcloud🧠 Usage
Get a Location
const location = await hcloud.locations.getById(1)
console.log(location.city) // "Nuremberg"List Datacenters
const { datacenters, meta } = await getDatacenters({ per_page: 10 })SSH Into Server
const { stdout } = await sshIntoServer("192.168.1.100", "apt update && apt upgrade -y", "root")
console.log(stdout)💡 Requires
SSH_PRIVATE_KEYin your environment
📁 File Structure (partial)
sdk/
├── locations/
│ └── datacenters/
│ ├── getDatacenters.ts
│ └── getDatacenter.ts
├── servers/
│ ├── actions/
│ │ └── sshIntoServer.ts
│ └── server-type/
│ ├── getServerTypes.ts
│ ├── getServerType.ts
│ └