TypeScript / Node.js Quickstart
Use Engium from any Node.js or browser environment with the Fetch API or axios — zero additional dependencies required.
info
Prerequisites
- •Node.js 18+ (native fetch) or any modern browser
- •API key and Tenant ID from Settings → Developer
info
Native fetch included
Node.js 18+ ships with the global fetch API, so no extra packages are needed. For older Node.js, install node-fetch or use axios.
Implementation
engium.ts
// ── Typed Engium client (no extra dependencies) ──────────────
const BASE = "https://api.engium.app/api/v1";
const API_KEY = process.env.ENGIUM_API_KEY!;
const TENANT = process.env.ENGIUM_TENANT_ID!;
const headers = {
"Authorization": `Bearer ${API_KEY}`,
"X-Tenant-ID": TENANT,
"Content-Type": "application/json",
};
// Send a WhatsApp message
const resp = await fetch(`${BASE}/conversations/send`, {
method: "POST",
headers,
body: JSON.stringify({
recipient: "+15550102999",
channel: "whatsapp",
message: { text: "Hello from TypeScript! 🚀" },
}),
});
if (!resp.ok) throw new Error(`Engium error: ${resp.status}`);
const session = await resp.json();
console.log("Session ID:", session.id);
// List bookings
const bookings = await fetch(
`${BASE}/bookings?status=confirmed&per_page=10`,
{ headers }
).then(r => r.json());
console.log("Confirmed bookings:", bookings.total);Request Parameters
| Parameter | Type | Requirement |
|---|---|---|
Authorization | Header · string | Required |
X-Tenant-ID | Header · UUID | Required |
AuthorizationRequiredBearer {api_key}. Generate from Settings → Developer → API Keys.
Type:Header · string
X-Tenant-IDRequiredYour Tenant UUID. All API data is scoped to this tenant.
Type:Header · UUID
Was this helpful?