0
0
Supabasecloud~10 mins

Setting up a Supabase project - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the Supabase client with your project URL.

Supabase
import { createClient } from '@supabase/supabase-js';

const supabaseUrl = '[1]';
const supabaseKey = 'your-anon-key';
const supabase = createClient(supabaseUrl, supabaseKey);
Drag options to blanks, or click blank then click option'
Ahttps://your-project.supabase.co
Bhttp://localhost:3000
Chttps://api.supabase.io
Dhttps://supabase.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local URL instead of the Supabase project URL.
Using the generic supabase.com URL instead of your project URL.
2fill in blank
medium

Complete the code to sign up a new user with email and password.

Supabase
const { data, error } = await supabase.auth.[1]({
  email: 'user@example.com',
  password: 'password123'
});
Drag options to blanks, or click blank then click option'
AsignUp
Bregister
Clogin
DcreateUser
Attempts:
3 left
💡 Hint
Common Mistakes
Using login instead of signUp to create a new user.
Using register or createUser which are not valid Supabase methods.
3fill in blank
hard

Fix the error in the code to fetch data from the 'profiles' table.

Supabase
const { data, error } = await supabase.from('[1]').select('*');
Drag options to blanks, or click blank then click option'
Aprofile_table
Bprofiles
Cusers
Dprofile
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular 'profile' instead of 'profiles'.
Using incorrect table names like 'users' or 'profile_table'.
4fill in blank
hard

Fill both blanks to update a user's profile with new data.

Supabase
const { data, error } = await supabase.from('[1]').update({ name: 'Alice' }).[2]('id', 1);
Drag options to blanks, or click blank then click option'
Aprofiles
Busers
Ceq
Dfilter
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'users' instead of 'profiles' table.
Using 'filter' instead of 'eq' for filtering.
5fill in blank
hard

Fill all three blanks to insert a new row and return the inserted data.

Supabase
const { data, error } = await supabase.from('[1]').insert([{ [2]: 'Bob', [3]: 30 }]).select();
Drag options to blanks, or click blank then click option'
Aprofiles
Bname
Cage
Dusers
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'users' instead of 'profiles' table.
Using wrong field names like 'username' or 'years'.