Nextbase Project Environment Variables

Supabase Configuration

The Nextbase project relies on Supabase for its backend services. Configure the following environment variables to enable integration with Supabase.

SUPABASE_PROJECT_REF

  • Type: String
  • Required: Yes
  • Default: SUPABASE_PROJECT_REF

A unique reference identifier for your Supabase project.

SUPABASE_PROJECT_REF=SUPABASE_PROJECT_REF

NEXT_PUBLIC_SUPABASE_URL

  • Type: String
  • Required: Yes
  • Default: NEXT_PUBLIC_SUPABASE_URL

The public URL of your Supabase project.

NEXT_PUBLIC_SUPABASE_URL=NEXT_PUBLIC_SUPABASE_URL

NEXT_PUBLIC_SUPABASE_ANON_KEY

  • Type: String

  • Required: Yes

  • Default: NEXT_PUBLIC_SUPABASE_ANON_KEY

    The public anonymous key for accessing your Supabase project.

NEXT_PUBLIC_SUPABASE_ANON_KEY=NEXT_PUBLIC_SUPABASE_ANON_KEY

SUPABASE_SERVICE_ROLE_KEY

  • Type: String

  • Required: Yes

  • Default: SUPABASE_SERVICE_ROLE_KEY

    The service role key for your Supabase project.

SUPABASE_SERVICE_ROLE_KEY=SUPABASE_SERVICE_ROLE_KEY

SUPABASE_JWT_SECRET

  • Type: String

  • Required: Yes

  • Default: SUPABASE_JWT_SECRET

    The JWT secret for secure communication with Supabase.

SUPABASE_JWT_SECRET=SUPABASE_JWT_SECRET

Stripe Configuration Integrate your Nextbase project with Stripe for payment processing by configuring the following environment variables.

STRIPE_SECRET_KEY

  • Type: String

  • Required: Yes

  • Default: STRIPE_SECRET_KEY

    The secret key for authenticating requests to the Stripe API.

STRIPE_SECRET_KEY=STRIPE_SECRET_KEY

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

  • Type: String

  • Required: Yes

  • Default: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

    The public key used for client-side interactions with Stripe.

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

STRIPE_WEBHOOK_SECRET

  • Type: String

  • Required: Yes

  • Default: STRIPE_WEBHOOK_SECRET

    The webhook secret for handling events from Stripe.

STRIPE_WEBHOOK_SECRET=STRIPE_WEBHOOK_SECRET

STRIPE_WEBHOOK_SECRET_LIVE

  • Type: String

  • Required: Yes

  • Default: STRIPE_WEBHOOK_SECRET_LIVE

    The live webhook secret for handling events from Stripe in a production environment.

STRIPE_WEBHOOK_SECRET_LIVE=STRIPE_WEBHOOK_SECRET_LIVE

Host Configuration Configure the host-related environment variables for your Nextbase project.

NEXT_PUBLIC_SITE_URL

  • Type: String

  • Required: Yes

  • Default: NEXT_PUBLIC_SITE_URL

    The public URL of your Nextbase site.

NEXT_PUBLIC_SITE_URL=NEXT_PUBLIC_SITE_URL

Email Configuration Configure email-related environment variables for your Nextbase project.

ADMIN_EMAIL

  • Type: String

  • Required: Yes

  • Default: ADMIN_EMAIL

    The email address of the administrator.

ADMIN_EMAIL=ADMIN_EMAIL

RESEND_API_KEY

  • Type: String

  • Required: Yes

  • Default: RESEND_API_KEY

    The RESEND_API_KEY is an API key specifically designated for the functionality related to email resending within the Nextbase project. Email resending is a feature commonly implemented in web applications to allow users to request the re-sending of certain emails, such as account activation emails, password reset emails, or verification emails.

RESEND_API_KEY=RESEND_API_KEY

Analytics Configuration Enable analytics for your Nextbase project by configuring the following environment variables.

NEXT_PUBLIC_POSTHOG_API_KEY

  • Type: String

  • Required: No

  • Default: NEXT_PUBLIC_POSTHOG_API_KEY

    PostHog is an open-source product analytics tool. It helps you understand how users interact with your application by providing event tracking, session recording, feature flags, and more.

NEXT_PUBLIC_POSTHOG_API_KEY=NEXT_PUBLIC_POSTHOG_API_KEY

NEXT_PUBLIC_POSTHOG_APP_ID

  • Type: String

  • Required: No

  • Default: NEXT_PUBLIC_POSTHOG_APP_ID

    The app ID for PostHog analytics integration.

NEXT_PUBLIC_POSTHOG_APP_ID=NEXT_PUBLIC_POSTHOG_APP_ID

NEXT_PUBLIC_POSTHOG_HOST

  • Type: String

  • Required: No

  • Default: NEXT_PUBLIC_POSTHOG_HOST

    The host URL for PostHog analytics integration.

NEXT_PUBLIC_POSTHOG_HOST=NEXT_PUBLIC_POSTHOG_HOST

NEXT_PUBLIC_GA_ID

  • Type: String

  • Required: No

  • Default: NEXT_PUBLIC_GA_ID

    The Google Analytics (GA) ID for tracking.

NEXT_PUBLIC_GA_ID=NEXT_PUBLIC_GA_ID

Unkey is an open source API authentication and authorization platform for scaling user facing APIs. Create, verify, and manage low latency API keys in seconds

UNKEY_ROOT_KEY

  • Type: String

  • Required: No

  • Default: UNKEY_ROOT_KEY

    The root key for Unkey integration.

UNKEY_ROOT_KEY=UNKEY_ROOT_KEY

UNKEY_API_ID

  • Type: String

  • Required: No

  • Default: UNKEY_API_ID

    The API ID for Unkey integration.

UNKEY_API_ID=UNKEY_API_ID

Note on Security Keep your .env file secure and do not expose sensitive information. Do not include the .env file in version control to prevent accidental exposure of sensitive data.

Example Usage Create a .env file at the root of your project and add the necessary variables:

SUPABASE_PROJECT_REF=SUPABASE_PROJECT_REF
NEXT_PUBLIC_SUPABASE_URL=NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY=SUPABASE_SERVICE_ROLE_KEY
SUPABASE_JWT_SECRET=SUPABASE_JWT_SECRET
STRIPE_SECRET_KEY=STRIPE_SECRET_KEY
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
STRIPE_WEBHOOK_SECRET=STRIPE_WEBHOOK_SECRET
STRIPE_WEBHOOK_SECRET_LIVE=STRIPE_WEBHOOK_SECRET_LIVE
NEXT_PUBLIC_SITE_URL=NEXT_PUBLIC_SITE_URL
ADMIN_EMAIL=ADMIN_EMAIL
RESEND_API_KEY=RESEND_API_KEY
NEXT_PUBLIC_POSTHOG_API_KEY=NEXT_PUBLIC_POSTHOG_API_KEY
NEXT_PUBLIC_POSTHOG_APP_ID=NEXT_PUBLIC_POSTHOG_APP_ID
NEXT_PUBLIC_POSTHOG_HOST=NEXT_PUBLIC_POSTHOG_HOST
NEXT_PUBLIC_GA_ID=NEXT_PUBLIC_GA_ID
UNKEY_ROOT_KEY=UNKEY_ROOT_KEY
UNKEY_API_ID=UNKEY_API_ID