AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Add URL swapping for marketplace based on environment (#8418)
Abhimanyu Yadavdce9bdd4889c
diff --git a/autogpt_platform/frontend/.env.example b/autogpt_platform/frontend/.env.exampleindex 0fe0b75402..9b843a754c 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/callbackNEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/apiNEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/wsNEXT_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/callbackGA_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=LOCALdiff --git a/autogpt_platform/frontend/src/components/nav/MarketPopup.tsx b/autogpt_platform/frontend/src/components/nav/MarketPopup.tsxindex bdb5d1bee0..c04c32ecc3 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<HTMLButtonElement> {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) {