SDKs (Node & Python)
Official client libraries wrap the REST API with a typed, ergonomic interface. Both are dependency-light and read your API key.
Node
npm install mailhusetimport { Mailhuset } from "mailhuset";
const mh = new Mailhuset(process.env.MAILHUSET_API_KEY);
await mh.emails.send({
from: "you@yourdomain.com",
to: "user@example.com",
subject: "Verify your email",
html: "<p>Welcome 👋</p>",
});send returns { id, status }. Also mh.emails.get(id) and mh.emails.list({ limit: 20 }). A non-2xx response throws a MailhusetError with .status and .code. Requires Node 18+ (global fetch). Point at another host with new Mailhuset(key, { baseUrl: "https://api.mailhuset.com/v1" }).
Python
pip install mailhusetfrom mailhuset import Mailhuset
mh = Mailhuset("mh_live_…")
mh.emails.send(
sender="you@yourdomain.com",
to="user@example.com",
subject="Verify your email",
html="<p>Welcome 👋</p>",
)In Python the sender field issender=(sincefromis a reserved word).
send returns {"id": ..., "status": ...}. Also mh.emails.get(id) and mh.emails.list(limit=20). A non-2xx response raises MailhusetError with .status and .code. Point at another host with Mailhuset(key, base_url="https://api.mailhuset.com/v1"). No dependencies beyond the standard library.
Which to use
The SDKs are the fastest path for app code. For one-off scripts, other languages, or maximum control, call the REST API directly. Everything the SDKs do is a thin wrapper over it.
Need help? Email support@mailhuset.com.