The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: update api examples for Auth
Jonathan Summers-Muir0a1968e2429b
diff --git a/www/data/products/auth/auth-api-examples.js b/www/data/products/auth/auth-api-examples.jsnew file mode 100644index 00000000000..af6e95be3d6--- /dev/null+++ b/www/data/products/auth/auth-api-examples.js@@ -0,0 +1,38 @@+export default [+ {+ lang: 'js',+ title: 'Create user',+ description: 'Sign up a new user in an example chat room',+ code: `import { createClient } from '@supabase/supabase-js'++ // Initialize+ const supabaseUrl = 'https://chat-room.supabase.co'+ const supabaseKey = 'public-anon-key'+ const supabase = createClient(supabaseUrl, supabaseKey)++ // Create a new user+ const { user, error } = await supabase.auth.signUp({+ email: '[email protected]',+ password: 'example-password',+ })+ `,+ },+ {+ lang: 'js',+ title: 'Update a user',+ description: 'Update a user',+ code: `import { createClient } from '@supabase/supabase-js'++ // Initialize+ const supabaseUrl = 'https://chat-room.supabase.co'+ const supabaseKey = 'public-anon-key'+ const supabase = createClient(supabaseUrl, supabaseKey)++ // Update multiple users+ const updatedUsers = await supabase+ .from('users')+ .eq('account_type', 'paid')+ .update({ highlight_color: 'gold' })+ `,+ },+]diff --git a/www/pages/auth/Auth.tsx b/www/pages/auth/Auth.tsxindex e1904a94d65..239fe362998 100644--- a/www/pages/auth/Auth.tsx+++ b/www/pages/auth/Auth.tsx@@ -32,7 +32,7 @@ import GithubExamples from '~/components/Sections/GithubExamples'import FeatureColumn from '~/components/FeatureColumn'import FloatingIcons from '~/components/FloatingIcons'-import ApiExamples from 'data/products/database/api-examples'+import ApiExamples from 'data/products/auth/auth-api-examples'import AuthSqlRulesExamples from 'data/products/auth/auth-sql-rules-examples'import CTABanner from '~/components/CTABanner'