> ## Documentation Index
> Fetch the complete documentation index at: https://docs.harbinge.rs/llms.txt
> Use this file to discover all available pages before exploring further.

# Scanner Settings

> Configure how Forager handles barcode input on enterprise scanner devices

Forager supports hardware barcode scanners (Zebra DataWedge, Honeywell DataCollection) in addition to the device camera. The Scanner Input settings control which input method the app uses.

## Where to find it

Scanner settings are in the **Forager Android app**. You must be logged in as an admin.

From the home screen: tap your profile avatar → **Admin** → expand the **Scanner Input** section.

## Input modes

| Mode         | Behavior                                                                                                                                                                                    |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Auto**     | The app checks for Zebra or Honeywell packages at startup. On a device with a hardware scanner, the hardware trigger is used. On a standard phone, the camera is used. This is the default. |
| **Camera**   | Always uses the device camera, regardless of device type.                                                                                                                                   |
| **Hardware** | Always uses the hardware trigger. The camera preview is hidden and techs see "Waiting for scan…" instead.                                                                                   |

**When to use Hardware mode:**

* You have a dedicated fleet of Zebra or Honeywell devices and want to enforce consistent behavior
* Camera use is restricted in your environment (e.g., hospital security policy)
* You want to eliminate the camera preview entirely to reduce UI confusion for techs

**When to use Auto:** Mixed fleets where some techs have scanner devices and others use standard phones. Each device will use the appropriate input method without any per-device configuration.

## Camera fallback (Hardware mode only)

When input mode is set to **Hardware**, you can optionally enable the **Allow camera fallback** toggle. When enabled, techs will see a **"Use camera instead"** button on the scan screen, letting them fall back to the camera for barcodes the hardware scanner has difficulty reading (e.g., damaged labels, unusual symbologies).

Leave this off if you need to enforce hardware-only scanning at all times.

## DataWedge configuration (Zebra devices)

Forager automatically creates a DataWedge profile on first launch on Zebra devices. The profile configures DataWedge to send scanned barcodes to Forager via broadcast intent. No manual configuration is required.

If your IT policy requires managing DataWedge profiles centrally, you can create the profile manually instead:

1. Open **DataWedge** on the device
2. Create a new profile and associate it with the **Forager** app
3. Under **Intent Output**, enable it and set:
   * **Intent action:** `com.forager.ACTION_SCAN`
   * **Intent delivery:** Broadcast intent
4. Disable the auto-created Forager profile or delete it to avoid conflicts

If both profiles exist simultaneously, scans may fire twice. Keep only one active profile.

## Device-level override (in-app admin)

Admins can view and override the scanner mode on any individual device from inside the Forager app. This is useful for troubleshooting a specific device without changing the company-wide default.

From the home screen: tap your profile avatar → **Admin** → expand the **Scanner Input** section.

The card shows the current effective mode for that device. Use the **Override** button to force a specific mode, or **Reset** to return to the company default. The override applies only to the device you are holding.

## Company-level default

Admins can set a default scanner mode that applies to all devices in your organization. This default is synced from the server at login, so techs always pick up the company policy automatically — no per-device configuration needed.

To set the company default, update `scanner_mode` on your company's row:

```sql theme={null}
UPDATE companies
SET scanner_mode = 'hardware'  -- 'auto', 'camera', or 'hardware'
WHERE id = '<your-company-id>';
```

<Note>
  A dashboard UI for company-level scanner mode is planned. Until then, use the SQL above via the Supabase dashboard or contact Harbinge.rs support to set it for you.
</Note>

## Text scanning — company-wide regex

When techs use Text Label (OCR) mode, the app validates scanned text against a regular expression before treating it as a valid asset tag. This prevents the scanner from picking up stray text in the environment.

**Priority order:**

1. If the tech has typed their own prefix chips (e.g. `F3-`, `MED-`), those take precedence.
2. If no chips are set, the app falls back to your company-wide regex.
3. If no company regex is set, the app uses a safe default: `^[A-Z0-9-]{4,20}$`.

To set a company-wide regex fallback:

```sql theme={null}
UPDATE companies
SET scanner_mode_regex = '^(INV|EQ|MED)-[0-9]{4,6}$'
WHERE id = '<your-company-id>';
```

Replace the example pattern with your own. Standard regex syntax applies — the pattern is anchored automatically.

<Note>
  A dashboard UI for this setting is planned. Until then, use the SQL above or contact Harbinge.rs support.
</Note>

## What techs see on first use

The first time a tech opens the app on a device where hardware scanner mode is active (either from the company default or a device override), a notification appears at the bottom of the home screen:

> **Hardware scanner mode active — use your trigger to scan**

This notification appears once and does not repeat. It is intended to orient techs who may not have used the hardware trigger before.

If a tech does not see this notification and is unsure whether hardware mode is enabled, they can check under profile → Admin → Scanner Input, or look at the scan screen — hardware mode shows **"Waiting for scan…"** instead of a camera preview.
