Skip to content

Commit 7bda760

Browse files
committed
fix(shop): drop VITE_SHOPIFY_* — Netlify secrets scanner false positive
The cart refactor moved all Shopify Storefront API calls server-side (createServerFn), so VITE_SHOPIFY_* env vars are no longer consumed by any code path. Vite still statically substitutes import.meta.env with every VITE_* var set at build time, so if the deploy environment defines VITE_SHOPIFY_STORE_DOMAIN with the same value as the server SHOPIFY_STORE_DOMAIN, Netlify's secrets scanner matches the value inside the client bundle and fails the build. Removing the VITE_* entries from the client env schema (nothing references them) plus unsetting VITE_SHOPIFY_* in Netlify's env config resolves the scan without an allowlist.
1 parent bedc678 commit 7bda760

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/utils/env.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ const serverEnvSchema = v.object({
1515
RESEND_API_KEY: v.optional(v.string()),
1616
SENTRY_DSN: v.optional(v.string()),
1717
TANSTACK_MCP_ENABLED_TOOLS: v.optional(v.string()),
18+
// Shopify Storefront API — server-only. Cart reads and mutations run
19+
// through createServerFn (src/utils/shop.functions.ts), so the public
20+
// token is never exposed to the browser. The private token is preferred
21+
// for its higher rate limits; the public token is kept as an optional
22+
// fallback for environments where a private token isn't provisioned.
1823
SHOPIFY_STORE_DOMAIN: v.optional(v.string()),
1924
SHOPIFY_API_VERSION: v.optional(v.string(), '2026-01'),
2025
SHOPIFY_PUBLIC_STOREFRONT_TOKEN: v.optional(v.string()),
@@ -23,9 +28,6 @@ const serverEnvSchema = v.object({
2328

2429
const clientEnvSchema = v.object({
2530
URL: v.optional(v.string()),
26-
VITE_SHOPIFY_STORE_DOMAIN: v.optional(v.string()),
27-
VITE_SHOPIFY_API_VERSION: v.optional(v.string(), '2026-01'),
28-
VITE_SHOPIFY_PUBLIC_STOREFRONT_TOKEN: v.optional(v.string()),
2931
})
3032

3133
// Validate and parse environment variables

0 commit comments

Comments
 (0)