Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize a Supabase client with your project URL.
Supabase
const supabase = createClient('[1]', 'public-anonymous-key');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Firebase or other cloud URLs instead of Supabase project URL.
✗ Incorrect
You must use your Supabase project URL to connect the client properly.
2fill in blank
mediumComplete the code to sign up a user with email and password using Supabase.
Supabase
const { data, error } = await supabase.auth.[1]({ email, password }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'login' or 'register' instead of 'signUp'.
✗ Incorrect
The correct method to create a new user is signUp.
3fill in blank
hardFix the error in the code to fetch data from a Supabase table named 'profiles'.
Supabase
const { data, error } = await supabase.from('[1]').select('*'); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect table names like 'users' or 'auth'.
✗ Incorrect
The table name is 'profiles' to fetch user profile data.
4fill in blank
hardFill both blanks to insert a new row into the 'messages' table with Supabase.
Supabase
const { data, error } = await supabase.from('[1]').insert({ text: [2] }); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table names or missing quotes around text.
✗ Incorrect
You insert into the 'messages' table and provide the text as a string.
5fill in blank
hardFill all three blanks to update a user's profile with Supabase.
Supabase
const { data, error } = await supabase.from('[1]').update({ [2]: [3] }).eq('id', userId); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table names or missing quotes around the new username.
✗ Incorrect
Update the 'profiles' table, setting the 'username' field to a new string value.