@sudobility/shaperouter_client
React client library for the ShapeRouter API with state management hooks.
Installation
bun add @sudobility/shaperouter_client
Usage
import { useKeys, useProjects, useAiExecute } from '@sudobility/shaperouter_client';
const { keys, isLoading, refresh, createKey } = useKeys(networkClient, baseUrl);
await refresh(userId, token);
Hooks
useKeys | LLM API key management |
useProjects | Project CRUD |
useEndpoints | Endpoint configuration |
useAiExecute | LLM inference |
useAnalytics | Usage analytics |
useSettings | User settings |
Each hook returns { data, isLoading, error, refresh, clearError, reset } plus CRUD methods.
Development
bun run build
bun run test
bun run typecheck
bun run lint
bun run verify
Related Packages
@sudobility/shaperouter_types -- Shared type definitions
@sudobility/shaperouter_lib -- Zustand stores wrapping these hooks
shaperouter_app -- Frontend consumer
License
BUSL-1.1