Getting Started
Environment Variables

Environment Variables

All variables go in .env.local (local dev) or Vercel project settings (production). Variables prefixed with NEXT_PUBLIC_ are exposed to the browser.

Supabase

VariableRequiredDescription
NEXT_PUBLIC_SUPABASE_URLYour Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anon/public key
SUPABASE_SERVICE_ROLE_KEYService role key (server-side only)

U300 RFID Reader

These are global fallbacks. Per-location values set in the UI take precedence.

VariableDefaultDescription
U300_WEBAPI_URLBase URL of the U300 relay APK, e.g. http://192.168.1.100:5000
NEXT_PUBLIC_U300_WEBAPI_URLSame as above but available client-side
U300_RELAY_TOKENBearer token for authenticating with the relay APK
U300_API_TOKENAlias for U300_RELAY_TOKEN
U300_WEBAPI_TOKENAlias for U300_RELAY_TOKEN
U300_INGEST_ENDPOINT_URLURL the relay POSTs tag data to, e.g. https://your-app.vercel.app/api/rfid/u300/ingest
U300_INGEST_POLL_MS1000How often (ms) the relay polls the reader. Min 300, max 10000
U300_RF_LINK1RF link profile (0–25). 1 = PR ASK / Miller4 / 250 kHz (recommended for sensor reads)
U300_ANTENNA_POWER20Antenna TX power (1–30 dBm). 30 = maximum

RFID Ingest

VariableRequiredDescription
RFID_INGEST_KEYSecret key the relay sends with every ingest POST. Must match on both sides
VISION_API_KEYAlias for RFID_INGEST_KEY

Moisture Sensing

VariableDefaultDescription
RFID_TAG_FAMILYAZN3120-AFRDefault tag family name (must match a row in rfid_tag_families)
RFID_SKIP_TID_READStrueSet to false only if mixing sensor and non-sensor tags on the same antenna

Shared RFID

VariableDescription
RFID_KILL_PASSWORD_HEX8-character hex kill password for tag decommissioning
RFID_KILL_PASSWORDAlias for RFID_KILL_PASSWORD_HEX

R1 Reader

VariableDescription
R1_WEBAPI_URLBase URL of the R1 reader service
NEXT_PUBLIC_R1_WEBAPI_URLClient-side alias

CP30 Printer

VariableDescription
CP30_WEBAPI_URLBase URL of the CP30 label printer service

Priority order

For every RFID setting, the resolution order is:

  1. Per-location DB value (set via RFID settings UI — highest priority)
  2. Environment variable (.env.local or Vercel settings)
  3. Hardcoded default (lowest priority)

This means a venue can override any global env var by saving a value through the UI.