Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(docs-gpt): update env variable names

Greg Richardson33c376486fb7
diff --git a/apps/docs/scripts/generate-embeddings.ts b/apps/docs/scripts/generate-embeddings.ts
index d0cafa09e73..0b5f3e033a0 100644
--- a/apps/docs/scripts/generate-embeddings.ts
+++ b/apps/docs/scripts/generate-embeddings.ts
@@ -185,18 +185,18 @@ async function walk(dir: string): Promise<string[]> {
async function generateEmbeddings() {
if (
- !process.env.DOCS_SEARCH_SUPABASE_URL ||
- !process.env.DOCS_SEARCH_SUPABASE_SERVICE_KEY ||
+ !process.env.NEXT_PUBLIC_SUPABASE_URL ||
+ !process.env.META_SUPABASE_SERVICE_KEY ||
!process.env.OPENAI_KEY
) {
return console.log(
- 'Environment variables DOCS_SEARCH_SUPABASE_URL, DOCS_SEARCH_SUPABASE_SERVICE_KEY, and OPENAI_KEY are required: skipping embeddings generation'
+ 'Environment variables NEXT_PUBLIC_SUPABASE_URL, META_SUPABASE_SERVICE_KEY, and OPENAI_KEY are required: skipping embeddings generation'
)
}
const supabaseClient = createClient(
- process.env.DOCS_SEARCH_SUPABASE_URL,
- process.env.DOCS_SEARCH_SUPABASE_SERVICE_KEY
+ process.env.NEXT_PUBLIC_SUPABASE_URL,
+ process.env.META_SUPABASE_SERVICE_KEY
)
const markdownFiles = (await walk('pages'))
diff --git a/supabase/config.toml b/supabase/config.toml
index 6cc8fccdc86..7b1702d2d8e 100644
--- a/supabase/config.toml
+++ b/supabase/config.toml
@@ -1,6 +1,6 @@
# A string used to distinguish different Supabase projects on the same host. Defaults to the working
# directory name when running `supabase init`.
-project_id = "docs"
+project_id = "supabase"
[api]
# Port to use for the API URL.
diff --git a/supabase/functions/clippy-search/index.ts b/supabase/functions/clippy-search/index.ts
index 9fa200524bf..1160f43ce3c 100644
--- a/supabase/functions/clippy-search/index.ts
+++ b/supabase/functions/clippy-search/index.ts
@@ -5,8 +5,8 @@ import GPT3Tokenizer from 'https://esm.sh/[email protected]'
import { Configuration, OpenAIApi } from 'https://esm.sh/[email protected]'
const openAiKey = Deno.env.get('OPENAI_KEY')
-const supabaseUrl = Deno.env.get('DOCS_SEARCH_SUPABASE_URL')
-const supabaseServiceKey = Deno.env.get('DOCS_SEARCH_SUPABASE_SERVICE_KEY')
+const supabaseUrl = Deno.env.get('META_SUPABASE_URL')
+const supabaseServiceKey = Deno.env.get('META_SUPABASE_SERVICE_KEY')
export const corsHeaders = {
'Access-Control-Allow-Origin': '*',
@@ -34,7 +34,7 @@ serve(async (req) => {
if (!supabaseUrl) {
return new Response(
JSON.stringify({
- error: 'Missing environment variable DOCS_SEARCH_SUPABASE_URL',
+ error: 'Missing environment variable META_SUPABASE_URL',
}),
{
status: 400,
@@ -46,7 +46,7 @@ serve(async (req) => {
if (!supabaseServiceKey) {
return new Response(
JSON.stringify({
- error: 'Missing environment variable DOCS_SEARCH_SUPABASE_SERVICE_KEY',
+ error: 'Missing environment variable META_SUPABASE_SERVICE_KEY',
}),
{
status: 400,
@@ -71,9 +71,7 @@ serve(async (req) => {
const { query } = requestData
- console.log(supabaseUrl, supabaseServiceKey)
-
- const supabaseClient = createClient('http://supabase_kong_docs:8000', supabaseServiceKey)
+ const supabaseClient = createClient(supabaseUrl, supabaseServiceKey)
const configuration = new Configuration({ apiKey: openAiKey })
const openai = new OpenAIApi(configuration)