diff --git a/.env.example b/.env.example index c9098afa3..abaf4bf40 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ WEBHOOK_PROXY_URL= WEBHOOK_SECRET= SUPABASE_URL= -SUPABASE_KEY= +SUPABASE_ANON_KEY= # `fatal` `error` `info` `verbose` `debug` LOG_LEVEL=debug diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 045b04965..b74bb6247 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -39,7 +39,7 @@ jobs: # OPENAI_API_KEY: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} # SIMILARITY_THRESHOLD: - SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} + SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} SUPABASE_URL: ${{ secrets.SUPABASE_URL }} TEST_ADMIN_PAT: ${{ secrets.TEST_ADMIN_PAT }} TEST_ORGANIZATION_NAME: ${{ secrets.TEST_ORGANIZATION_NAME }} diff --git a/README.md b/README.md index b28c00cc2..302279f4a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ bun start:watch - Copy `.env.example` to `.env` (do not rename .env.example, just make a copy) - Update the following fields on `.env`: - `SUPABASE_URL`: Add your Supabase project URL. -- `SUPABASE_KEY`: Add your Supabase project API key. +- `SUPABASE_ANON_KEY`: Add your Supabase project API key. - `FOLLOWUP_TIME`: (optional) Set a custom follow-up time (default: 4 days). - `DISQUALIFY_TIME`: (optional) Set a custom disqualify time (default: 7 days). - `OPENAI_API_HOST`: (optional) Set OpenAI host url (default: https://api.openai.com). @@ -218,7 +218,7 @@ To test the bot, you can: ``` SUPABASE_URL="XXX" -SUPABASE_KEY="XXX" +SUPABASE_ANON_KEY="XXX" ``` diff --git a/src/adapters/adapters.ts b/src/adapters/adapters.ts index a0ccb9592..5b53d86b2 100644 --- a/src/adapters/adapters.ts +++ b/src/adapters/adapters.ts @@ -11,7 +11,7 @@ import { Wallet } from "./supabase/helpers/tables/wallet"; import { env } from "../bindings/env"; import { Database } from "./supabase/types/database"; -export const supabaseClient = createClient(env.SUPABASE_URL, env.SUPABASE_KEY, { +export const supabaseClient = createClient(env.SUPABASE_URL, env.SUPABASE_ANON_KEY, { auth: { persistSession: false }, }); diff --git a/src/adapters/supabase/helpers/tables/wallet.test.ts b/src/adapters/supabase/helpers/tables/wallet.test.ts index 8404b4c4b..456393d87 100644 --- a/src/adapters/supabase/helpers/tables/wallet.test.ts +++ b/src/adapters/supabase/helpers/tables/wallet.test.ts @@ -5,8 +5,8 @@ import { GitHubUser } from "../../../../types/payload"; import { createAdapters } from "../../../adapters"; const SUPABASE_URL = process.env.SUPABASE_URL; if (!SUPABASE_URL) throw new Error("SUPABASE_URL is not defined"); -const SUPABASE_KEY = process.env.SUPABASE_KEY; -if (!SUPABASE_KEY) throw new Error("SUPABASE_KEY is not defined"); +const SUPABASE_ANON_KEY = process.env.SUPABASE_ANON_KEY; +if (!SUPABASE_ANON_KEY) throw new Error("SUPABASE_ANON_KEY is not defined"); async function getWalletAddressAndUrlTest() { const { wallet } = createAdapters().supabase; diff --git a/src/types/configuration-types.ts b/src/types/configuration-types.ts index 0ff6e633c..0501e0003 100644 --- a/src/types/configuration-types.ts +++ b/src/types/configuration-types.ts @@ -51,7 +51,7 @@ const envConfigSchema = T.Object({ LOG_LEVEL: T.Enum(LogLevel, { default: LogLevel.DEBUG }), LOG_RETRY_LIMIT: T.Number({ default: 8 }), SUPABASE_URL: T.String({ format: "uri" }), - SUPABASE_KEY: T.String(), + SUPABASE_ANON_KEY: T.String(), PRIVATE_KEY: T.String(), APP_ID: T.Number(), }); diff --git a/supabase/README.md b/supabase/README.md index 151131354..4be85c91a 100644 --- a/supabase/README.md +++ b/supabase/README.md @@ -9,7 +9,7 @@ ``` SUPABASE_URL=XXX -SUPABASE_KEY=XXX +SUPABASE_ANON_KEY=XXX ``` 2. [The Supabase CLI](https://supabase.com/docs/guides/resources/supabase-cli) available as a node package through the dev dependencies provides tools to develop your project locally and deploy to the Supabase Platform.