mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 13:27:36 +00:00
docs[patch]: properly load/use env vars (#18942)
This commit is contained in:
parent
0d888a65cb
commit
578e67c017
@ -338,9 +338,8 @@ const config = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
customFields: {
|
customFields: {
|
||||||
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY:
|
supabasePublicKey: process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
|
||||||
process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
|
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||||
NEXT_PUBLIC_SUPABASE_URL: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable no-return-assign, react/jsx-props-no-spreading */
|
/* eslint-disable no-return-assign, react/jsx-props-no-spreading */
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { createClient } from "@supabase/supabase-js";
|
import { createClient } from "@supabase/supabase-js";
|
||||||
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
||||||
|
|
||||||
const useCookie = () => {
|
const useCookie = () => {
|
||||||
/**
|
/**
|
||||||
@ -110,6 +111,7 @@ const getIpAddress = async () => {
|
|||||||
export default function Feedback() {
|
export default function Feedback() {
|
||||||
const { setCookie, checkCookie } = useCookie();
|
const { setCookie, checkCookie } = useCookie();
|
||||||
const [feedbackSent, setFeedbackSent] = useState(false);
|
const [feedbackSent, setFeedbackSent] = useState(false);
|
||||||
|
const { siteConfig } = useDocusaurusContext();
|
||||||
|
|
||||||
/** @param {"good" | "bad"} feedback */
|
/** @param {"good" | "bad"} feedback */
|
||||||
const handleFeedback = async (feedback) => {
|
const handleFeedback = async (feedback) => {
|
||||||
@ -125,8 +127,8 @@ export default function Feedback() {
|
|||||||
|
|
||||||
/** @type {Database} */
|
/** @type {Database} */
|
||||||
const supabase = createClient(
|
const supabase = createClient(
|
||||||
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
siteConfig.customFields.supabaseUrl,
|
||||||
process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY
|
siteConfig.customFields.supabasePublicKey
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
const ipAddress = await getIpAddress();
|
const ipAddress = await getIpAddress();
|
||||||
|
Loading…
Reference in New Issue
Block a user