Now that you've successfully created your Supabase project, the next crucial step is to get the information you need to connect to your database. This information acts like the 'keys' to your data kingdom, allowing your applications to read from and write to your Supabase database. Supabase provides these details conveniently within your project's dashboard.
Here's how to find your essential database connection details:
- Navigate to your Project Dashboard: After logging into Supabase, you'll see a list of your projects. Click on the project you just created to open its dashboard.
- Locate the 'API' Section: In the left-hand sidebar of your project dashboard, you'll find a section labeled 'API'. Click on it.
- Find the 'URL' and 'anon key': Within the 'API' section, you'll see two primary pieces of information you need for client-side connections:
graph TD
A[Supabase Project Dashboard] --> B(API Section)
B --> C(Project URL)
B --> D(Anonymous Key (anon key))
- Project URL: This is the endpoint of your Supabase API. It will look something like
https://your-project-ref.supabase.co. - Anonymous Key (anon key): This is your public API key. It's safe to expose this key in your client-side applications because it grants read-only access to your public data and allows for unauthenticated writes if you configure your Row Level Security (RLS) policies to allow it. It's a long string of characters.
- Discover the 'Database' Credentials for Server-Side Use: For server-side applications or when you need full administrative access, you'll need more detailed database credentials. These are also found within the 'API' section, often under a subsection related to database credentials or direct database access.
- Database URL (PostgreSQL connection string): This is a more detailed URL that includes the database host, port, database name, username, and password. It typically follows the format:
postgresql://USER:PASSWORD@HOST:PORT/DATABASE. - Username: The username for accessing your database.
- Password: The password for accessing your database. Treat this password with the same care as you would any sensitive credential. Do not expose it in client-side code.