AstroWay/api v2.254.12 · es
todos los sistemas funcionando con normalidad
// sdk · React

Compañero React para @astroway/sdk

Oficial @astroway/react en npm - un envoltorio delgado al estilo Stripe para @astroway/sdk. AstrowayProvider eleva el cliente al contexto React; los ganchos useAstroway, useAstrowayQuery, useNatalChart devuelven una triple { data, error, loading } al estilo SWR con cero dependencias externas. Funciona con React 18+, Next.js App Router (via "use client"), Vite, CRA.

// 01 / install

Instalar

npm install @astroway/react @astroway/sdk react
pnpm pnpm add @astroway/react @astroway/sdk react
yarn yarn add @astroway/react @astroway/sdk react
bun bun add @astroway/react @astroway/sdk react

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

// 02 / highlights

Características destacadas

// 03 / first request

Primera solicitud

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>;
}

Empezar con React

10 000 créditos gratis al mes. SDK de código abierto, generado desde OpenAPI 3.1, siempre sincronizado con el backend.

99.9% SLA · planes de pago · 30 días estado →