AstroWay/api v2.254.12 · vi
tất cả hệ thống hoạt động bình thường
// 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ả 771+ 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
pnpm pnpm add @astroway/sdk
yarn yarn add @astroway/sdk
bun bun add @astroway/sdk

import: import { Astroway } from '@astroway/sdk';

// 02 / highlights

Điểm nổi bật

// 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',
  },
});

// aw.client.POST is the raw typed fetch, so `chart` is the { ok, data } envelope
console.log(chart.data.houses.ascendant);  // 212.0952574979425

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.

99,9% SLA · gói trả phí · 30 ngày trạng thái →