# Frontend (Vite) environment variables
# Copy to app/.env.local and fill in values as needed.
# Only VITE_-prefixed vars are exposed to the browser.
#
# Tags: [required] must be set, [optional] has a sensible default or can be blank

# [optional] App environment selector for default backend fallback: production | staging.
# Defaults to 'production' when unset. Uncomment to point the dev frontend at staging.
# VITE_OPENHUMAN_APP_ENV=staging

# [optional] Core RPC endpoint — build-time fallback only.
# Runtime precedence (highest first):
#   1. Login-screen RPC URL field (saved via `app/src/utils/configPersistence.ts`)
#   2. The Tauri `core_rpc_url` command (port the bundled sidecar listens on)
#   3. This `VITE_OPENHUMAN_CORE_RPC_URL` value
#   4. Hardcoded `http://127.0.0.1:7788/rpc`
# End users do not need to set this — they configure the URL on the login screen.
VITE_OPENHUMAN_CORE_RPC_URL=http://127.0.0.1:7788/rpc

# [optional] Backend API URL — web-only fallback.
# Desktop builds derive `api_url` at runtime from the core via
# `openhuman.config_resolve_api_url` after the RPC handshake succeeds, so this
# value only matters when the app runs outside Tauri (web preview, Storybook).
# Defaults to https://api.tinyhumans.ai (production); override only when you
# need a different backend (e.g. https://staging-api.tinyhumans.ai).
# VITE_BACKEND_URL=https://staging-api.tinyhumans.ai

# [optional] Telegram bot username used for managed DM linking fallback (default: openhuman_bot)
VITE_TELEGRAM_BOT_USERNAME=openhuman_bot

# [optional] Skills GitHub repository slug (default: tinyhumansai/openhuman-skills)
VITE_SKILLS_GITHUB_REPO=tinyhumansai/openhuman-skills

# [optional] Google Analytics 4 Measurement ID (e.g. G-XXXXXXXXXX).
# Leave blank to disable GA entirely. Analytics is also skipped in dev builds.
# Only anonymous page views and feature-engagement events are sent — no PII.
VITE_GA_MEASUREMENT_ID=

# [optional] Sentry DSN for error reporting (leave blank to disable)
VITE_SENTRY_DSN=

# [optional] Short git SHA baked into the frontend bundle for the canonical
# Sentry release tag `openhuman@<version>+<sha>`. CI sets this automatically
# from `needs.prepare-build.outputs.sha`; leave blank locally (release tag
# falls back to `openhuman@<version>`).
VITE_BUILD_SHA=

# [optional] One-shot Sentry pipeline smoke test. When `true`, the next
# `initSentry()` call dispatches a `react-sentry-smoke-test` event so you
# can confirm the DSN, source maps, and release tagging are wired
# end-to-end. Leave blank in normal builds.
# VITE_SENTRY_SMOKE_TEST=true

# [CI-only] Sentry source-map upload — set on CI to enable
# `@sentry/vite-plugin`. Leave blank locally; the plugin skips when
# `SENTRY_AUTH_TOKEN` is empty.
# SENTRY_AUTH_TOKEN=
# SENTRY_URL=  # https://sentry.tinyhumans.ai for self-hosted; defaults to sentry.io
# SENTRY_ORG=
# SENTRY_PROJECT=
# SENTRY_RELEASE=

# [optional] Dev-only: auto-inject JWT token to skip login flow
VITE_DEV_JWT_TOKEN=

# [optional] Dev-only: force onboarding flow to always show
VITE_DEV_FORCE_ONBOARDING=false

# [optional] Consumer first-session + home IA experiments (default off). See docs/plans/consumer-first-session-spec.md
# VITE_CONSUMER_FIRST_SESSION=true

# [optional] Client-side timeout for skill callTool/triggerSync (seconds; default 120, max 3600).
# Should match OPENHUMAN_TOOL_TIMEOUT_SECS on the core when set.
# VITE_TOOL_TIMEOUT_SECS=

# [optional] Per-request timeout for Core JSON-RPC `fetch()` calls, in milliseconds.
# Guards the UI against a hung sidecar by rejecting in-flight requests when the
# core stops responding. Bounded [1000, 600000]; default 30000.
# VITE_CORE_RPC_TIMEOUT_MS=30000

# [optional] Vite dev-server port for `pnpm dev:app:win` (read by both
# vite.config.ts and scripts/run-dev-win.sh). Default 1420. Override per
# worktree to avoid the hardcoded-1420 collision when running multiple
# dev:app:win sessions in parallel. The HMR companion websocket binds
# to (port + 1), so leave a 2-port gap between concurrent worktrees:
# 1420, 1422, 1424, …  When set to non-1420 the dev script also adds an
# inline `tauri dev -c '{"build":{"devUrl":...}}'` override.
# OPENHUMAN_DEV_PORT=1422

# [optional] Minimum desktop app semver to complete OAuth deep links (openhuman://oauth/success). Leave unset in dev.
# VITE_MINIMUM_SUPPORTED_APP_VERSION=0.51.0
# [optional] Download page when OAuth is blocked due to an outdated build (default: GitHub releases/latest).
# VITE_LATEST_APP_DOWNLOAD_URL=https://github.com/tinyhumansai/openhuman/releases/latest
