From d8bd6b047c2b7c75b88a69842ff6d0f6bfcc5cc7 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Mon, 4 May 2026 12:58:16 +0200 Subject: [PATCH] docs: Examples Key changes (#45170) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## Summary by CodeRabbit * **Documentation** * Updated examples and guides to use Supabase publishable (client) keys instead of anon keys for client-side usage across frameworks and platforms. * Renamed environment variable examples and .env templates to reflect publishable key naming. * Adjusted sample requests and client-init examples to send/use the publishable key via the apikey header where applicable. * Updated references from service_role to secret for server-side credential guidance. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: fadymak --- .../examples/huggingface-image-captioning.mdx | 5 +- .../examples/elevenlabs-transcribe-speech.mdx | 4 +- .../supabase/functions/image_gen/index.ts | 6 +-- examples/ai/edge-functions/README.md | 2 +- .../functions/generate-embedding/index.ts | 3 +- .../supabase/functions/search/index.ts | 4 +- .../20240410041607_database-webhook.sql | 6 +-- examples/auth/expo-social-auth/.env.template | 2 +- .../auth/expo-social-auth/lib/supabase.ts | 2 +- .../auth/expo-social-auth/lib/supabase.web.ts | 2 +- examples/auth/flutter-mfa/lib/main.dart | 2 +- .../flutter-native-google-auth/lib/main.dart | 2 +- examples/auth/hono-full/.env.example | 2 +- examples/auth/hono-full/src/client.tsx | 2 +- .../src/middleware/auth.middleware.ts | 6 +-- examples/auth/hono/.env.example | 2 +- .../hono/src/middleware/auth.middleware.ts | 6 +-- .../lib/supabase.ts | 2 +- .../lib/supabase.web.ts | 2 +- .../quickstarts/react-native/.env.example | 2 +- .../quickstarts/react-native/lib/supabase.ts | 4 +- .../with-cloudflare-workers-kv/README.md | 4 +- .../with-cloudflare-workers-kv/src/index.js | 45 ++++++++++-------- .../caching/with-nextjs-13/.env.local.example | 2 +- examples/caching/with-nextjs-13/app/page.tsx | 2 +- examples/edge-functions/app/.env.example | 2 +- .../app/src/utils/supabaseClient.js | 2 +- .../background-upload-storage/index.ts | 3 +- .../elevenlabs-speech-to-text/index.ts | 4 +- .../elevenlabs-text-to-speech/index.ts | 3 +- .../functions/file-upload-storage/index.ts | 6 ++- .../functions/get-tshirt-competition/index.ts | 6 ++- .../huggingface-image-captioning/index.ts | 5 +- .../og-image-with-storage-cdn/handler.tsx | 6 ++- .../openai-image-generation/index.ts | 4 +- .../supabase/functions/read-storage/index.ts | 5 +- .../supabase/functions/restful-tasks/index.ts | 5 +- .../select-from-table-with-auth-rls/index.ts | 5 +- .../supabase/functions/sentry/index.ts | 4 +- .../functions/tweet-to-image/handler.tsx | 6 ++- .../upstash-redis-ratelimit/index.ts | 5 +- .../app/build.gradle | 2 +- .../manageproducts/di/SupabaseModule.kt | 2 +- .../local.properties | 2 +- examples/prompts/edge-functions.md | 10 ++-- examples/prompts/use-realtime.md | 4 +- .../flutter-figma-clone/lib/main.dart | 2 +- .../README.md | 4 +- .../realtime/nextjs-auth-presence/README.md | 6 +-- .../supabase_anon_key.jpg | Bin 51223 -> 0 bytes .../slack-clone/nextjs-slack-clone/README.md | 2 +- .../supabase/functions/maps-private/index.ts | 3 +- .../functions/create-upload-token/index.ts | 6 ++- .../storage/resumable-upload-uppy/README.md | 2 +- .../storage/resumable-upload-uppy/index.html | 4 +- examples/todo-list/nextjs-todo-list/README.md | 2 +- .../todo-list/sveltejs-todo-list/.env.example | 2 +- .../todo-list/sveltejs-todo-list/README.md | 2 +- .../sveltejs-todo-list/src/lib/db.ts | 2 +- .../angular-user-management/README.md | 4 +- .../src/app/supabase.service.ts | 2 +- .../src/environments/environment.ts | 2 +- .../supabase/functions/push/index.ts | 3 +- .../expo-user-management/README.md | 4 +- .../expo-user-management/lib/supabase.ts | 4 +- .../flutter-user-management/.env.example | 2 +- .../ionic-angular-user-management/README.md | 8 ++-- .../src/app/supabase.service.ts | 2 +- .../src/environments/environment.prod.ts | 2 +- .../src/environments/environment.ts | 2 +- .../ionic-react-user-management/README.md | 6 +-- .../src/supabaseClient.ts | 8 ++-- .../ionic-vue-user-management/README.md | 6 +-- .../ionic-vue-user-management/src/supabase.ts | 8 ++-- .../nextjs-user-management/README.md | 2 +- .../refine-user-management/README.MD | 4 +- .../src/utility/supabaseClient.ts | 4 +- .../solid-user-management/README.md | 2 +- .../svelte-user-management/.env.example | 2 +- .../svelte-user-management/README.md | 2 +- .../sveltekit-user-management/README.md | 2 +- .../swift-user-management/.env.example | 2 +- .../swift-user-management/Supabase.swift | 2 +- .../vue3-user-management/.env.example | 2 +- .../vue3-user-management/src/supabase.js | 2 +- examples/with-cloudflare-workers/README.md | 4 +- examples/with-cloudflare-workers/src/index.js | 4 +- 87 files changed, 187 insertions(+), 159 deletions(-) delete mode 100644 examples/realtime/nextjs-auth-presence/supabase_anon_key.jpg diff --git a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx index 6ded63808f..11f0672f9d 100644 --- a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx +++ b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx @@ -60,11 +60,12 @@ interface WebhookPayload { serve(async (req) => { const payload: WebhookPayload = await req.json() const soRecord = payload.record + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API SERVICE ROLE KEY - env var exported by default when deployed. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + // Supabase API SECRET KEY - env var exported by default when deployed. + Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' ) // Construct image url from storage diff --git a/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx b/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx index 3fb8481119..db8248876c 100644 --- a/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx +++ b/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx @@ -117,10 +117,10 @@ console.log(`Function "elevenlabs-scribe-bot" up and running!`) const elevenLabsClient = new ElevenLabsClient({ apiKey: Deno.env.get('ELEVENLABS_API_KEY') || '', }) - +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabase = createClient( Deno.env.get('SUPABASE_URL') || '', - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') || '' + Deno.env.get(SUPABASE_SECRET_KEYS['default']) || '' ) async function scribe({ diff --git a/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts b/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts index b9d143ebbc..5e7ffc8203 100644 --- a/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts +++ b/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts @@ -53,12 +53,12 @@ Deno.serve(async (req) => { const parsedData = JSON.parse(jsonString) console.log(parsedData) const image = parsedData.images[0] - + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL')!, - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + // Supabase API SECRET KEY - env var exported by default. + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) const { data: upload, error: uploadError } = await supabaseClient.storage diff --git a/examples/ai/edge-functions/README.md b/examples/ai/edge-functions/README.md index fce97ee7fc..64800461b9 100644 --- a/examples/ai/edge-functions/README.md +++ b/examples/ai/edge-functions/README.md @@ -24,7 +24,7 @@ Run a search via curl POST request: ```bash curl -i --location --request POST 'https://.supabase.co/functions/v1/search' \ - --header 'Authorization: Bearer ' \ + --header 'apikey: ' \ --header 'Content-Type: application/json' \ --data '{"search":"vehicles"}' ``` diff --git a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts index 71fec0bd76..43143fbcab 100644 --- a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts +++ b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts @@ -11,10 +11,11 @@ interface WebhookPayload { schema: 'public' old_record: null | EmbeddingsRecord } +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) const model = new Supabase.ai.Session('gte-small') diff --git a/examples/ai/edge-functions/supabase/functions/search/index.ts b/examples/ai/edge-functions/supabase/functions/search/index.ts index 3e7c7b0ce3..bd003be2f3 100644 --- a/examples/ai/edge-functions/supabase/functions/search/index.ts +++ b/examples/ai/edge-functions/supabase/functions/search/index.ts @@ -3,9 +3,11 @@ import 'jsr:@supabase/functions-js/edge-runtime.d.ts' import { createClient } from 'jsr:@supabase/supabase-js@2' import { Database } from '../_shared/database.types.ts' +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) const model = new Supabase.ai.Session('gte-small') diff --git a/examples/ai/edge-functions/supabase/migrations/20240410041607_database-webhook.sql b/examples/ai/edge-functions/supabase/migrations/20240410041607_database-webhook.sql index 91959270e8..40bbf7ca73 100644 --- a/examples/ai/edge-functions/supabase/migrations/20240410041607_database-webhook.sql +++ b/examples/ai/edge-functions/supabase/migrations/20240410041607_database-webhook.sql @@ -1,4 +1,4 @@ --- Insert your and below, then uncomment the trigger creation and run `supabase db push` +-- Insert your and below, then uncomment the trigger creation and run `supabase db push` -- Alternatively, head to the Database Webhook settings https://supabase.com/dashboard/project/_/database/hooks -- Select "Create a new Hook" > Table "public.embeddings" > check "INSERT" & "Update" > Supabase Edge Functions > Add auth header with service key @@ -9,7 +9,7 @@ -- EXECUTE FUNCTION supabase_functions.http_request ( -- 'https://.supabase.co/functions/v1/generate-embedding', -- 'POST', --- '{"Content-type":"application/json","Authorization":"Bearer "}', +-- '{"Content-type":"application/json","apikey":""}', -- '{}', -- '5000' -- ); @@ -24,7 +24,7 @@ -- EXECUTE FUNCTION supabase_functions.http_request ( -- 'http://kong:8000/functions/v1/generate-embedding', -- 'POST', --- '{"Content-type":"application/json","Authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0"}', +-- '{"Content-type":"application/json","apikey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0"}', -- '{}', -- '5000' -- ); diff --git a/examples/auth/expo-social-auth/.env.template b/examples/auth/expo-social-auth/.env.template index fd2c50b3e0..0c7e30b6fc 100644 --- a/examples/auth/expo-social-auth/.env.template +++ b/examples/auth/expo-social-auth/.env.template @@ -1,5 +1,5 @@ EXPO_PUBLIC_SUPABASE_URL="" -EXPO_PUBLIC_SUPABASE_ANON_KEY="" +EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY="" EXPO_PUBLIC_APPLE_AUTH_SERVICE_ID="" EXPO_PUBLIC_APPLE_AUTH_REDIRECT_URI="" EXPO_PUBLIC_GOOGLE_AUTH_WEB_CLIENT_ID="" diff --git a/examples/auth/expo-social-auth/lib/supabase.ts b/examples/auth/expo-social-auth/lib/supabase.ts index a207641a2d..4bd340d617 100644 --- a/examples/auth/expo-social-auth/lib/supabase.ts +++ b/examples/auth/expo-social-auth/lib/supabase.ts @@ -21,7 +21,7 @@ const ExpoSecureStoreAdapter = { export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', - process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ?? '', + process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY ?? '', { auth: { storage: ExpoSecureStoreAdapter as any, diff --git a/examples/auth/expo-social-auth/lib/supabase.web.ts b/examples/auth/expo-social-auth/lib/supabase.web.ts index e7054507ed..a6f9aef14c 100644 --- a/examples/auth/expo-social-auth/lib/supabase.web.ts +++ b/examples/auth/expo-social-auth/lib/supabase.web.ts @@ -22,7 +22,7 @@ const ExpoWebSecureStoreAdapter = { export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', - process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ?? '', + process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY ?? '', { auth: { storage: ExpoWebSecureStoreAdapter, diff --git a/examples/auth/flutter-mfa/lib/main.dart b/examples/auth/flutter-mfa/lib/main.dart index 1387b15d09..0b4214df91 100644 --- a/examples/auth/flutter-mfa/lib/main.dart +++ b/examples/auth/flutter-mfa/lib/main.dart @@ -11,7 +11,7 @@ import 'package:mfa_app/pages/mfa/enroll_page.dart'; void main() async { await Supabase.initialize( url: 'YOUR_SUPABASE_URL', - anonKey: 'YOUR_ANON_KEY', + publishableKey: 'YOUR_PUBLISHABLE_KEY', ); runApp(const MyApp()); } diff --git a/examples/auth/flutter-native-google-auth/lib/main.dart b/examples/auth/flutter-native-google-auth/lib/main.dart index a7be2ac3f1..d2a22db9b8 100644 --- a/examples/auth/flutter-native-google-auth/lib/main.dart +++ b/examples/auth/flutter-native-google-auth/lib/main.dart @@ -6,7 +6,7 @@ void main() async { /// TODO: update Supabase credentials with your own await Supabase.initialize( url: 'YOUR_SUPABASE_URL', - anonKey: 'YOUR_ANON_KEY', + publishableKey: 'YOUR_PUBLISHABLE_KEY', ); runApp(const MyApp()); } diff --git a/examples/auth/hono-full/.env.example b/examples/auth/hono-full/.env.example index 671edd50ac..5be19a146f 100644 --- a/examples/auth/hono-full/.env.example +++ b/examples/auth/hono-full/.env.example @@ -1,3 +1,3 @@ # Get your keys at https://supabase.com/dashboard/project/_/settings/api VITE_SUPABASE_URL=your_supabase_url -VITE_SUPABASE_ANON_KEY=your_supabase_anon_key \ No newline at end of file +VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key \ No newline at end of file diff --git a/examples/auth/hono-full/src/client.tsx b/examples/auth/hono-full/src/client.tsx index 66f64c6eb0..de23c02f9e 100644 --- a/examples/auth/hono-full/src/client.tsx +++ b/examples/auth/hono-full/src/client.tsx @@ -8,7 +8,7 @@ const client = hc('/') const supabase = createBrowserClient( import.meta.env.VITE_SUPABASE_URL!, - import.meta.env.VITE_SUPABASE_ANON_KEY! + import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY! ) function App() { diff --git a/examples/auth/hono-full/src/middleware/auth.middleware.ts b/examples/auth/hono-full/src/middleware/auth.middleware.ts index 89891943a5..89daae8a19 100644 --- a/examples/auth/hono-full/src/middleware/auth.middleware.ts +++ b/examples/auth/hono-full/src/middleware/auth.middleware.ts @@ -16,7 +16,7 @@ export const getSupabase = (c: Context) => { type SupabaseEnv = { VITE_SUPABASE_URL: string - VITE_SUPABASE_ANON_KEY: string + VITE_SUPABASE_PUBLISHABLE_KEY: string } export const supabaseMiddleware = (): MiddlewareHandler => { @@ -24,14 +24,14 @@ export const supabaseMiddleware = (): MiddlewareHandler => { const supabaseEnv = env(c) const supabaseUrl = supabaseEnv.VITE_SUPABASE_URL ?? import.meta.env.VITE_SUPABASE_URL const supabasePublishableKey = - supabaseEnv.VITE_SUPABASE_ANON_KEY ?? import.meta.env.VITE_SUPABASE_ANON_KEY + supabaseEnv.VITE_SUPABASE_PUBLISHABLE_KEY ?? import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY if (!supabaseUrl) { throw new Error('SUPABASE_URL missing!') } if (!supabasePublishableKey) { - throw new Error('SUPABASE_ANON_KEY missing!') + throw new Error('SUPABASE_PUBLISHABLE_KEY missing!') } const supabase = createServerClient(supabaseUrl, supabasePublishableKey, { diff --git a/examples/auth/hono/.env.example b/examples/auth/hono/.env.example index 671edd50ac..5be19a146f 100644 --- a/examples/auth/hono/.env.example +++ b/examples/auth/hono/.env.example @@ -1,3 +1,3 @@ # Get your keys at https://supabase.com/dashboard/project/_/settings/api VITE_SUPABASE_URL=your_supabase_url -VITE_SUPABASE_ANON_KEY=your_supabase_anon_key \ No newline at end of file +VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key \ No newline at end of file diff --git a/examples/auth/hono/src/middleware/auth.middleware.ts b/examples/auth/hono/src/middleware/auth.middleware.ts index b45a095877..5ac6d20f89 100644 --- a/examples/auth/hono/src/middleware/auth.middleware.ts +++ b/examples/auth/hono/src/middleware/auth.middleware.ts @@ -23,17 +23,17 @@ export const supabaseMiddleware = (): MiddlewareHandler => { return async (c, next) => { const supabaseEnv = env(c) const supabaseUrl = supabaseEnv.SUPABASE_URL - const supabaseAnonKey = supabaseEnv.SUPABASE_PUBLISHABLE_KEY + const supabasePublishableKey = supabaseEnv.SUPABASE_PUBLISHABLE_KEY if (!supabaseUrl) { throw new Error('SUPABASE_URL missing!') } - if (!supabaseAnonKey) { + if (!supabasePublishableKey) { throw new Error('SUPABASE_PUBLISHABLE_KEY missing!') } - const supabase = createServerClient(supabaseUrl, supabaseAnonKey, { + const supabase = createServerClient(supabaseUrl, supabasePublishableKey, { cookies: { getAll() { return parseCookieHeader(c.req.header('Cookie') ?? '') diff --git a/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.ts b/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.ts index a207641a2d..4bd340d617 100644 --- a/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.ts +++ b/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.ts @@ -21,7 +21,7 @@ const ExpoSecureStoreAdapter = { export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', - process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ?? '', + process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY ?? '', { auth: { storage: ExpoSecureStoreAdapter as any, diff --git a/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.web.ts b/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.web.ts index e7054507ed..a6f9aef14c 100644 --- a/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.web.ts +++ b/examples/auth/quickstarts/expo-react-native-social-auth/lib/supabase.web.ts @@ -22,7 +22,7 @@ const ExpoWebSecureStoreAdapter = { export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', - process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ?? '', + process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY ?? '', { auth: { storage: ExpoWebSecureStoreAdapter, diff --git a/examples/auth/quickstarts/react-native/.env.example b/examples/auth/quickstarts/react-native/.env.example index 025c72c8ab..a90a11632d 100644 --- a/examples/auth/quickstarts/react-native/.env.example +++ b/examples/auth/quickstarts/react-native/.env.example @@ -1,2 +1,2 @@ EXPO_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL -EXPO_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY \ No newline at end of file +EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY \ No newline at end of file diff --git a/examples/auth/quickstarts/react-native/lib/supabase.ts b/examples/auth/quickstarts/react-native/lib/supabase.ts index 630334d852..42b4d728df 100644 --- a/examples/auth/quickstarts/react-native/lib/supabase.ts +++ b/examples/auth/quickstarts/react-native/lib/supabase.ts @@ -4,9 +4,9 @@ import AsyncStorage from '@react-native-async-storage/async-storage' import { createClient, processLock } from '@supabase/supabase-js' const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL! -const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY! +const supabasePublishableKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY! -export const supabase = createClient(supabaseUrl, supabaseAnonKey, { +export const supabase = createClient(supabaseUrl, supabasePublishableKey, { auth: { ...(Platform.OS !== 'web' ? { storage: AsyncStorage } : {}), autoRefreshToken: true, diff --git a/examples/caching/with-cloudflare-workers-kv/README.md b/examples/caching/with-cloudflare-workers-kv/README.md index ec7e667a18..9ab518132e 100644 --- a/examples/caching/with-cloudflare-workers-kv/README.md +++ b/examples/caching/with-cloudflare-workers-kv/README.md @@ -16,10 +16,10 @@ Finally, we use the Thunder Client extension to simulate a POST request to the ` router.post( '/revalidate', withContent, - async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTICLES }, context) => { + async (request, { SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, ARTICLES }, context) => { const updateCache = async () => { const { type, record, old_record } = request.content - const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) + const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY) if (type === 'INSERT' || type === 'UPDATE') { await writeTo(ARTICLES, `/articles/${record.id}`, record) diff --git a/examples/caching/with-cloudflare-workers-kv/src/index.js b/examples/caching/with-cloudflare-workers-kv/src/index.js index b7a2ed4c27..ab9984cedc 100644 --- a/examples/caching/with-cloudflare-workers-kv/src/index.js +++ b/examples/caching/with-cloudflare-workers-kv/src/index.js @@ -17,7 +17,7 @@ router.get('/write-kv', async (request, { ARTICLES }) => { return json(articles) }) -router.get('/articles', async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTICLES }) => { +router.get('/articles', async (request, { SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, ARTICLES }) => { const cachedArticles = await readFrom(ARTICLES, '/articles') if (cachedArticles) { @@ -27,40 +27,43 @@ router.get('/articles', async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTIC console.log('fetching fresh articles') - const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) + const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY) const { data } = await supabase.from('articles').select('*') await writeTo(ARTICLES, '/articles', data) return json(data) }) -router.get('/articles/:id', async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTICLES }) => { - const { id } = request.params - const cachedArticle = await readFrom(ARTICLES, `/articles/${id}`) +router.get( + '/articles/:id', + async (request, { SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, ARTICLES }) => { + const { id } = request.params + const cachedArticle = await readFrom(ARTICLES, `/articles/${id}`) - if (cachedArticle) { - console.log('sending the cache') - return json(cachedArticle) + if (cachedArticle) { + console.log('sending the cache') + return json(cachedArticle) + } + + console.log('fetching fresh article') + + const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY) + + const { data } = await supabase.from('articles').select('*').match({ id }).single() + + await writeTo(ARTICLES, `/articles/${id}`, data) + + return json(data) } - - console.log('fetching fresh article') - - const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) - - const { data } = await supabase.from('articles').select('*').match({ id }).single() - - await writeTo(ARTICLES, `/articles/${id}`, data) - - return json(data) -}) +) router.post( '/revalidate', withContent, - async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTICLES }, context) => { + async (request, { SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, ARTICLES }, context) => { const updateCache = async () => { const { type, record, old_record } = request.content - const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) + const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY) if (type === 'INSERT' || type === 'UPDATE') { await writeTo(ARTICLES, `/articles/${record.id}`, record) diff --git a/examples/caching/with-nextjs-13/.env.local.example b/examples/caching/with-nextjs-13/.env.local.example index f41d144a08..d12ac4f481 100644 --- a/examples/caching/with-nextjs-13/.env.local.example +++ b/examples/caching/with-nextjs-13/.env.local.example @@ -1,2 +1,2 @@ NEXT_PUBLIC_SUPABASE_URL= -SUPABASE_SERVICE_ROLE_KEY= \ No newline at end of file +SUPABASE_SECRET_KEY= \ No newline at end of file diff --git a/examples/caching/with-nextjs-13/app/page.tsx b/examples/caching/with-nextjs-13/app/page.tsx index 0969a3a94f..4cc89ece9f 100644 --- a/examples/caching/with-nextjs-13/app/page.tsx +++ b/examples/caching/with-nextjs-13/app/page.tsx @@ -5,7 +5,7 @@ import { createClient } from '@supabase/supabase-js' const supabase = createClient( process.env.NEXT_PUBLIC_SUPABASE_URL ?? 'http://localhost:54321', - process.env.SUPABASE_SERVICE_ROLE_KEY ?? + process.env.SUPABASE_SECRET_KEY ?? 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSJ9.vI9obAHOGyVVKa3pD--kJlyxp-Z2zV9UUMAhKpNLAcU', { global: { fetch } } // Note: this is not required as supabase-js uses the global fetch when available! ) diff --git a/examples/edge-functions/app/.env.example b/examples/edge-functions/app/.env.example index a0fb63f466..4f30d8b396 100644 --- a/examples/edge-functions/app/.env.example +++ b/examples/edge-functions/app/.env.example @@ -1,3 +1,3 @@ # Get these from your Dashboard: https://supabase.com/dashboard/project/_/settings/api REACT_APP_SUPABASE_URL= -REACT_APP_SUPABASE_ANON_KEY= \ No newline at end of file +REACT_APP_SUPABASE_PUBLISHABLE_KEY= \ No newline at end of file diff --git a/examples/edge-functions/app/src/utils/supabaseClient.js b/examples/edge-functions/app/src/utils/supabaseClient.js index d369fec80d..2a1da82397 100644 --- a/examples/edge-functions/app/src/utils/supabaseClient.js +++ b/examples/edge-functions/app/src/utils/supabaseClient.js @@ -2,6 +2,6 @@ import { createClient } from '@supabase/supabase-js' export const supabase = createClient( process.env.REACT_APP_SUPABASE_URL ?? 'http://localhost:54321', - process.env.REACT_APP_SUPABASE_ANON_KEY ?? + process.env.REACT_APP_SUPABASE_DEFAULT_PUBLISHABLE_KEY ?? 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs' ) diff --git a/examples/edge-functions/supabase/functions/background-upload-storage/index.ts b/examples/edge-functions/supabase/functions/background-upload-storage/index.ts index 77b88f94ba..49d5d9a99c 100644 --- a/examples/edge-functions/supabase/functions/background-upload-storage/index.ts +++ b/examples/edge-functions/supabase/functions/background-upload-storage/index.ts @@ -2,10 +2,11 @@ import { createClient } from 'npm:supabase-js@2' import OpenAI from 'https://deno.land/x/openai@v4.68.2/mod.ts' const client = new OpenAI({ apiKey: Deno.env.get('OPENAI_API_KEY')! }) +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) type StorageFileApi = ReturnType diff --git a/examples/edge-functions/supabase/functions/elevenlabs-speech-to-text/index.ts b/examples/edge-functions/supabase/functions/elevenlabs-speech-to-text/index.ts index 6f6ef0938c..6623cb3b5e 100644 --- a/examples/edge-functions/supabase/functions/elevenlabs-speech-to-text/index.ts +++ b/examples/edge-functions/supabase/functions/elevenlabs-speech-to-text/index.ts @@ -15,9 +15,11 @@ const elevenLabsClient = new ElevenLabsClient({ apiKey: Deno.env.get('ELEVENLABS_API_KEY') || '', }) +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabase = createClient( Deno.env.get('SUPABASE_URL') || '', - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') || '' + Deno.env.get(SUPABASE_SECRET_KEYS['default']) || '' ) async function scribe({ diff --git a/examples/edge-functions/supabase/functions/elevenlabs-text-to-speech/index.ts b/examples/edge-functions/supabase/functions/elevenlabs-text-to-speech/index.ts index 1c7dfb7175..972e449ef8 100644 --- a/examples/edge-functions/supabase/functions/elevenlabs-text-to-speech/index.ts +++ b/examples/edge-functions/supabase/functions/elevenlabs-text-to-speech/index.ts @@ -4,9 +4,10 @@ import { createClient } from 'npm:supabase-js@2' import { ElevenLabsClient } from 'npm:elevenlabs@1.52.0' import * as hash from 'npm:object-hash' +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) const client = new ElevenLabsClient({ diff --git a/examples/edge-functions/supabase/functions/file-upload-storage/index.ts b/examples/edge-functions/supabase/functions/file-upload-storage/index.ts index 954bcc05ef..37dee7427f 100644 --- a/examples/edge-functions/supabase/functions/file-upload-storage/index.ts +++ b/examples/edge-functions/supabase/functions/file-upload-storage/index.ts @@ -23,11 +23,13 @@ app.use(async (ctx) => { return } + const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) + const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL')!, - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_ANON_KEY')! + // Supabase publishable key - env var exported by default. + Deno.env.get(SUPABASE_PUBLISHABLE_KEYS['default'])! ) //upload image to Storage diff --git a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts index f877a1c59b..de5dc1c2b0 100644 --- a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts +++ b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts @@ -55,11 +55,13 @@ Deno.serve(async (req) => { ) } + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API SERVICE ROLE KEY - env var exported by default when deployed. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + // Supabase API SECRET KEY - env var exported by default when deployed. + Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' ) // Submit email to draw const { error } = await supabaseAdminClient.from('get-tshirt-competition-2').upsert( diff --git a/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts b/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts index 646fc2070f..15455577c2 100644 --- a/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts +++ b/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts @@ -18,11 +18,12 @@ interface WebhookPayload { Deno.serve(async (req) => { const payload: WebhookPayload = await req.json() const soRecord = payload.record + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API SERVICE ROLE KEY - env var exported by default when deployed. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + // Supabase API SECRET KEY - env var exported by default when deployed. + Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' ) // Construct image url from storage diff --git a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx index 2961bdad91..3cea004a04 100644 --- a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx +++ b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx @@ -195,11 +195,13 @@ export async function handler(req: Request) { } ) + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API SERVICE ROLE KEY - env var exported by default when deployed. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + // Supabase API SECRET KEY - env var exported by default when deployed. + Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' ) // Upload image to storage. diff --git a/examples/edge-functions/supabase/functions/openai-image-generation/index.ts b/examples/edge-functions/supabase/functions/openai-image-generation/index.ts index e299cd6db0..8117c2edf7 100644 --- a/examples/edge-functions/supabase/functions/openai-image-generation/index.ts +++ b/examples/edge-functions/supabase/functions/openai-image-generation/index.ts @@ -80,10 +80,12 @@ Deno.serve(async (req) => { } const generatedImageBlob = new Blob([uint8Array], { type: 'image/png' }) + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + // Upload the generated image to Supabase Storage const supabaseClient = createClient( Deno.env.get('SUPABASE_URL') || '', - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') || '' + Deno.env.get(SUPABASE_SECRET_KEYS['default']) || '' ) // Create a unique identifier for this generation diff --git a/examples/edge-functions/supabase/functions/read-storage/index.ts b/examples/edge-functions/supabase/functions/read-storage/index.ts index 72e492898a..443bf721a1 100644 --- a/examples/edge-functions/supabase/functions/read-storage/index.ts +++ b/examples/edge-functions/supabase/functions/read-storage/index.ts @@ -19,12 +19,13 @@ Deno.serve(async (req) => { } try { + const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) // Create a Supabase client with the Auth context of the logged in user. const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_ANON_KEY') ?? '', + // Supabase API publishable key - env var exported by default. + Deno.env.get(SUPABASE_PUBLISHABLE_KEYS['default']) ?? '', // Create client with Auth context of the user that called the function. // This way your row-level-security (RLS) policies are applied. { diff --git a/examples/edge-functions/supabase/functions/restful-tasks/index.ts b/examples/edge-functions/supabase/functions/restful-tasks/index.ts index 3addd3448e..2182334fc6 100644 --- a/examples/edge-functions/supabase/functions/restful-tasks/index.ts +++ b/examples/edge-functions/supabase/functions/restful-tasks/index.ts @@ -76,12 +76,13 @@ Deno.serve(async (req) => { } try { + const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) // Create a Supabase client with the Auth context of the logged in user. const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_ANON_KEY') ?? '', + // Supabase publishable key - env var exported by default. + Deno.env.get(SUPABASE_PUBLISHABLE_KEYS['default']) ?? '', // Create client with Auth context of the user that called the function. // This way your row-level-security (RLS) policies are applied. { diff --git a/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts b/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts index 118f4c4593..a9badc940b 100644 --- a/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts +++ b/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts @@ -17,12 +17,13 @@ Deno.serve(async (req: Request) => { } try { + const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) // Create a Supabase client with the Auth context of the logged in user. const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_ANON_KEY') ?? '', + // Supabase API PUBLISHABLE KEY - env var exported by default. + Deno.env.get(SUPABASE_PUBLISHABLE_KEYS['default']) ?? '', // Create client with Auth context of the user that called the function. // This way your row-level-security (RLS) policies are applied. { diff --git a/examples/edge-functions/supabase/functions/sentry/index.ts b/examples/edge-functions/supabase/functions/sentry/index.ts index 93079b1c34..abdddd9b97 100644 --- a/examples/edge-functions/supabase/functions/sentry/index.ts +++ b/examples/edge-functions/supabase/functions/sentry/index.ts @@ -7,9 +7,11 @@ console.log('Hello from the Sentry Functions Challenge!') import { createClient } from 'npm:supabase-js@2' import * as Sentry from 'https://deno.land/x/sentry@7.102.0/index.mjs' +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) Sentry.init({ diff --git a/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx b/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx index 3aa861d41d..ddd9c340c2 100644 --- a/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx +++ b/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx @@ -64,11 +64,13 @@ export async function handler(req: Request) { } ) + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + const supabaseAdminClient = createClient( // Supabase API URL - env var exported by default when deployed. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API SERVICE ROLE KEY - env var exported by default when deployed. - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + // Supabase API SECRET KEY - env var exported by default when deployed. + Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' ) // Upload image to storage. diff --git a/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts b/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts index d3be9df320..ef5727c3b2 100644 --- a/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts +++ b/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts @@ -6,12 +6,13 @@ console.log(`Function "upstash-redis-counter" up and running!`) Deno.serve(async (req) => { try { + const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) // Create a Supabase client with the Auth context of the logged in user. const supabaseClient = createClient( // Supabase API URL - env var exported by default. Deno.env.get('SUPABASE_URL') ?? '', - // Supabase API ANON KEY - env var exported by default. - Deno.env.get('SUPABASE_ANON_KEY') ?? '', + // Supabase publishable key - env var exported by default. + Deno.env.get(SUPABASE_PUBLISHABLE_KEYS['default']) ?? '', // Create client with Auth context of the user that called the function. // This way your row-level-security (RLS) policies are applied. { diff --git a/examples/product-sample-supabase-kt/app/build.gradle b/examples/product-sample-supabase-kt/app/build.gradle index c7aae5c480..53cddae1b1 100644 --- a/examples/product-sample-supabase-kt/app/build.gradle +++ b/examples/product-sample-supabase-kt/app/build.gradle @@ -24,7 +24,7 @@ android { } Properties properties = new Properties() properties.load(project.rootProject.file("local.properties").newDataInputStream()) - buildConfigField("String", "API_KEY", "\"${properties.getProperty("API_KEY")}\"") + buildConfigField("String", "API_PUBLISHABLE_KEY", "\"${properties.getProperty("API_PUBLISHABLE_KEY")}\"") buildConfigField("String", "SECRET", "\"${properties.getProperty("SECRET")}\"") buildConfigField("String", "SUPABASE_URL", "\"${properties.getProperty("SUPABASE_URL")}\"") } diff --git a/examples/product-sample-supabase-kt/app/src/main/java/com/example/manageproducts/di/SupabaseModule.kt b/examples/product-sample-supabase-kt/app/src/main/java/com/example/manageproducts/di/SupabaseModule.kt index c3a5eec2b3..c77b31c736 100644 --- a/examples/product-sample-supabase-kt/app/src/main/java/com/example/manageproducts/di/SupabaseModule.kt +++ b/examples/product-sample-supabase-kt/app/src/main/java/com/example/manageproducts/di/SupabaseModule.kt @@ -28,7 +28,7 @@ object SupabaseModule { fun provideSupabaseClient(): SupabaseClient { return createSupabaseClient( supabaseUrl = BuildConfig.SUPABASE_URL, - supabaseKey = BuildConfig.API_KEY + supabaseKey = BuildConfig.API_PUBLISHABLE_KEY ) { install(Postgrest) install(GoTrue) { diff --git a/examples/product-sample-supabase-kt/local.properties b/examples/product-sample-supabase-kt/local.properties index 46d870433f..35bd58209f 100644 --- a/examples/product-sample-supabase-kt/local.properties +++ b/examples/product-sample-supabase-kt/local.properties @@ -6,6 +6,6 @@ # header note. #Mon Jul 24 23:36:03 ICT 2023 sdk.dir=/Users/hieuvu/Library/Android/sdk -API_KEY=YOUR_SUPABASE_API_KEY +API_PUBLISHABLE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY SECRET=YOUR_SUPABASE_SECRET SUPABASE_URL=YOUR_SUPABASE_URL \ No newline at end of file diff --git a/examples/prompts/edge-functions.md b/examples/prompts/edge-functions.md index 207d69bddc..ba48db3fa8 100644 --- a/examples/prompts/edge-functions.md +++ b/examples/prompts/edge-functions.md @@ -19,13 +19,11 @@ You're an expert in writing TypeScript and Deno JavaScript runtime. Generate **h 7. Do NOT use `import { serve } from "https://deno.land/std@0.168.0/http/server.ts"`. Instead use the built-in `Deno.serve`. 8. Following environment variables (ie. secrets) are pre-populated in both local and hosted Supabase environments. Users don't need to manually set them: - SUPABASE_URL - - SUPABASE_ANON_KEY - - SUPABASE_SERVICE_ROLE_KEY + - SUPABASE_PUBLISHABLE_KEYS + - SUPABASE_SECRET_KEYS - SUPABASE_DB_URL -9. To set other environment variables (ie. secrets) users can put them in a env file and run the `supabase secrets set --env-file path/to/env-file` -10. A single Edge Function can handle multiple routes. It is recommended to use a library like Express or Hono to handle the routes as it's easier for developer to understand and maintain. Each route must be prefixed with `/function-name` so they are routed correctly. -11. File write operations are ONLY permitted on `/tmp` directory. You can use either Deno or Node File APIs. -12. Use `EdgeRuntime.waitUntil(promise)` static method to run long-running tasks in the background without blocking response to a request. Do NOT assume it is available in the request / execution context. + +You then need to use `JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!)` or `JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!)` to access the actual keys in the code. For example, `Deno.env.get(SUPABASE_SECRET_KEYS['default'])` to access the default service key. 9. To set other environment variables (ie. secrets) users can put them in a env file and run the `supabase secrets set --env-file path/to/env-file` 10. A single Edge Function can handle multiple routes. It is recommended to use a library like Express or Hono to handle the routes as it's easier for developer to understand and maintain. Each route must be prefixed with `/function-name` so they are routed correctly. 11. File write operations are ONLY permitted on `/tmp` directory. You can use either Deno or Node File APIs. 12. Use `EdgeRuntime.waitUntil(promise)` static method to run long-running tasks in the background without blocking response to a request. Do NOT assume it is available in the request / execution context. ## Example Templates diff --git a/examples/prompts/use-realtime.md b/examples/prompts/use-realtime.md index d032fb49a2..28e7f470ef 100644 --- a/examples/prompts/use-realtime.md +++ b/examples/prompts/use-realtime.md @@ -103,7 +103,7 @@ const channel = supabase.channel(`admin:${orgId}:alerts`) ```javascript // Basic setup -const supabase = createClient('URL', 'ANON_KEY') +const supabase = createClient('SUPABASE_URL', 'SUPABASE_PUBLISHABLE_KEY') // Channel configuration const channel = supabase.channel('room:123:messages', { @@ -341,7 +341,7 @@ The client automatically manages these states: ```javascript // Client automatically reconnects with built-in logic -const supabase = createClient('URL', 'ANON_KEY', { +const supabase = createClient('SUPABASE_URL', 'SUPABASE_PUBLISHABLE_KEY', { realtime: { params: { log_level: 'info', diff --git a/examples/realtime/flutter-figma-clone/lib/main.dart b/examples/realtime/flutter-figma-clone/lib/main.dart index 69aa230f24..2f01510b25 100644 --- a/examples/realtime/flutter-figma-clone/lib/main.dart +++ b/examples/realtime/flutter-figma-clone/lib/main.dart @@ -11,7 +11,7 @@ void main() async { await Supabase.initialize( url: 'YOUR_SUPABASE_URL', - anonKey: 'YOUR_SUPABASE_ANON_KEY', + publishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY', ); runApp(const MyApp()); } diff --git a/examples/realtime/flutter-multiplayer-shooting-game/README.md b/examples/realtime/flutter-multiplayer-shooting-game/README.md index fa03525a06..f1ed613916 100644 --- a/examples/realtime/flutter-multiplayer-shooting-game/README.md +++ b/examples/realtime/flutter-multiplayer-shooting-game/README.md @@ -14,9 +14,9 @@ Sign up to Supabase - [app.supabase.io](https://app.supabase.io) and create a ne Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `anon` key, you'll need these in the next step. -The `anon` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. +Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `publishable` key, you'll need these in the next step. -![Supabase Anon Key](supabase_anon_key.jpg?raw=true 'Supabase Anon Key') +The `publishable` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. ### 3. Pull this example git repository diff --git a/examples/realtime/nextjs-auth-presence/README.md b/examples/realtime/nextjs-auth-presence/README.md index 2e65b80aaa..1033c44b35 100644 --- a/examples/realtime/nextjs-auth-presence/README.md +++ b/examples/realtime/nextjs-auth-presence/README.md @@ -25,11 +25,9 @@ This will create user tables and profile tables for user management. ### 3. Get the URL and Key -Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `anon` key, you'll need these in the next step. +Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `publishable` key, you'll need these in the next step. -The `anon` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. - -![Supabase Anon Key](supabase_anon_key.jpg?raw=true 'Supabase Anon Key') +The `publishable` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. ### 4. Pull this example git repository diff --git a/examples/realtime/nextjs-auth-presence/supabase_anon_key.jpg b/examples/realtime/nextjs-auth-presence/supabase_anon_key.jpg deleted file mode 100644 index 17b3cbd5f93fce9b4a38131b6c1ed7695df2b33c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51223 zcmeFa2V7IxwlIDm6deUb6bp4gK?g!L^ni{CDgjiK5)g#YLP!FkcSmQW2`G&8;(&k- z1Vjh{3?KqVCKPFjQi5~=A@p9p1M1A&`{up-zWe6?zIWe$w!d@sI%}`J_F8MNbFy~B zt+!k6fqfVCF6aSlY;3?i@E@?%4?H~Qi*^J6Lqp&j004FY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~7>< zCc#;NxmcnUJJMf?2$G(ZX0IJj`V=6#e*+qu0?Y zWy5;_zdg0k`B4``^#L`t=mV7kXmJE-yef!NbJ|iC@CNkzcC#v;3_M`%oM#0Sziq7_!+AfP*v@D0VxV0x&09S@VdnV^YhdtNBlxiZ6dK>FXL4Ma{lHB4`j( ziyoW>9#UV&&6?(WKkb&M8(|eHCnF*qJ(N?!Kyv!N^{{A3HrMs^8|@@S|(W!N-;y z8+2$W{5kGO3gK`?!C7ym zl%0-cl+jo*6*akLSczb}g-m@l^HUGL!6E>&p}xW6#JXt~q_eY^^?b&M%A7}|6F(V+ zB2AC$F>pf>1H)}lB+l2l?$$Y}Z(%G#IJ8|)+4*GHIQ&YffgDdi`je1eRZ*V09CFUV8M7gpmenwGdx7u`)#+0me-@J z{YUClRp)zEo+sVy4G##4Uz02Y^$-D;T&0JA+fOgIvB2HgKko}{l{U@fMp9o&N!Xmb z?B=O?IgjynsgPhDZ#Wv+P^DMU*!Y%BXmK;Glk3n4oBIr4WxTM9I(Wa|vSwtw^+Qes zBQ)xTav)Tj0mVXdn9f~uX&>+@m`p!+)uhyJa{YkTLQiDyzP`6U5@z0T4>N`N+ zkMGS@>M-i<&(+TG;-^2g4NKqr#dJo?!cbIh?-3+|few0Vqu= zUSn|HqMVGz?X5s}8H~Ulh|c-w9*Y$ejada-OP!Nf{jsZxZAV_?e-u^PZjWqR&rdKTD;ircn!{y}M%zC>)*L!m+80(acu>5mkT?&?&JzpEa%)DRQ$=P>FJLVMnd^c0iHCNn(v(0L)+fe zM=>LB>Z7BYsKZyz|J~>5FAp&JyG{O@8U8by#FbyOv0uIJKkv=Eg{LP${+!$}z*_KM b;lD=Uf5!+U{({=9Uwyj%FKIye&GY{YkQsHa diff --git a/examples/slack-clone/nextjs-slack-clone/README.md b/examples/slack-clone/nextjs-slack-clone/README.md index 5198472895..b280300c3f 100644 --- a/examples/slack-clone/nextjs-slack-clone/README.md +++ b/examples/slack-clone/nextjs-slack-clone/README.md @@ -40,7 +40,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ## Supabase details diff --git a/examples/storage/protomaps/supabase/functions/maps-private/index.ts b/examples/storage/protomaps/supabase/functions/maps-private/index.ts index 202acfcdbd..cacfc61de0 100644 --- a/examples/storage/protomaps/supabase/functions/maps-private/index.ts +++ b/examples/storage/protomaps/supabase/functions/maps-private/index.ts @@ -23,9 +23,10 @@ Deno.serve((req) => { const reqUrl = new URL(req.url) const url = `${Deno.env.get('SUPABASE_URL')}/storage/v1/object/authenticated${reqUrl.pathname}` + const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const { method, headers } = req // Add Auth header const modHeaders = new Headers(headers) - modHeaders.append('authorization', `Bearer ${Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!}`) + modHeaders.append('authorization', `Bearer ${Deno.env.get(SUPABASE_SECRET_KEYS['default'])!}`) return fetch(url, { method, headers: modHeaders }) }) diff --git a/examples/storage/resumable-upload-signed-uppy/supabase/functions/create-upload-token/index.ts b/examples/storage/resumable-upload-signed-uppy/supabase/functions/create-upload-token/index.ts index ff8cdf0a67..2d1fb040fe 100644 --- a/examples/storage/resumable-upload-signed-uppy/supabase/functions/create-upload-token/index.ts +++ b/examples/storage/resumable-upload-signed-uppy/supabase/functions/create-upload-token/index.ts @@ -1,11 +1,13 @@ import 'jsr:@supabase/functions-js/edge-runtime.d.ts' import { createClient } from 'jsr:@supabase/supabase-js' +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + Deno.serve(async (req) => { const SUPABASE_URL = Deno.env.get('SUPABASE_URL') ?? '' - const SUPABASE_SERVICE_ROLE_KEY = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? '' + const SUPABASE_SECRET_KEY = Deno.env.get(SUPABASE_SECRET_KEYS['default']) ?? '' - const supabase = createClient(SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY) + const supabase = createClient(SUPABASE_URL, SUPABASE_SECRET_KEY) try { const { filename } = await req.json() diff --git a/examples/storage/resumable-upload-uppy/README.md b/examples/storage/resumable-upload-uppy/README.md index af8994f4ec..35c374c7b4 100644 --- a/examples/storage/resumable-upload-uppy/README.md +++ b/examples/storage/resumable-upload-uppy/README.md @@ -10,7 +10,7 @@ This example shows how to use [Supabase Storage](https://supabase.com/docs/refer - Open the index.html file and replace the following variables with your own: ```js -const SUPABASE_ANON_KEY = '' // your project's anon key +const SUPABASE_PUBLISHABLE_KEY = '' // your project's publishable key const SUPABASE_PROJECT_ID = '' // your project ref const STORAGE_BUCKET = '' // your storage bucket name const BEARER_TOKEN = '' // your bearer token diff --git a/examples/storage/resumable-upload-uppy/index.html b/examples/storage/resumable-upload-uppy/index.html index 6683147bc8..440355d3a0 100644 --- a/examples/storage/resumable-upload-uppy/index.html +++ b/examples/storage/resumable-upload-uppy/index.html @@ -44,7 +44,7 @@ Tus, } from 'https://releases.transloadit.com/uppy/v3.6.1/uppy.min.mjs' - const SUPABASE_ANON_KEY = 'replace-with-your-publishable-key' + const SUPABASE_PUBLISHABLE_KEY = 'replace-with-your-publishable-key' const SUPABASE_PROJECT_ID = 'replace-with-your-project-id' const STORAGE_BUCKET = 'replace-with-your-bucket-id' const BEARER_TOKEN='replace-with-your-bearer-token' @@ -63,7 +63,7 @@ endpoint: supabaseStorageURL, headers: { authorization: `Bearer ${BEARER_TOKEN}`, - apikey: SUPABASE_ANON_KEY, + apikey: SUPABASE_PUBLISHABLE_KEY, }, uploadDataDuringCreation: true, chunkSize: 6 * 1024 * 1024, diff --git a/examples/todo-list/nextjs-todo-list/README.md b/examples/todo-list/nextjs-todo-list/README.md index ba1a527233..5bc5473157 100644 --- a/examples/todo-list/nextjs-todo-list/README.md +++ b/examples/todo-list/nextjs-todo-list/README.md @@ -29,7 +29,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ## Supabase details diff --git a/examples/todo-list/sveltejs-todo-list/.env.example b/examples/todo-list/sveltejs-todo-list/.env.example index e588d442b8..a0b0bc8d97 100644 --- a/examples/todo-list/sveltejs-todo-list/.env.example +++ b/examples/todo-list/sveltejs-todo-list/.env.example @@ -1,3 +1,3 @@ # Update these with your Supabase details from your project settings > API VITE_SUPABASE_URL=https://your-project.supabase.co -VITE_SUPABASE_ANON_KEY=your-publishable-key \ No newline at end of file +VITE_SUPABASE_PUBLISHABLE_KEY=your-publishable-key \ No newline at end of file diff --git a/examples/todo-list/sveltejs-todo-list/README.md b/examples/todo-list/sveltejs-todo-list/README.md index f72c0cfc7c..e8ccd92afb 100644 --- a/examples/todo-list/sveltejs-todo-list/README.md +++ b/examples/todo-list/sveltejs-todo-list/README.md @@ -22,7 +22,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ## Supabase details diff --git a/examples/todo-list/sveltejs-todo-list/src/lib/db.ts b/examples/todo-list/sveltejs-todo-list/src/lib/db.ts index 849d990544..7a2443f7ab 100644 --- a/examples/todo-list/sveltejs-todo-list/src/lib/db.ts +++ b/examples/todo-list/sveltejs-todo-list/src/lib/db.ts @@ -3,5 +3,5 @@ import type { Database } from './schema' export const supabase = createClient( import.meta.env.VITE_SUPABASE_URL, - import.meta.env.VITE_SUPABASE_ANON_KEY + import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY ) diff --git a/examples/user-management/angular-user-management/README.md b/examples/user-management/angular-user-management/README.md index 3a7352997b..9f900f55c3 100644 --- a/examples/user-management/angular-user-management/README.md +++ b/examples/user-management/angular-user-management/README.md @@ -56,13 +56,13 @@ create policy "Anyone can upload an avatar." on storage.objects ### 3. Configure environment variables -Update the `src/environments/environment.ts` file with your Supabase project URL and anon key: +Update the `src/environments/environment.ts` file with your Supabase project URL and publishable key: ```typescript export const environment = { production: false, supabaseUrl: 'YOUR_SUPABASE_URL', - supabaseKey: 'YOUR_SUPABASE_ANON_KEY', + supabasePublishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY', } ``` diff --git a/examples/user-management/angular-user-management/src/app/supabase.service.ts b/examples/user-management/angular-user-management/src/app/supabase.service.ts index 9828062ec2..55c0164aa8 100644 --- a/examples/user-management/angular-user-management/src/app/supabase.service.ts +++ b/examples/user-management/angular-user-management/src/app/supabase.service.ts @@ -16,7 +16,7 @@ export class SupabaseService { private supabase: SupabaseClient constructor() { - this.supabase = createClient(environment.supabaseUrl, environment.supabaseKey) + this.supabase = createClient(environment.supabaseUrl, environment.supabasePublishableKey) } async getUser(): Promise { diff --git a/examples/user-management/angular-user-management/src/environments/environment.ts b/examples/user-management/angular-user-management/src/environments/environment.ts index 8ec4c763d7..61afc773ea 100644 --- a/examples/user-management/angular-user-management/src/environments/environment.ts +++ b/examples/user-management/angular-user-management/src/environments/environment.ts @@ -1,5 +1,5 @@ export const environment = { production: false, supabaseUrl: 'YOUR_SUPABASE_URL', - supabaseKey: 'YOUR_SUPABASE_KEY', + supabasePublishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY', } diff --git a/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts b/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts index 79141a0e40..7f73cb91de 100644 --- a/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts +++ b/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts @@ -19,9 +19,10 @@ interface WebhookPayload { old_record: null | Notification } +const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) const supabase = createClient( Deno.env.get('SUPABASE_URL')!, - Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + Deno.env.get(SUPABASE_SECRET_KEYS['default'])! ) Deno.serve(async (req) => { diff --git a/examples/user-management/expo-user-management/README.md b/examples/user-management/expo-user-management/README.md index bec8ab1fec..c99d084921 100644 --- a/examples/user-management/expo-user-management/README.md +++ b/examples/user-management/expo-user-management/README.md @@ -22,9 +22,9 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. -Run `cp .env.example .env` and fill your URL and anon key in the newly created `.env` file. +Run `cp .env.example .env` and fill your URL and publishable key in the newly created `.env` file. ### 4. Install the dependencies & run the project: diff --git a/examples/user-management/expo-user-management/lib/supabase.ts b/examples/user-management/expo-user-management/lib/supabase.ts index 2a7db3a645..c94e6b9915 100644 --- a/examples/user-management/expo-user-management/lib/supabase.ts +++ b/examples/user-management/expo-user-management/lib/supabase.ts @@ -2,9 +2,9 @@ import { createClient } from '@supabase/supabase-js' import AsyncStorage from '@react-native-async-storage/async-storage' const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL! -const supabaseKey = process.env.EXPO_PUBLIC_SUPABASE_KEY! +const supabasePublishableKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY! -export const supabase = createClient(supabaseUrl, supabaseKey, { +export const supabase = createClient(supabaseUrl, supabasePublishableKey, { auth: { storage: AsyncStorage as any, autoRefreshToken: true, diff --git a/examples/user-management/flutter-user-management/.env.example b/examples/user-management/flutter-user-management/.env.example index 4956a099f8..4f7cef971c 100644 --- a/examples/user-management/flutter-user-management/.env.example +++ b/examples/user-management/flutter-user-management/.env.example @@ -1,2 +1,2 @@ SUPABASE_URL=https://mysupabasereference.supabase.co -SUPABASE_ANON_KEY=my.supabase.anon.key \ No newline at end of file +SUPABASE_PUBLISHABLE_KEY=my.supabase.publishable.key \ No newline at end of file diff --git a/examples/user-management/ionic-angular-user-management/README.md b/examples/user-management/ionic-angular-user-management/README.md index aa1274fdbb..932a2bfa82 100644 --- a/examples/user-management/ionic-angular-user-management/README.md +++ b/examples/user-management/ionic-angular-user-management/README.md @@ -39,13 +39,13 @@ Once your database has started, run the "User Management Starter" quickstart. In ### 3. Get the URL and Key -Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `anon` key, you'll need these in the next step. +Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `publishable` key, you'll need these in the next step. -The `anon` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. This enables row level security for your data. Read more about this [below](#postgres-row-level-security). +The `publishable` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. This enables row level security for your data. Read more about this [below](#postgres-row-level-security). ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars @@ -55,7 +55,7 @@ Update your environment file `environment.ts` export const environment = { // ... supabaseUrl: "YOUR_SUPBASE_URL", - supbaseKey: "YOUR_SUPABASE_KEY" + supabasePublishableKey: "YOUR_SUPABASE_PUBLISHABLE_KEY" }; ``` diff --git a/examples/user-management/ionic-angular-user-management/src/app/supabase.service.ts b/examples/user-management/ionic-angular-user-management/src/app/supabase.service.ts index 425f6338c0..cc0952a62d 100644 --- a/examples/user-management/ionic-angular-user-management/src/app/supabase.service.ts +++ b/examples/user-management/ionic-angular-user-management/src/app/supabase.service.ts @@ -19,7 +19,7 @@ export class SupabaseService { private loadingCtrl: LoadingController, private toastCtrl: ToastController ) { - this.supabase = createClient(environment.supabaseUrl, environment.supabaseKey) + this.supabase = createClient(environment.supabaseUrl, environment.supabasePublishableKey) } get user() { diff --git a/examples/user-management/ionic-angular-user-management/src/environments/environment.prod.ts b/examples/user-management/ionic-angular-user-management/src/environments/environment.prod.ts index 8e857ba671..eb5c9a42bc 100644 --- a/examples/user-management/ionic-angular-user-management/src/environments/environment.prod.ts +++ b/examples/user-management/ionic-angular-user-management/src/environments/environment.prod.ts @@ -1,5 +1,5 @@ export const environment = { production: true, supabaseUrl: '', - supabaseKey: '', + supabasePublishableKey: '', } diff --git a/examples/user-management/ionic-angular-user-management/src/environments/environment.ts b/examples/user-management/ionic-angular-user-management/src/environments/environment.ts index eb4a336fea..05ebee8ad8 100644 --- a/examples/user-management/ionic-angular-user-management/src/environments/environment.ts +++ b/examples/user-management/ionic-angular-user-management/src/environments/environment.ts @@ -5,7 +5,7 @@ export const environment = { production: false, supabaseUrl: '', - supabaseKey: '', + supabasePublishableKey: '', } /* diff --git a/examples/user-management/ionic-react-user-management/README.md b/examples/user-management/ionic-react-user-management/README.md index 2fb6c08ca9..ec48a28248 100644 --- a/examples/user-management/ionic-react-user-management/README.md +++ b/examples/user-management/ionic-react-user-management/README.md @@ -25,7 +25,7 @@ This demonstrates how to use: The Vercel deployment will guide you through creating a Supabase account and project. After installation of the Supabase integration, all relevant environment variables will be set up so that the project is usable immediately after deployment 🚀. -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?project-name=supabase-ionic-react&repo-name=supabase-ionic-react&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20your%20project%20settings%20at%20supabase.com%2Fdashboard&repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fuser-management%2Fionic-react-user-management&env=VITE_SUPABASE_URL%2CVITE_SUPABASE_KEY) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?project-name=supabase-ionic-react&repo-name=supabase-ionic-react&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20your%20project%20settings%20at%20supabase.com%2Fdashboard&repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fuser-management%2Fionic-react-user-management&env=VITE_SUPABASE_URL%2CVITE_SUPABASE_PUBLISHABLE_KEY) ## Build from scratch @@ -45,7 +45,7 @@ The publishable key is your client-side API key. It allows "anonymous access" to ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars @@ -53,7 +53,7 @@ Create a `.env.local` file in the project root (or update your existing `.env.lo ```bash VITE_SUPABASE_URL=YOUR_SUPABASE_URL -VITE_SUPABASE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY +VITE_SUPABASE_PUBLISHABLE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY ``` Populate these variables with your project's URL and publishable key from the Supabase dashboard. diff --git a/examples/user-management/ionic-react-user-management/src/supabaseClient.ts b/examples/user-management/ionic-react-user-management/src/supabaseClient.ts index ada4b35afb..bd3962c23a 100644 --- a/examples/user-management/ionic-react-user-management/src/supabaseClient.ts +++ b/examples/user-management/ionic-react-user-management/src/supabaseClient.ts @@ -1,12 +1,12 @@ import { createClient } from '@supabase/supabase-js' const supabaseUrl = import.meta.env.VITE_SUPABASE_URL -const supabaseKey = import.meta.env.VITE_SUPABASE_KEY +const supabasePublishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY -if (!supabaseUrl || !supabaseKey) { +if (!supabaseUrl || !supabasePublishableKey) { throw new Error( - 'Missing Supabase environment variables: VITE_SUPABASE_URL and VITE_SUPABASE_KEY must be set.' + 'Missing Supabase environment variables: VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY must be set.' ) } -export const supabase = createClient(supabaseUrl, supabaseKey) +export const supabase = createClient(supabaseUrl, supabasePublishableKey) diff --git a/examples/user-management/ionic-vue-user-management/README.md b/examples/user-management/ionic-vue-user-management/README.md index 2f8ff0fda7..1e225eafed 100644 --- a/examples/user-management/ionic-vue-user-management/README.md +++ b/examples/user-management/ionic-vue-user-management/README.md @@ -25,7 +25,7 @@ This demonstrates how to use: The Vercel deployment will guide you through creating a Supabase account and project. After installation of the Supabase integration, all relevant environment variables will be set up so that the project is usable immediately after deployment 🚀. -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?project-name=supabase-ionic-vue&repo-name=supabase-ionic-vue&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20the%20your%20auto-generated%20docs%20at%20app.supabase.io&repository-url=https%3A%2F%2Fgithub.com%2Fmhartington%2Fsupabase-ionic-vue%2Ftree%2Fmain&env=VUE_APP_SUPABASE_URL%2CVUE_APP_SUPABASE_KEY) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?project-name=supabase-ionic-vue&repo-name=supabase-ionic-vue&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20the%20your%20auto-generated%20docs%20at%20app.supabase.io&repository-url=https%3A%2F%2Fgithub.com%2Fmhartington%2Fsupabase-ionic-vue%2Ftree%2Fmain&env=VUE_APP_SUPABASE_URL%2CVUE_APP_SUPABASE_PUBLISHABLE_KEY) ## Build from scratch @@ -45,7 +45,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars @@ -55,7 +55,7 @@ Update your environment file `environment.ts` export const environment = { // ... supabaseUrl: "YOUR_SUPABASE_URL", - supabaseKey: "YOUR_SUPABASE_KEY" + supabasePublishableKey: "YOUR_SUPABASE_PUBLISHABLE_KEY" }; ``` diff --git a/examples/user-management/ionic-vue-user-management/src/supabase.ts b/examples/user-management/ionic-vue-user-management/src/supabase.ts index 13459a5434..4894688f5f 100644 --- a/examples/user-management/ionic-vue-user-management/src/supabase.ts +++ b/examples/user-management/ionic-vue-user-management/src/supabase.ts @@ -1,7 +1,7 @@ import { createClient } from '@supabase/supabase-js' const supabaseUrl = process.env.VUE_APP_SUPABASE_URL -const supabaseKey = process.env.VUE_APP_SUPABASE_KEY +const supabasePublishableKey = process.env.VUE_APP_SUPABASE_PUBLISHABLE_KEY if (!supabaseUrl) { throw new Error( @@ -9,10 +9,10 @@ if (!supabaseUrl) { ) } -if (!supabaseKey) { +if (!supabasePublishableKey) { throw new Error( - 'Environment variable VUE_APP_SUPABASE_KEY is not set. Please define it before starting the application.' + 'Environment variable VUE_APP_SUPABASE_PUBLISHABLE_KEY is not set. Please define it before starting the application.' ) } -export const supabase = createClient(supabaseUrl, supabaseKey) +export const supabase = createClient(supabaseUrl, supabasePublishableKey) diff --git a/examples/user-management/nextjs-user-management/README.md b/examples/user-management/nextjs-user-management/README.md index 5e19d3b186..b11231a263 100644 --- a/examples/user-management/nextjs-user-management/README.md +++ b/examples/user-management/nextjs-user-management/README.md @@ -43,7 +43,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ## Supabase details diff --git a/examples/user-management/refine-user-management/README.MD b/examples/user-management/refine-user-management/README.MD index 613231429e..af90521897 100644 --- a/examples/user-management/refine-user-management/README.MD +++ b/examples/user-management/refine-user-management/README.MD @@ -43,7 +43,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars @@ -51,7 +51,7 @@ Create a file in this folder `.env.local` ``` VITE_SUPABASE_URL=YOUR_SUPABASE_URL -VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY +VITE_SUPABASE_PUBLISHABLE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY ``` Populate this file with your URL and Key. diff --git a/examples/user-management/refine-user-management/src/utility/supabaseClient.ts b/examples/user-management/refine-user-management/src/utility/supabaseClient.ts index 6479005aae..a80be8aef5 100644 --- a/examples/user-management/refine-user-management/src/utility/supabaseClient.ts +++ b/examples/user-management/refine-user-management/src/utility/supabaseClient.ts @@ -1,9 +1,9 @@ import { createClient } from '@refinedev/supabase' const supabaseUrl = import.meta.env.VITE_SUPABASE_URL -const supabaseKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY +const supabasePublishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY -export const supabaseClient = createClient(supabaseUrl, supabaseKey, { +export const supabaseClient = createClient(supabaseUrl, supabasePublishableKey, { db: { schema: 'public', }, diff --git a/examples/user-management/solid-user-management/README.md b/examples/user-management/solid-user-management/README.md index 6f51f9a018..0a3e64f206 100644 --- a/examples/user-management/solid-user-management/README.md +++ b/examples/user-management/solid-user-management/README.md @@ -45,7 +45,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars diff --git a/examples/user-management/svelte-user-management/.env.example b/examples/user-management/svelte-user-management/.env.example index f80575a5c6..994728b739 100644 --- a/examples/user-management/svelte-user-management/.env.example +++ b/examples/user-management/svelte-user-management/.env.example @@ -1,2 +1,2 @@ VITE_SUPABASE_URL=https://your-project-ref.supabase.co -VITE_SUPABASE_ANON_KEY=your-publishable-key \ No newline at end of file +VITE_SUPABASE_PUBLISHABLE_KEY=your-publishable-key \ No newline at end of file diff --git a/examples/user-management/svelte-user-management/README.md b/examples/user-management/svelte-user-management/README.md index a0de424be4..a3e7568de3 100644 --- a/examples/user-management/svelte-user-management/README.md +++ b/examples/user-management/svelte-user-management/README.md @@ -43,7 +43,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars diff --git a/examples/user-management/sveltekit-user-management/README.md b/examples/user-management/sveltekit-user-management/README.md index b8a026ea10..bce7de8d49 100644 --- a/examples/user-management/sveltekit-user-management/README.md +++ b/examples/user-management/sveltekit-user-management/README.md @@ -18,7 +18,7 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your ![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png) -**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. +**_NOTE_**: The `secret` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. ### 4. Env vars diff --git a/examples/user-management/swift-user-management/.env.example b/examples/user-management/swift-user-management/.env.example index f9345e27e6..a3ab7eee23 100644 --- a/examples/user-management/swift-user-management/.env.example +++ b/examples/user-management/swift-user-management/.env.example @@ -1,4 +1,4 @@ # Get these from your API settings: https://supabase.com/dashboard/project/_/settings/api SUPABASE_URL=https://mysupabasereference.supabase.co -SUPABASE_ANON_KEY=my.supabase.anon.key \ No newline at end of file +SUPABASE_PUBLISHABLE_KEY=my.supabase.publishable.key \ No newline at end of file diff --git a/examples/user-management/swift-user-management/swift-user-management/Supabase.swift b/examples/user-management/swift-user-management/swift-user-management/Supabase.swift index 716171bbd5..0430dd7158 100644 --- a/examples/user-management/swift-user-management/swift-user-management/Supabase.swift +++ b/examples/user-management/swift-user-management/swift-user-management/Supabase.swift @@ -10,5 +10,5 @@ import Supabase let supabase = SupabaseClient( supabaseURL: URL(string: DotEnv.SUPABASE_URL)!, - supabaseKey: DotEnv.SUPABASE_ANON_KEY + supabaseKey: DotEnv.SUPABASE_PUBLISHABLE_KEY ) diff --git a/examples/user-management/vue3-user-management/.env.example b/examples/user-management/vue3-user-management/.env.example index 8f2d04d8dd..994728b739 100644 --- a/examples/user-management/vue3-user-management/.env.example +++ b/examples/user-management/vue3-user-management/.env.example @@ -1,2 +1,2 @@ VITE_SUPABASE_URL=https://your-project-ref.supabase.co -VITE_SUPABASE_KEY=your-publishable-key \ No newline at end of file +VITE_SUPABASE_PUBLISHABLE_KEY=your-publishable-key \ No newline at end of file diff --git a/examples/user-management/vue3-user-management/src/supabase.js b/examples/user-management/vue3-user-management/src/supabase.js index b3fb0d5167..090e00bda1 100644 --- a/examples/user-management/vue3-user-management/src/supabase.js +++ b/examples/user-management/vue3-user-management/src/supabase.js @@ -1,6 +1,6 @@ import { createClient } from '@supabase/supabase-js' const supabaseUrl = import.meta.env.VITE_SUPABASE_URL -const supabasePublishableKey = import.meta.env.VITE_SUPABASE_KEY +const supabasePublishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY export const supabase = createClient(supabaseUrl, supabasePublishableKey) diff --git a/examples/with-cloudflare-workers/README.md b/examples/with-cloudflare-workers/README.md index d0dea0f3ae..ffb1ee224c 100644 --- a/examples/with-cloudflare-workers/README.md +++ b/examples/with-cloudflare-workers/README.md @@ -38,10 +38,10 @@ npx wrangler secret put SUPABASE_URL npx wrangler dev ``` -**Add a secret for SUPABASE_ANON_KEY** +**Add a secret for SUPABASE_PUBLISHABLE_KEY** ```bash -npx wrangler secret put SUPABASE_ANON_KEY +npx wrangler secret put SUPABASE_PUBLISHABLE_KEY ``` **Query data from Supabase** diff --git a/examples/with-cloudflare-workers/src/index.js b/examples/with-cloudflare-workers/src/index.js index d28f816dab..e2731c06c4 100644 --- a/examples/with-cloudflare-workers/src/index.js +++ b/examples/with-cloudflare-workers/src/index.js @@ -1,8 +1,8 @@ import { createClient } from '@supabase/supabase-js' export default { - async fetch(request, { SUPABASE_URL, SUPABASE_ANON_KEY }) { - const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY) + async fetch(request, { SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY }) { + const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY) const { data } = await supabase.from('articles').select('*') return new Response(JSON.stringify(data), {