diff --git a/autogpt_platform/frontend/.env.example b/autogpt_platform/frontend/.env.example index 0fe0b7540292..9b843a754c40 100644 --- a/autogpt_platform/frontend/.env.example +++ b/autogpt_platform/frontend/.env.example @@ -2,6 +2,7 @@ NEXT_PUBLIC_AUTH_CALLBACK_URL=http://localhost:8006/auth/callback NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/api NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://localhost:8015/api/v1/market +NEXT_PUBLIC_APP_ENV=dev ## Supabase credentials @@ -15,4 +16,4 @@ AUTH_CALLBACK_URL=http://localhost:3000/auth/callback GA_MEASUREMENT_ID=G-FH2XK2W4GN # When running locally, set NEXT_PUBLIC_BEHAVE_AS=CLOUD to use the a locally hosted marketplace (as is typical in development, and the cloud deployment), otherwise set it to LOCAL to have the marketplace open in a new tab -NEXT_PUBLIC_BEHAVE_AS=LOCAL \ No newline at end of file +NEXT_PUBLIC_BEHAVE_AS=LOCAL diff --git a/autogpt_platform/frontend/src/components/nav/MarketPopup.tsx b/autogpt_platform/frontend/src/components/nav/MarketPopup.tsx index bdb5d1bee026..c04c32ecc3e2 100644 --- a/autogpt_platform/frontend/src/components/nav/MarketPopup.tsx +++ b/autogpt_platform/frontend/src/components/nav/MarketPopup.tsx @@ -7,7 +7,15 @@ interface MarketPopupProps extends ButtonHTMLAttributes { export default function MarketPopup({ className = "", - marketplaceUrl = "http://platform.agpt.co/marketplace", + marketplaceUrl = (() => { + if (process.env.NEXT_PUBLIC_APP_ENV === "prod") { + return "https://production-marketplace-url.com"; + } else if (process.env.NEXT_PUBLIC_APP_ENV === "dev") { + return "https://dev-builder.agpt.co/marketplace"; + } else { + return "http://localhost:3000/marketplace"; + } + })(), children, ...props }: MarketPopupProps) {