Skip to main content
Docs Node.js SDK

Node.js SDK

The official Node.js / TypeScript client for the Hostsmith Public API. Manage sites, deploy files, and list domains programmatically.

Install

npm install @hostsmith/sdk

Quick start

import { Hostsmith } from "@hostsmith/sdk";

const client = new Hostsmith({
  accessToken: process.env.HOSTSMITH_ACCESS_TOKEN!,
  partition: "us", // "us" or "eu"
});

const { sites } = await client.sites.list();
await client.sites.deploy(sites[0].id, "./dist");

You'll need an OAuth access token - see Authentication for how to obtain one.

Partitions

Hostsmith stores data in regional partitions. Pass partition to the client to pick one:

PartitionLabelBase URL
usUnited Stateshttps://us.api.hostsmith.net
euEuropean Unionhttps://eu.api.hostsmith.net

If your token's aud claim names a single partition, you can omit partition and the SDK will default to it.

Further reading

The full API reference, deploy flow, error classes, and dev/staging overrides are documented in the SDK README on GitHub.