You want to initialize the Supabase JavaScript client in your web app. Which option correctly creates the client instance?
Check the official Supabase docs for the exact function name to create a client.
The Supabase JavaScript client is created using the createClient function imported from '@supabase/supabase-js'. The other options use incorrect function or constructor names.
You want to install the Supabase JavaScript client in your project. Which npm command installs the official package?
Look for the package name that starts with '@supabase'.
The official Supabase JavaScript client package is named '@supabase/supabase-js'. Other package names are incorrect or unofficial.
In a client-side JavaScript app, where should you store your Supabase public anon key and service role key?
Think about which keys are safe to share publicly and which must be kept secret.
The public anon key is safe to include in client code because it has limited permissions. The service role key has full access and must be kept secret on the server only.
What happens when the Supabase JavaScript client tries to fetch data but the network is offline?
Consider how typical HTTP clients behave on network failure.
The Supabase client throws an error immediately on network failure. It does not retry or queue requests automatically.
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?
Think about where security enforcement should happen: client or server?
Row Level Security (RLS) policies on the database enforce access control securely. Client-side filtering or using the service role key in the client is insecure.