docs[patch]: properly load/use env vars (#18942)

This commit is contained in:
Brace Sproul
2024-03-11 15:38:05 -07:00
committed by GitHub
parent 0d888a65cb
commit 578e67c017
2 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
/* eslint-disable no-return-assign, react/jsx-props-no-spreading */
import React, { useState, useEffect } from "react";
import { createClient } from "@supabase/supabase-js";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
const useCookie = () => {
/**
@@ -110,6 +111,7 @@ const getIpAddress = async () => {
export default function Feedback() {
const { setCookie, checkCookie } = useCookie();
const [feedbackSent, setFeedbackSent] = useState(false);
const { siteConfig } = useDocusaurusContext();
/** @param {"good" | "bad"} feedback */
const handleFeedback = async (feedback) => {
@@ -125,8 +127,8 @@ export default function Feedback() {
/** @type {Database} */
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY
siteConfig.customFields.supabaseUrl,
siteConfig.customFields.supabasePublicKey
);
try {
const ipAddress = await getIpAddress();