From f501dbdb590032e49bb3d8e65c5d1c3b2504b070 Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 08:40:06 +0000 Subject: [PATCH] fix: update promo CLI examples to use vercel env run The promo encrypt/decrypt script requires CREDIT_CATEGORIES_ENCRYPTION_KEY and other environment variables (like NEXTAUTH_SECRET) that are stored in Vercel. Update all usage examples and the CLI error message to include the 'vercel env run -e production --' prefix so the commands work correctly out of the box. --- src/lib/promoCreditCategories.ts | 2 +- src/scripts/encrypt-promo-codes.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/promoCreditCategories.ts b/src/lib/promoCreditCategories.ts index 2fb9a0698..beb4a57e6 100644 --- a/src/lib/promoCreditCategories.ts +++ b/src/lib/promoCreditCategories.ts @@ -327,7 +327,7 @@ const nonSelfServicePromos: readonly NonSelfServicePromoCreditCategoryConfig[] = * These are decrypted at runtime to build the actual selfServicePromos array. * * To add a new promo code: - * 1. Run: pnpm promo encrypt PROMO_CODE + * 1. Run: vercel env run -e production -- pnpm promo encrypt PROMO_CODE * 2. Copy the encrypted value and use in encrypted_credit_category */ const encryptedSelfServicePromos: readonly EncryptedSelfServicePromoCreditCategoryConfig[] = [ diff --git a/src/scripts/encrypt-promo-codes.ts b/src/scripts/encrypt-promo-codes.ts index e8ff92f06..f8eb6fdc5 100644 --- a/src/scripts/encrypt-promo-codes.ts +++ b/src/scripts/encrypt-promo-codes.ts @@ -2,8 +2,8 @@ * Script to encrypt or decrypt promo codes. * * Run with: - * pnpm promo encrypt - * pnpm promo decrypt <encrypted> + * vercel env run -e production -- pnpm promo encrypt <plaintext> + * vercel env run -e production -- pnpm promo decrypt <encrypted> * * Requires CREDIT_CATEGORIES_ENCRYPTION_KEY environment variable to be set. */ @@ -21,7 +21,7 @@ if (!CREDIT_CATEGORIES_ENCRYPTION_KEY) { const [operation, value] = process.argv.slice(2); if (!operation || !value) { - console.error('Usage: pnpm promo <encrypt|decrypt> <value>'); + console.error('Usage: vercel env run -e production -- pnpm promo <encrypt|decrypt> <value>'); process.exit(1); }