.env.local file in the project root before running the development server or deploying.
Variables
The base URL of your Supabase project (e.g.,
https://abcdefgh.supabase.co). Exposed to the browser because it is prefixed with NEXT_PUBLIC_.The anonymous (public) API key for your Supabase project. Safe to expose in client-side code; access is still governed by row-level security policies.
The service role key that bypasses RLS. Used exclusively in server-side API routes under
/api/admin/. Never prefix this with NEXT_PUBLIC_ — doing so would expose it to the browser and grant any visitor full database access.The URL path segment for the admin dashboard. Change this to an unpredictable value (e.g.,
/portal-9921) to obscure the admin entry point from casual discovery.Optional. Your Tawk.to property ID for embedding the live chat widget. Leave empty to disable the widget.
Optional. Your Tawk.to widget ID. Required alongside
NEXT_PUBLIC_TAWK_PROPERTY_ID for the chat widget to load..env.local template
Copy this into.env.local at the project root and fill in your values:
.env.local
You can find
NEXT_PUBLIC_SUPABASE_URL and both API keys in the Supabase Dashboard under Project Settings → API. The anon key is listed as “anon public” and the service role key is listed as “service_role secret”.Setting variables in Vercel
When deploying to Vercel, environment variables are set in the Vercel dashboard rather than in a file.Open your project in the Vercel dashboard
Navigate to vercel.com, select your project, then click the Settings tab.
Add each variable
Enter the variable name and value, select which environments it applies to (Production, Preview, Development), and click Save.