How to get Supabase API Keys

30 September 2025



This blog shows exactly where to find the Supabase API keys in the dashboard and how to configure them in your project. Follow the steps below to safely access and store your keys.


1. Go to Supabase

Visit Supabase | The Postgres Development Platform. Register or sign up for a new account, and choose a strong database password as shown in Figure 1.


Figure 1
2. Navigate to Settings

In the left sidebar, navigate to Settings as shown in Figure 2.


Figure 2
3. Select API Keys

Under Settings, select API Keys as shown in Figure 3.


Figure 3


4. Copy Keys

Copy both the public and secret keys from the dashboard as shown in Figure 4.


Figure 4
5. Paste Keys in .env File

Add the copied values into your project’s .env file:


NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGci...anon...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGci...service_role...
  

These environment variables configure your Next.js app to connect with Supabase. Use the anon key on the client side, and keep the service_role key restricted to server-side code only.


THANK YOU