feat: accept KV_REST_API_* env vars as Upstash fallback

Vercel Marketplace Upstash integration injects KV_REST_API_URL and
KV_REST_API_TOKEN — different names from vanilla Upstash signup
(UPSTASH_REDIS_REST_URL / UPSTASH_REDIS_REST_TOKEN). Adapter and
migration script now accept either form, so the operator doesn't have
to duplicate values when sharing an Upstash DB provisioned via the
Vercel integration. UPSTASH_* takes precedence when both are set.
This commit is contained in:
tiennm99 committed 2026-05-09 20:17:06 +07:00
1 parent a5af074062
commit cad84e21a4
4 files changed
+24 -12

No files matched your search

+3 -1
View File
@@ -10,7 +10,9 @@ TELEGRAM_WEBHOOK_SECRET=
# Variable name kept as WORKER_URL for register-webhook.js compatibility.
WORKER_URL=https://store-scraper-bot.vercel.app/api/webhook
# Upstash Redis credentials — required by migrate-atlas-to-upstash.js
# Upstash Redis credentials — required by migrate-atlas-to-upstash.js.
# If the Vercel Marketplace Upstash integration is set up, the bot also
# accepts KV_REST_API_URL / KV_REST_API_TOKEN as fallbacks (see upstash.js).
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
KEY_PREFIX=store-scraper-bot: