Official TypeScript client for the elizon hosting API.
Machine-facing SDK — no localized error messages. API failures throw ApiError with a machine-readable code, HTTP status, and raw payload. Map code to your own i18n layer.
npm install @elizonapp/api-clientRequires Node.js 18+ (native fetch) or any environment with a fetch polyfill.
import { ElizonClient, ApiError } from "@elizonapp/api-client";
const client = new ElizonClient({
baseUrl: "https://www.elizon.app",
clientKind: "api",
});
// Login
const { token } = await client.auth.login({
email: "you@example.com",
password: "secret",
rememberMe: true,
});
client.setToken(token!);
// List services
const { services } = await client.services.list();
// Error handling
try {
await client.billing.payInvoice("inv_123", { paymentMethod: "guthaben" });
} catch (err) {
if (err instanceof ApiError) {
console.log(err.code); // e.g. "insufficientBalance"
console.log(err.status); // e.g. 400
console.log(err.payload); // raw API body
}
}| Option | Type | Default | Description |
|---|---|---|---|
baseUrl |
string |
required | elizon API base URL |
token |
string | null |
null |
Bearer session token or API key |
clientKind |
"desktop" | "mobile" | "api" |
"api" |
Sent as X-Elizon-Client header |
fetch |
typeof fetch |
globalThis.fetch |
Custom fetch implementation |
headers |
Record<string, string> |
{} |
Extra headers on every request |
Some financially sensitive endpoints (checkout, invoice payment, business fund) require clientKind: "desktop". The server rejects mobile clients for these actions.
Create an API key via client.user.createApiKey(name), then pass the secret as token:
const client = new ElizonClient({
baseUrl: "https://www.elizon.app",
token: process.env.ELIZON_API_KEY,
});| Namespace | Description |
|---|---|
auth |
Login, sessions, 2FA, profile |
services |
VMs, containers, provider actions |
billing |
Invoices, subscriptions, payment methods |
checkout |
Cart validation, calculation, submit |
shop |
Product catalog |
dashboard |
Overview metrics |
domains |
Domain & DNS management |
subdomains |
Subdomain management |
ipManager |
IP assignment |
sshKeys |
SSH key management |
support |
Tickets, knowledge base |
user |
Audit log, API keys, GDPR export |
wallet |
Balance, vouchers, auto top-up |
business |
Business fund contracts |
affiliates |
Affiliate commissions & payouts |
family |
Family group management |
byoip |
Bring-your-own-IP |
floatingIps |
Floating IP management |
See docs/ERROR_CODES.md for common codes and handling patterns.
All codes are exported as ApiErrorCodes and ApiErrorCode type.
ELIZON_EMAIL=... ELIZON_PASSWORD=... npx tsx examples/auth.ts
ELIZON_TOKEN=... npx tsx examples/services.ts
ELIZON_TOKEN=... npx tsx examples/checkout.ts
ELIZON_TOKEN=... ELIZON_INVOICE_ID=... npx tsx examples/pay-invoice.tsnpm install
npm run buildOutput is written to dist/.
Standalone mirror: elizonapp/api-client-typescript.
On every push to main, the Build workflow:
- Publishes
@elizonapp/api-clientto GitHub Packages - Creates a GitHub Release titled
ignite-api {version} ({sha})with:ignite-api-{version}.tgz— npm package tarballignite-api-{version}-dist.zip— compileddist/plus metadata
MIT — see LICENSE.