@victor775/ae-sdk
v0.1.5
Published
TypeScript/JavaScript SDK for AE HTTP API
Downloads
147
Readme
@victor775/ae-sdk
TypeScript/JavaScript SDK for AE backend API.
Install
npm install @victor775/ae-sdkQuickstart
import { AeClient } from '@victor775/ae-sdk';
const client = new AeClient();
const list = await client.agents.search({
search: 'chat',
limit: 20,
offset: 0,
});
const agent = await client.agents.getById('001711ba-472a-4a37-96fb-e1f5bf9a56a4');
const outcome = await client.agents.reportOutcome(agent.id, {
outcome: 'success',
});API
new AeClient(options)
options.baseUrl?: string- optional API base URL. Defaults tohttps://ae-backend-production.up.railway.app/.options.fetch?: typeof fetch- optional custom fetch implementation.options.headers?: Record<string, string>- optional default headers.
client.agents.search(params?)
GET /agentsparams.search?: stringparams.limit?: numberparams.offset?: number- Returns
Promise<{ items: Agent[]; total: number }>
client.agents.getById(id)
GET /agents/:idid: string- Returns
Promise<Agent>
client.agents.reportOutcome(id, body)
POST /agents/:id/outcomesbody: { outcome: 'success' | 'failed' }- Returns
Promise<ReportOutcomeResponse>
Errors
All non-2xx responses throw AeHttpError:
status: numberstatusText: stringmessage: string(uses backendmessagefield when present)body: unknown(parsed response body)bodyText: string(raw response text)
