// sdk · TypeScript
TypeScript SDK cho API AstroWay
Official `@astroway/sdk` — lớp wrapper mỏng trên `openapi-fetch` (~6 KB runtime). Tự động hoàn thành đường dẫn + kiểu dữ liệu request/response trong IDE cho tất cả {endpoints}+ endpoints. Cấu trúc lỗi kiểu Stainless, tự động retry trên 408/409/429/5xx, OIDC + SLSA L3 provenance.
// 01 / install
Cài đặt
npm install @astroway/sdk import: import { Astroway } from '@astroway/sdk';
Xem trong sổ đăng ký → @astroway/sdk
// 02 / highlights
Điểm nổi bật
- Kiểu TypeScript đầy đủ
- Được tạo từ OpenAPI 3.1
- Tự động retry + backoff
- Lỗi kiểu Stainless
- OIDC + SLSA L3
// 03 / first request
Yêu cầu đầu tiên
import { Astroway } from '@astroway/sdk';
const aw = new Astroway({ apiKey: process.env.ASTROWAY_API_KEY! });
const { data: chart } = await aw.client.POST('/chart', {
body: {
date: '1990-07-14',
time: '14:30:00',
timezoneOffset: 3,
latitude: 50.4501,
longitude: 30.5234,
houseSystem: 'P',
},
});
console.log(chart.angles.asc); Bắt đầu với TypeScript
10.000 credits miễn phí mỗi tháng. SDK mã nguồn mở, được tạo từ OpenAPI 3.1, luôn đồng bộ với backend.