AstroWay/api v2.74.0 · sdks
all systems operational
// sdk · React

React companion for @astroway/sdk

Official `@astroway/react` on npm — a thin Stripe-style wrapper over `@astroway/sdk`. `AstrowayProvider` lifts the client into React context; `useAstroway`, `useAstrowayQuery`, `useNatalChart` hooks return an SWR-style `{ data, error, loading }` triple with zero external deps. Works with React 18+, Next.js App Router (via "use client"), Vite, CRA.

// 01 / install

Install

npm install @astroway/react @astroway/sdk react

import: import { AstrowayProvider, useNatalChart } from '@astroway/react';

// 02 / highlights

Highlights

// 03 / first request

Make your first request

import { AstrowayProvider, useNatalChart } from '@astroway/react';

function App() {
  return (
    <AstrowayProvider options={{ apiKey: import.meta.env.VITE_AW_KEY }}>
      <Chart />
    </AstrowayProvider>
  );
}

function Chart() {
  const { data, error, loading } = useNatalChart({
    date: '1990-07-14',
    time: '14:30:00',
    timezoneOffset: 3,
    latitude: 50.4501,
    longitude: 30.5234,
  });

  if (loading) return <p>Loading…</p>;
  if (error) return <p>Error: {error.message}</p>;
  return <pre>{JSON.stringify(data, null, 2)}</pre>;
}

Start building with React

10,000 credits free per month. Open-source SDK, generated from OpenAPI 3.1, always in sync with the backend.

99.9% SLA · paid plans · 30d status →