VIN Insight

PILOT extension for decoding vehicle VINs through a Cloudflare Worker proxy.

Overview

VIN Insight adds a PILOT navigation tab with a vehicle tree and a main panel for decoded VIN data. It loads vehicles from PILOT, lets each user save their own auto.dev API key in browser localStorage, sends selected VINs to a Cloudflare Worker endpoint, and displays both a readable summary and the raw JSON response.

Files

File Purpose
index.html Cloudflare assets-root marker and simple landing page.
Module.js PILOT extension entry point. Defines Store.vininsight.Module.
_worker.js Cloudflare Worker proxy for auto.dev VIN decode requests.
doc/index.html This static documentation page.

Data Sources

PILOT Vehicles

The vehicle tree is loaded from the standard PILOT endpoint:

GET /ax/tree.php?vehs=1&state=1

auto.dev VIN Decode

The Worker calls the auto.dev v2 VIN endpoint with the API key supplied by the current browser user:

GET https://api.auto.dev/vin/{vin}
Authorization: Bearer USER_API_KEY
Each user clicks API key in the VIN Insight toolbar and saves their key locally. The Worker does not store API keys.

Cloudflare Worker Proxy

The extension calls:

/store/vininsight/api/vin/{VIN}

After PILOT registration, that path is proxied to the hosted Cloudflare Worker route:

https://YOUR-WORKER.workers.dev/api/vin/{VIN}

The Worker also exposes a health endpoint:

GET /api/health

Deployment

  1. Create a Cloudflare Worker that uses the included _worker.js code.
  2. Attach this folder as static assets so /Module.js and /doc/index.html are served.
  3. Open https://YOUR-WORKER.workers.dev/Module.js and confirm JavaScript source is shown.
  4. Open https://YOUR-WORKER.workers.dev/api/health and confirm it returns ok: true.
  5. Register the base URL in PILOT, for example https://YOUR-WORKER.workers.dev/.
  6. Use the PILOT extension name vininsight.
Do not register the Module.js URL itself. Register the base URL with a trailing slash.

Using the Extension

  1. Open the VIN Insight tab in PILOT.
  2. Click API key, enter your auto.dev API key, and save it for this browser.
  3. Select a vehicle from the tree.
  4. Click Decode selected VIN.
  5. Open a vehicle editor and use Decode VIN there to fill editable vehicle fields before saving.
  6. Use Test proxy to check the Worker with the sample VIN.

Troubleshooting

Problem Check
Module.js returns 404 Upload the contents of the vininsight folder as the assets root, not a parent folder.
Proxy says API key is required Click API key in the extension toolbar and save a valid auto.dev API key.
VIN decode returns 400 VINs must be 17 characters and cannot include I, O, or Q.
No vehicles are shown Check PILOT permissions and verify /ax/tree.php?vehs=1&state=1 returns vehicles.