Skip to content

Conversation

@codewithtyler
Copy link

Description

Add missing NEXT_PUBLIC_* environment variables to Supabase Studio to enable client-side URL access and prevent redirect loops when accessing settings pages.

Changes

  • Add NEXT_PUBLIC_SUPABASE_URL environment variable to supabase-studio service in templates/compose/supabase.yaml
  • Add NEXT_PUBLIC_SUPABASE_ANON_KEY environment variable to supabase-studio service in templates/compose/supabase.yaml
  • These variables allow Next.js client-side code to access the public URL and API key, preventing redirect loops when accessing settings pages

Issues

Testing

  • Tested on fresh Supabase deployment (unable to test on Windows, requires Linux environment)
  • Configuration changes only (no code logic modified)
  • Variable names verified against:
    • Supabase documentation
    • Other Next.js services in Coolify templates (calcom, postiz, documenso)
    • Next.js environment variable conventions

Backwards Compatibility

  • Adding new environment variables only
  • No changes to existing variables or logic
  • No breaking changes

Add missing NEXT_PUBLIC_* environment variables to Supabase Studio
to enable client-side URL access and prevent redirect loops when
accessing settings pages.

- Add NEXT_PUBLIC_SUPABASE_URL for client-side routing
- Add NEXT_PUBLIC_SUPABASE_ANON_KEY for client-side API calls

Fixes coollabsio#5699
@zenoUsman
Copy link

zenoUsman commented Jan 6, 2026

Isn't it will be dangerous to add publicly the API keys ?? Also I think the anonkey already present in environmental variables when deploy the supabase it's auto generate it

@codewithtyler
Copy link
Author

The ANON_KEY is already auto-generated by Supabase in the existing template and is designed to be publicly exposed - that's why it's called the "anonymous" key. The NEXT_PUBLIC_ prefix is required for client-side JavaScript to access it, which is standard Supabase architecture. The security model relies on Row Level Security (RLS) policies, not on hiding the anon key. Without these client-side variables, the Supabase Studio dashboard cannot function, which is the bug this PR fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants