Skip to main content

Configuration

Most of the web applications integrating the MonkJs SDK will need the same configuration properties. To simplify the syntax when configuring your app, we provide a TypeScript interface called CaptureAppConfig that contains the usual configuration properties needed. You can create a file in your app that will contain the MonkJs configuration, so that it will be easy to modify the config properties if needed:

import { CaptureAppConfig } from '@monkvision/types';

export const MonkJsConfig: CaptureAppConfig = {
...
};

This configuration object can then be passed to components like <MonkAppStateProvider> or <PhotoCapture>.

Available Configuration Options

The following table lists the available configuration options in the CaptureAppConfig interface :

NameTypeDescriptionRequiredDefault Value
allowManualLoginbooleanIndicates if manual login and logout should be enabled or not.✔️
fetchFromSearchParamsbooleanIndicates if the app state (auth token, inspection ID etc.) should be fetched from the URL search params.✔️
allowVehicleTypeSelectionbooleanIndicates if manual vehicle type selection should be enabled if the vehicle type is not defined.✔️
enableSteeringWheelPositionbooleanIndicates if the capture Sights should vary based on the steering wheel position (right or left).✔️
defaultVehicleTypeVehicleTypeDefault vehicle type to use if no vehicle type has been specified.✔️
defaultSteeringWheelPositionSteeringWheelPositionDefault steering wheel position to use if no steering wheel position has been specified.if enableSteeringWheelPosition is set to true
sightsRecord<..., string[]>A map associating each vehicle type supported by the app to a list of sight IDs. If enableSteeringWheelPosition is set to true, it's a map associating each steering wheel position to this map.✔️
allowCreateInspectionbooleanIndicates if automatic inspection creation should be enabled in the app.✔️
createInspectionOptionsCreateInspectionOptionsOptions used when automatically creating an inspection.if allowCreateInspection is set to true
apiDomainstringThe API domain used to communicate with the API.✔️
requiredApiPermissionsMonkApiPermission[]Required API permission that the user must have to use the current app.
palettePartial<MonkPalette>Custom color palette to use in the app.
enforceOrientationDeviceOrientationUse this prop to enforce a specific device orientation for the Camera screen.
maxUploadDurationWarningnumberMax upload duration in milliseconds before showing a bad connection warning to the user. Use -1 to never display the warning.15000
useAdaptiveImageQualitybooleanBoolean indicating if the image quality should be downgraded automatically in case of low connection.true
showCloseButtonbooleanIndicates if the close button should be displayed in the HUD on top of the Camera preview.false
startTasksOnComplete<code>boolean &#124; TaskName[]</code>Value indicating if tasks should be started at the end of the inspection. See the inspection-capture-web package doc for more info.true
additionalTasksTaskName[]An optional list of additional tasks to run on every Sight of the inspection.
tasksBySightRecord<string, TaskName[]>Record associating each sight with a list of tasks to execute for it. If not provided, the default tasks of the sight will be used.
resolutionCameraResolutionIndicates the resolution of the pictures taken by the Camera.CameraResolution.UHD_4K
allowImageUpscalingbooleanAllow images to be scaled up if the device does not support the specified resolution in the resolution prop.false
formatCompressionFormatThe output format of the compression.CompressionFormat.JPEG
qualitynumberValue indicating image quality for the compression output.0.6
allowSkipRetakebooleanIf compliance is enabled, this prop indicate if the user is allowed to skip the retaking process if some pictures are not compliant.false
enableCompliancebooleanIndicates if compliance checks should be enabled or not.true
enableCompliancePerSightstring[]Array of Sight IDs that indicates for which sight IDs the compliance should be enabled.
complianceIssuesComplianceIssue[]If compliance checks are enabled, this property can be used to select a list of compliance issues to check.DEFAULT_COMPLIANCE_ISSUES
complianceIssuesPerSightRecord<string, ComplianceIssue[]>A map associating Sight IDs to a list of compliance issues to check.
useLiveCompliancebooleanIndicates if live compliance should be enabled or not.false
customComplianceThresholdsCustomComplianceThresholdsCustom thresholds that can be used to modify the strictness of the compliance for certain compliance issues.
customComplianceThresholdsPerSightRecord<string, CustomComplianceThresholds>A map associating Sight IDs to custom compliance thresholds.

Live Configs

MonkJs will soon offer a way to set up live configurations in your web applications that will allow you to configure the SDK on the go without having to re-deploy your app. This feature is still in development.