0
0
Supabasecloud~20 mins

JavaScript client installation in Supabase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Supabase JavaScript Client Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Supabase Client Initialization

You want to initialize the Supabase JavaScript client in your web app. Which option correctly creates the client instance?

Aconst supabase = new SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');
Bconst supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key');
Cconst supabase = supabase.createClient('https://xyzcompany.supabase.co', 'public-anon-key');
Dconst supabase = supabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');
Attempts:
2 left
💡 Hint

Check the official Supabase docs for the exact function name to create a client.

Configuration
intermediate
1:30remaining
Correct npm Package for Supabase Client

You want to install the Supabase JavaScript client in your project. Which npm command installs the official package?

Anpm install supabase-js
Bnpm install supabase
Cnpm install supabase-client
Dnpm install @supabase/supabase-js
Attempts:
2 left
💡 Hint

Look for the package name that starts with '@supabase'.

Architecture
advanced
2:30remaining
Best Practice for Storing Supabase Keys

In a client-side JavaScript app, where should you store your Supabase public anon key and service role key?

AStore the public anon key in client code, keep the service role key only on the server.
BStore both keys in environment variables and expose them to the client.
CEmbed both keys directly in the client JavaScript code.
DStore both keys in a public JSON file loaded by the client.
Attempts:
2 left
💡 Hint

Think about which keys are safe to share publicly and which must be kept secret.

service_behavior
advanced
2:00remaining
Supabase Client Behavior on Network Failure

What happens when the Supabase JavaScript client tries to fetch data but the network is offline?

AThe client silently ignores the request and returns empty data.
BThe client automatically retries the request indefinitely until the network is back.
CThe client throws an error immediately and does not retry the request.
DThe client queues the request and sends it when the network is restored.
Attempts:
2 left
💡 Hint

Consider how typical HTTP clients behave on network failure.

security
expert
3:00remaining
Preventing Unauthorized Access with Supabase Client

You want to restrict access to certain database rows based on the logged-in user using the Supabase JavaScript client. Which approach correctly enforces this?

AUse Row Level Security (RLS) policies on the Supabase database and authenticate users with the client.
BFilter data on the client side after fetching all rows from the database.
CStore user IDs in localStorage and filter queries based on that without server policies.
DUse the service role key in the client to bypass restrictions and filter manually.
Attempts:
2 left
💡 Hint

Think about where security enforcement should happen: client or server?