TypeScript Client Reference
EyesOnItAPI is the SDK client class.
Constructor
new EyesOnItAPI(apiBasePath: string, restHandler?: IEOIRESTHandler, customLogger?: any)
Parameters:
apiBasePath: EyesOnIt server base URL, such ashttp://localhost:8000restHandler: optional replacement transport implementingIEOIRESTHandlercustomLogger: optional logger object passed through to the internal Axios handler and SDK logging
Transport Customization
If you need custom HTTP behavior, implement IEOIRESTHandler:
interface IEOIRESTHandler {
get(endPoint: string): Promise<EOIResponse>;
post(endPoint: string, body: string, headers: any): Promise<EOIResponse>;
}
If no custom handler is provided, the SDK uses its built-in Axios implementation.
Core Methods
| Method | Request | Response | Endpoint |
|---|---|---|---|
processImage | EOIProcessImageInputs | EOIProcessImageResponse | POST /process_image |
addStream | EOIAddStreamInputs | EOIAddStreamResponse | POST /add_stream |
processVideo | EOIProcessVideoInputs | EOIProcessVideoResponse | POST /process_video |
removeStream | streamUrl: string | EOIRemoveStreamResponse | POST /remove_stream |
monitorStream | EOIMonitorStreamInputs | EOIMonitorStreamResponse | POST /monitor_stream |
stopMonitoringStream | streamUrl: string | EOIStopMonitoringStreamResponse | POST /stop_monitoring |
getAllStreamsInfo | none | EOIGetAllStreamsInfoResponse | GET /get_all_streams_info |
getStreamDetails | streamUrl: string | EOIGetStreamDetailsResponse | POST /get_stream_details |
getLastDetectionInfo | streamUrl: string | EOIGetLastDetectionInfoResponse | POST /get_last_detection_info |
getVideoFrame | streamUrl: string | EOIGetVideoFrameResponse | POST /get_video_frame |
searchArchive | EOIArchiveSearchInputs | EOISearchResponse | POST /archive_search |
searchLive | EOILiveSearchInputs | EOILiveSearchResponse | POST /live_search |
pauseLiveSearch | EOIUpdateLiveSearchInputs | EOIResponse | POST /pause_live_search |
resumeLiveSearch | EOIUpdateLiveSearchInputs | EOIResponse | POST /resume_live_search |
cancelLiveSearch | EOIUpdateLiveSearchInputs | EOIResponse | POST /cancel_live_search |
updateConfig | EOIUpdateConfigInputs | EOIUpdateConfigResponse | POST /update_config |
Face Recognition Methods
| Method | Request | Response | Endpoint |
|---|---|---|---|
getFacerecGroups | none | EOIGetFacerecGroupsResponse | GET /facerec_groups |
addFacerecGroup | EOIAddFacerecGroupInputs | EOIBaseOutputs | POST /facerec_add_group |
removeFacerecGroup | group_id: string | EOIRemoveFacerecGroupResponse | POST /facerec_remove_group |
addFacerecPerson | EOIAddFacerecPersonInputs | EOIBaseOutputs | POST /facerec_add_person |
addFacerecPeople | EOIAddFacerecPeopleInputs | EOIBaseOutputs | POST /facerec_add_people |
removeFacerecPerson | person_id: string | EOIBaseOutputs | POST /facerec_remove_person |
searchFacerecGroupNames | search: string | EOISearchFacerecNamesResponse | POST /facerec_search_group_names |
searchFacerecPeopleNames | search: string | EOISearchFacerecNamesResponse | POST /facerec_search_people_names |
getFacerecPersonDetails | person_id: string | EOIFacerecPersonDetailsResponse | POST /facerec_person_details |
Response Shapes Users Commonly Touch
All typed response wrappers inherit success and message from EOIBaseOutputs.
The additional fields that matter most in application code are:
| Response Type | Important Fields |
|---|---|
EOIProcessImageResponse | detections, image |
EOIProcessVideoResponse | video_id |
EOIGetAllStreamsInfoResponse | streams |
EOIGetStreamDetailsResponse | stream |
EOIGetLastDetectionInfoResponse | image, detections |
EOIGetVideoFrameResponse | image |
EOISearchResponse | results |
EOILiveSearchResponse | search_id |
EOIGetFacerecGroupsResponse | groups |
EOISearchFacerecNamesResponse | matches |
EOIFacerecPersonDetailsResponse | person_id, person_name, groups, images |
EOIRemoveFacerecGroupResponse | group_id, removed_memberships |
Utility Class
The SDK also includes EOIAPIUtils as a root export from eyesonit-typescript-sdk.
Available helper:
EOIAPIUtils.getInfoForStream(streams: EOIStreamInfo[], streamUrl: string): EOIStreamInfo | null
Use it after getAllStreamsInfo() when you want to locate a specific stream record by URL.
Error Handling
The client wraps transport errors and validator failures in typed responses.
Typical pattern:
const response = await client.getStreamDetails("rtsp://camera-01/live");
if (!response.success) {
throw new Error(response.message);
}
Notes:
- Validator failures happen before the HTTP call.
- HTTP and transport failures are returned as
success = falsewith anerror: ...message. pauseLiveSearch,resumeLiveSearch, andcancelLiveSearchreturn rawEOIResponse, not an output wrapper class.
Runtime Configuration
updateConfig(inputs: EOIUpdateConfigInputs) wraps the server payload in a typed request class. The SDK still does not validate the inner body shape, so only send server-supported configuration payloads.