Preoc Product Manager reads two environment variables at startup.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sergio-salcedo-dev/excel-product-manager/llms.txt
Use this file to discover all available pages before exploring further.
GEMINI_API_KEY (server-side) and its client-exposed counterpart NEXT_PUBLIC_GEMINI_API_KEY together enable the AI-powered CYPE Precios and Mercado product lookups powered by Google Gemini, while APP_URL tells the application where it is hosted — used for self-referential links, OAuth callbacks, and internal API endpoints. Both variables must be present before starting the development server or deploying to production.
Environment File Template
The.env.example file at the project root shows the canonical variable names used by the application:
.env.example
.env.local file at the project root. Because ProductDashboard.tsx calls the Gemini API from a client-side React component, the key must carry the NEXT_PUBLIC_ prefix so Next.js includes it in the browser bundle:
.env.local
Variable Reference
Google Gemini API key used by the CYPE Precios and Mercado AI search features. This is the server-side name used in the
.env.example template and injected automatically by Google AI Studio at runtime from the user’s Secrets panel.The same Gemini API key exposed to the browser bundle. Must be prefixed with
NEXT_PUBLIC_ so Next.js includes it in the client-side JavaScript — ProductDashboard.tsx reads process.env.NEXT_PUBLIC_GEMINI_API_KEY directly. Use this name in your local .env.local file. Obtain your key from Google AI Studio.The URL where the application is hosted. Defaults to
http://localhost:3000 for local development. In production environments such as Firebase App Hosting, this value is automatically injected at runtime as the Cloud Run service URL — no manual configuration is needed.Why Two Variable Names Exist
The
.env.example template defines GEMINI_API_KEY — the name Google AI Studio uses when it injects the key automatically from the Secrets panel at runtime. However, ProductDashboard.tsx accesses the key from a client-side React component using process.env.NEXT_PUBLIC_GEMINI_API_KEY. Next.js only exposes environment variables to the browser when their names start with NEXT_PUBLIC_; any variable without this prefix is available only in server-side contexts such as Route Handlers, Server Components, and next.config.ts. For local development you therefore set NEXT_PUBLIC_GEMINI_API_KEY in .env.local, while AI Studio handles its own server-side injection under the GEMINI_API_KEY name separately.Getting a Gemini API Key
Open Google AI Studio
Navigate to https://aistudio.google.com in your browser.
Sign in
Sign in with a Google account. A free tier is available with generous usage limits suitable for development and small-scale production use.
Create a key
Click Create API key, choose or create a Google Cloud project when prompted, and copy the generated key string.
Security Considerations
Google AI Studio Automatic Injection
When the application is deployed on Google AI Studio, the Gemini API key is automatically injected at runtime from the user’s Secrets panel under the name
GEMINI_API_KEY. You do not need to configure the key manually in that environment — AI Studio handles injection transparently. Note that this server-side injection uses the GEMINI_API_KEY name from .env.example, not the NEXT_PUBLIC_ prefixed variant required for local client-side access.