Adding a public value: Free AI Prompt | SheCodes

Free AI prompt · The Code Book

Adding a public value

A ready-to-use prompt from the chapter Environment Variables. Paste it into Claude, ChatGPT, Lovable, Bolt or any AI coding tool.

The prompt

“I need to add my website URL as an environment variable that my front-end can access. This isn't a secret, so it should use the NEXT_PUBLIC_ prefix.”

How to use it

  1. Copy the prompt and paste it into your AI coding tool.
  2. Check the result in the preview, then ask for changes one at a time: "make the buttons bigger", "use my brand colours".
  3. Read the chapter to understand why it works and what to do next.

More prompts like this

All prompts

Setting up a new secret

“I need to add a Stripe payment key to my app. Create a .env.local file if one doesn't exist, add the Stripe secret key variable, and make sure .env.local is in .gitignore so it doesn't get uploaded to GitHub.”

Connecting a database

“I have a database URL from Supabase (or Neon, PlanetScale, etc.). Add it as an environment variable in my project. It should be a server-only secret, not visible to website visitors.”

Checking your setup is safe

“Review my project and make sure no secret keys or passwords are hardcoded in the source code. All secrets should be in .env.local, and .env.local should be in .gitignore. Also check that no secret variables have NEXT_PUBLIC_ in their name.”

Set up env variables

“Set up environment variables for my Next.js app. I need to store API keys for [Supabase/Stripe/Resend]. Show me the .env.local file and how to access them in my code.”

Set up a frontend project

“Set up a new Next.js project with TypeScript, Tailwind CSS, and App Router. Create a clean homepage with a [header/hero/features] layout.”