Core
Typed HTTP client and domain models for the Mediquo platform.
@mediquo/core provides a typed HTTP client and Zod-validated domain models for the Mediquo REST API. Use it for server-side integrations or any custom flow that needs direct API access beyond what the web components expose.
Installation
npm install @mediquo/corePeer dependencies:
npm install zod date-fnsQuick start
import { MediquoApiChatClient } from "@mediquo/core/api-client";
const client = new MediquoApiChatClient({ env: "production" });
client.setApiKey("your-api-key");
client.setAuthToken("patient-jwt");
const { data } = await client.appointments.getAppointments({});Environments
| Value | Base URL |
|---|---|
"production" (default) | https://chat.mediquo.com |
"development" | https://chat-dev.mediquo.com |
You can also pass a fully custom baseURL to override both:
const client = new MediquoApiChatClient({
baseURL: "https://my-proxy.example.com",
});Authentication
All API calls require either a patient JWT or an API key — or both, depending on the endpoint.
client.setAuthToken("eyJ..."); // sets Authorization: Bearer <token>
client.setApiKey("your-api-key"); // sets x-api-key header
client.setLanguage("es"); // sets Accept-Language headerHeaders persist across calls on the same client instance. Call these methods again to rotate credentials.
Next steps
- API reference — all sub-clients and their method signatures
- Models — domain types returned by the API