Refactor integrations logic and replace hardcoded client ids with envars

This commit is contained in:
Tuan Dang
2022-12-18 12:18:50 -05:00
parent 516819507a
commit 547555591b
17 changed files with 144 additions and 42 deletions
@@ -87,6 +87,7 @@ const CloudIntegration = ({
)
.map((authorization) => authorization._id)[0],
});
router.reload();
}}
className="cursor-pointer w-max bg-red py-0.5 px-2 rounded-b-md text-xs flex flex-row items-center opacity-0 group-hover:opacity-100 duration-200"
@@ -17,8 +17,6 @@ import getIntegrationApps from "../../pages/api/integrations/GetIntegrationApps"
import Button from "~/components/basic/buttons/Button";
import ListBox from "~/components/basic/Listbox";
// TODO: optimize laggy dropdown for app options
interface Integration {
app?: string;
environment: string;
@@ -4,6 +4,9 @@ const POSTHOG_HOST =
process.env.NEXT_PUBLIC_POSTHOG_HOST! || "https://app.posthog.com";
const STRIPE_PRODUCT_PRO = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_PRO!;
const STRIPE_PRODUCT_STARTER = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_STARTER!;
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL!;
const CLIENT_ID_HEROKU = process.env.NEXT_PUBLIC_CLIENT_ID_HEROKU!;
const CLIENT_ID_NETLIFY = process.env.NEXT_PUBLIC_CLIENT_ID_NETLIFY!;
export {
ENV,
@@ -11,4 +14,7 @@ export {
POSTHOG_HOST,
STRIPE_PRODUCT_PRO,
STRIPE_PRODUCT_STARTER,
};
SITE_URL,
CLIENT_ID_HEROKU,
CLIENT_ID_NETLIFY
};