From 8e87b051079d5c58253e31eb7ab2d6cbe2f8a5fd Mon Sep 17 00:00:00 2001 From: Dustin_dusTir Date: Sun, 6 Nov 2022 21:17:00 +0100 Subject: [PATCH] docs: fix inconsistent naming of the SupabaseClient instance for example change documentation export const supabaseClient = createClient( to export const supabase = createClient( and also change all the references to the changed variable name --- apps/docs/docs/guides/storage.mdx | 12 +++++----- apps/docs/docs/guides/with-nextjs.mdx | 8 +++---- apps/docs/docs/guides/with-redwoodjs.mdx | 4 ++-- apps/docs/docs/guides/with-sveltekit.mdx | 24 +++++++++---------- .../reference/javascript/release-notes.mdx | 4 ++-- .../reference/javascript/upgrade-guide.mdx | 4 ++-- apps/reference/_supabase_js/release-notes.md | 4 ++-- apps/reference/_supabase_js/upgrade-guide.mdx | 4 ++-- apps/reference/docs/guides/functions/auth.mdx | 6 ++--- apps/reference/docs/guides/storage.mdx | 12 +++++----- apps/reference/docs/guides/with-nextjs.mdx | 8 +++---- apps/reference/docs/guides/with-redwoodjs.mdx | 4 ++-- apps/reference/docs/guides/with-sveltekit.mdx | 24 +++++++++---------- apps/www/_blog/2022-08-16-supabase-js-v2.mdx | 4 ++-- 14 files changed, 61 insertions(+), 61 deletions(-) diff --git a/apps/docs/docs/guides/storage.mdx b/apps/docs/docs/guides/storage.mdx index b3568bcd72b..9929bfaa437 100644 --- a/apps/docs/docs/guides/storage.mdx +++ b/apps/docs/docs/guides/storage.mdx @@ -93,9 +93,9 @@ const { data, error } = await supabase.storage.createBucket('avatars') ```dart void main() async { - final client = SupabaseClient('supabaseUrl', 'supabaseKey'); + final supabase = SupabaseClient('supabaseUrl', 'supabaseKey'); - final storageResponse = await client + final storageResponse = await supabase .storage .createBucket('avatars'); } @@ -140,12 +140,12 @@ const { data, error } = await supabase.storage ```dart void main() async { - final client = SupabaseClient('supabaseUrl', 'supabaseKey'); + final supabase = SupabaseClient('supabaseUrl', 'supabaseKey'); // Create file `example.txt` and upload it in `public` bucket final file = File('example.txt'); file.writeAsStringSync('File content'); - final storageResponse = await client + final storageResponse = await supabase .storage .from('public') .upload('example.txt', file); @@ -190,9 +190,9 @@ const { data, error } = await supabase.storage.from('avatars').download('public/ ```dart void main() async { - final client = SupabaseClient('supabaseUrl', 'supabaseKey'); + final supabase = SupabaseClient('supabaseUrl', 'supabaseKey'); - final storageResponse = await client + final storageResponse = await supabase .storage .from('public') .download('example.txt'); diff --git a/apps/docs/docs/guides/with-nextjs.mdx b/apps/docs/docs/guides/with-nextjs.mdx index 030b1d41594..c00b560c51b 100644 --- a/apps/docs/docs/guides/with-nextjs.mdx +++ b/apps/docs/docs/guides/with-nextjs.mdx @@ -110,11 +110,11 @@ import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs' import { SessionContextProvider } from '@supabase/auth-helpers-react' function MyApp({ Component, pageProps }) { - const [supabaseClient] = useState(() => createBrowserSupabaseClient()) + const [supabase] = useState(() => createBrowserSupabaseClient()) return ( @@ -139,11 +139,11 @@ function MyApp({ }: AppProps<{ initialSession: Session, }>) { - const [supabaseClient] = useState(() => createBrowserSupabaseClient()) + const [supabase] = useState(() => createBrowserSupabaseClient()) return ( diff --git a/apps/docs/docs/guides/with-redwoodjs.mdx b/apps/docs/docs/guides/with-redwoodjs.mdx index a186de9ea5a..d0c813bc597 100644 --- a/apps/docs/docs/guides/with-redwoodjs.mdx +++ b/apps/docs/docs/guides/with-redwoodjs.mdx @@ -305,12 +305,12 @@ import { createClient } from '@supabase/supabase-js' // ... -const supabaseClient = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY) +const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY) const App = () => ( - + diff --git a/apps/docs/docs/guides/with-sveltekit.mdx b/apps/docs/docs/guides/with-sveltekit.mdx index 76a21a54da2..15d50d704ef 100644 --- a/apps/docs/docs/guides/with-sveltekit.mdx +++ b/apps/docs/docs/guides/with-sveltekit.mdx @@ -56,7 +56,7 @@ on the browser, and that's completely fine since we have [Row Level Security](/d import { createClient } from '@supabase/auth-helpers-sveltekit' import { env } from '$env/dynamic/public' -export const supabaseClient = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY) +export const supabase = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY) ``` And one optional step is to update the CSS file `public/global.css` to make the app look nice. @@ -78,7 +78,7 @@ Update your `src/routes/+layout.svelte`: ```html title=src/routes/+layout.svelte