TypeScript SDK
Typed inputs and outputs, standardized auth, errors with request IDs, and retry safety. Same API shape as the REST surface — one package for the whole suite.
Install
npm
npm install @astrovibe/clientUsage
TypeScript
import { AstroClient, ApiError } from "@astrovibe/client";
const astro = new AstroClient({
apiKey: process.env.ASTRO_API_KEY, // av_...
baseUrl: "https://astro-vibe-engine.gauravapproved.workers.dev",
});
// One typed method per endpoint — 205 generated methods
const chart = await astro.generateBirthChart({
datetime: "1990-07-15T18:30:00Z",
latitude: 40.7128,
longitude: -74.006,
timezone: "America/New_York",
});
console.log(chart.lagna.sign);
// Cast a tarot spread
const reading = await astro.castThreeCard({ question: "What should I focus on?" });
// Errors are standardized
try {
await astro.generateDashaTimeline({ datetime: "bad" } as any);
} catch (err) {
if (err instanceof ApiError) {
console.error(err.status, err.code, err.requestId, err.message);
}
}Every endpoint has a typed method mirroring the API reference operation IDs.
Works everywhere
The API is plain JSON over HTTPS — any language that speaks HTTP works, including edge runtimes (Cloudflare Workers, Vercel Edge, Deno), Node, and browsers. Python, Go, Ruby and PHP samples are in the API reference.
// No SDK? The API is plain JSON over HTTPS.
// Every language that speaks HTTP works:
fetch("https://astro-vibe-engine.gauravapproved.workers.dev/v1/health")
.then((r) => r.json())
.then(console.log);