import { Client, ClientSession, ClientError } from 'flue-eve/client'
| API | Description |
|---|
new Client(options?) | Bind a host, auth policy, headers, and reconnect budget |
client.health() | Call GET /eve/v1/health |
client.info() | Call GET /eve/v1/info |
client.fetch(path, init?) | Fetch a route with configured auth and headers |
client.session(state?) | Create or restore a ClientSession |
| API | Description |
|---|
session.state | Current { sessionId, continuationToken, streamIndex } |
session.send(input) | Post a first or follow-up turn and return MessageResponse |
session.stream(options?) | Stream an existing session from the stored or provided index |
| API | Description |
|---|
response.sessionId | Session ID returned by the server |
response.continuationToken | Continuation token returned for the next turn |
for await (const event of response) | Consume current-turn Eve events |
response.result() | Consume the turn and return { status, message, data, events } |
loadSessionState, saveSessionState, clearSessionState, and
isSessionState support browser storage or any Storage-like object.