JavaScript/Node.js client library for the VRecon Vehicle Recognition Intelligence Platform.
npm install @vrecon/clientOr install from source:
git clone https://github.com/vrecon-io/vrecon-js.git
cd vrecon-js
npm install
npm linkimport { VReconApiClient } from '@vrecon/client';
// Initialize the client
const client = new VReconApiClient('your_api_key');
// Submit an image for recognition
const response = await client.recognize('path/to/vehicle.jpg');
console.log(`Request UUID: ${response.requestUuid}`);
// Check the status
const state = await client.getState(response.requestUuid);
console.log(`State: ${state.state}`);
// Or submit and wait for the result
const result = await client.recognizeAndWait('path/to/vehicle.jpg');
if (result.result) {
console.log(`Vehicle: ${result.result.make} ${result.result.model}`);
}# Submit an image for recognition
vrecon -k your_api_key recognize image.jpg
# Check the status of a request
vrecon -k your_api_key state <request_uuid>
# Submit and wait for the result
vrecon -k your_api_key recognize-wait image.jpg
# With verbose output
vrecon -k your_api_key -v recognize-wait image.jpg
# Custom base URL
vrecon -k your_api_key --url https://custom.vrecon.io recognize image.jpgThe main client class for interacting with the VRecon API.
new VReconApiClient(apiKey, baseUrl = 'https://vrecon.io', verbose = false)recognize(imagePath)- Submit an image for recognition. ReturnsPromise<RecognizeResponse>getState(requestUuid)- Check the status of a request. ReturnsPromise<StateResponse>recognizeAndWait(imagePath, pollIntervalMs = 2000, maxWaitMs = 60000)- Submit and wait for completion. ReturnsPromise<StateResponse>
Contains the vehicle recognition results:
vehicle_found: boolean- Whether a vehicle was detectedmake: string|null- Vehicle manufacturermodel: string|null- Vehicle modelgeneration: string|null- Vehicle generation/year rangecolor: string|null- Vehicle colorside: string|null- Which side of the vehicle is visibleangle: string|null- Camera anglerecognition_probability: number|null- Confidence score (0.0 to 1.0)rect_area: RectArea|null- Bounding box of the vehicledamage_detected: boolean- Whether damage was detecteddamage_area: RectArea[]- Bounding boxes of damaged areasdetection_notes: string|null- Additional notesmultiple_vehicles_in_image: boolean- Whether multiple vehicles were found
- Node.js 18.0.0 or higher
MIT License - see LICENSE file for details.