📎Setting Up Environment Variables

Prepare Your Development Environment :

Environment Variables:

To ensure seamless integration with necessary services, you'll need to configure environment variables in your project. Begin by creating a .env file in the root directory and populate it with the required keys and URLs.

  1. Creating the .env File:

    • Create a .env file in the root of your project directory.

  2. Populating the .env File:

    • Site URL: Set the local or production site URL.

    • Supabase URL: Add the URL of your Supabase project.

    • Supabase Anon Key: Include the anonymous key for interacting with the Supabase API.

    • Supabase Database URL: Provide the database connection string for connecting to your PostgreSQL database hosted on Supabase.

    • Supabase Service Role Key: This key allows server-side interactions with your database, bypassing Row Level Security. It should never be exposed in client-side code.

    • RESEND_API_KEY: This key allows you to send newsletter emails to your users.

# Fill with your environment-specific details
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
NEXT_PUBLIC_SUPABASE_URL=https://your-supabase-url.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_DATABASE_URL=postgres://your-db-user:your-db-password@your-db-host:6543/your-db-name?pgbouncer=true
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
DATABASE_DIRECT_URL=postgres://your-db-user:your-db-password@your-db-host:5432/your-db-name
RESEND_API_KEY=your-api-key

Ensure that each key and URL is correctly entered to facilitate proper connection and authentication to your Supabase services. This setup will enable your application to securely access and manage data as needed.

Last updated