@aikitstudio/agul-react
v0.1.0
Published
React components and AGULRenderer for OpenAPI-driven dynamic UI
Maintainers
Readme
@aikitstudio/agul-react
OpenAPI / Swagger spec in, React admin UI out: CRUD pages for every resource, forms for actions, streaming chat
for AI endpoints, and sign-in plus role-based access from the spec's securitySchemes.
npm install @aikitstudio/agul-react react react-dom antd @ant-design/icons axios dayjs swr react-router-domimport { AGULRenderer } from '@aikitstudio/agul-react';
export default function Admin() {
return <AGULRenderer specUrl="/openapi.json" auth={{ oauth: { clientId: 'admin-ui' } }} />;
}
// inside an existing router:
<Route path="/admin/*" element={<AGULRenderer spec={openApiJson} token={jwt} />} />| Prop | What it does |
|---|---|
| spec / specUrl / jsonSchema | The API (JSON or YAML) |
| baseUrl | Override the spec's server URL |
| token / getAuthHeaders | Host-managed auth (no sign-in UI) |
| auth | Built-in sign-in: API key, Basic, Bearer, OAuth 2 + PKCE, OpenID Connect |
| authorities | The user's roles/scopes; pages and buttons they can't use are hidden |
| decisionProvider | Let an LLM or your API decide CRUD / action / chat / hidden per operation |
| proxyUrl | Same-origin CORS proxy prefix |
| plugins | Custom field widgets |
Headless flows
@aikitstudio/agul-react/headless runs a server-driven flow (x-agul-view: flow) with no antd, for a page that draws with its
own components. It needs only react; the antd peers above are optional and are not installed for it.
npm install @aikitstudio/agul-react @aikitstudio/agul-core react react-domimport { useAgulFlow } from '@aikitstudio/agul-react/headless';
const flow = useAgulFlow({ startUrl: '/consult/sessions', answerUrl: (id) => `/consult/sessions/${id}/answers`, stepPath: 'flow' });Guides: sign-in and access control, UI decisions.
MIT
