React Reference

@aeontel/react — React Query hooks for every SDK method, plus polling and event-stream helpers.

@aeontel/react is a thin layer over @aeontel/sdk plus @tanstack/react-query. Every SDK method has a matching hook, every list endpoint has a paginated query, every mutation auto-invalidates the relevant cache keys.

Quick start

TSX
import { AeontelProvider } from "@aeontel/react";
import Aeontel from "@aeontel/sdk";

const client = new Aeontel(null, { credentials: "include" });

function App() {
  return (
    <AeontelProvider client={client}>
      <AgentsList workspaceId="wsp_..." />
    </AeontelProvider>
  );
}

import { useListAgents } from "@aeontel/react";

function AgentsList({ workspaceId }: { workspaceId: string }) {
  const { data, isLoading } = useListAgents({ workspace_id: workspaceId });
  if (isLoading) return <Skeleton />;
  return (
    <ul>
      {data?.data.map((a) => (
        <li key={a.id}>{a.name}</li>
      ))}
    </ul>
  );
}

What's inside

  • Installation — install the package, wrap your app in AeontelProvider.
  • Polling tiersPOLL_CRITICAL, POLL_ACTIVE, POLL_AMBIENT — pick the right refetchInterval.
  • Query keys & invalidation — use the key factories to invalidate caches after mutations.
  • Event streamuseEventStream keeps the cache fresh in near-real-time.
  • Hooks — one page per entity, generated from source.