0
0
Supabasecloud~10 mins

Why production needs careful configuration in Supabase - Test Your Understanding

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

Complete the code to set the environment to production in Supabase configuration.

Supabase
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_KEY;
const supabase = createClient(supabaseUrl, supabaseKey, { env: '[1]' });
Drag options to blanks, or click blank then click option'
Adevelopment
Bproduction
Ctest
Dstaging
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' instead of 'production' causes the app to run with test settings.
Leaving the environment undefined can lead to unexpected behavior.
2fill in blank
medium

Complete the code to enable SSL enforcement in Supabase client configuration for production.

Supabase
const supabase = createClient(supabaseUrl, supabaseKey, { ssl: [1] });
Drag options to blanks, or click blank then click option'
Afalse
Bnull
Cundefined
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Setting ssl to false disables encryption, risking data security.
Using null or undefined does not enforce SSL.
3fill in blank
hard

Fix the error in the Supabase client initialization to correctly use the production API key.

Supabase
const supabaseKey = '[1]';
const supabase = createClient(supabaseUrl, supabaseKey);
Drag options to blanks, or click blank then click option'
ASUPABASE_KEY
Bprocess.env.SUPABASE_API_KEY
Cprocess.env.SUPABASE_KEY
DsupabaseKey
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong environment variable name causes authentication failure.
Using a plain string instead of environment variable leaks secrets.
4fill in blank
hard

Fill both blanks to configure Supabase client with production environment and enable SSL.

Supabase
const supabase = createClient(supabaseUrl, supabaseKey, { env: '[1]', ssl: [2] });
Drag options to blanks, or click blank then click option'
Aproduction
Bfalse
Ctrue
Ddevelopment
Attempts:
3 left
💡 Hint
Common Mistakes
Setting env to development in production causes wrong behavior.
Disabling SSL exposes data to risks.
5fill in blank
hard

Fill all three blanks to create a secure Supabase client with production environment, SSL enabled, and a timeout of 30 seconds.

Supabase
const supabase = createClient(supabaseUrl, supabaseKey, { env: '[1]', ssl: [2], timeout: [3] });
Drag options to blanks, or click blank then click option'
Aproduction
Btrue
C30000
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for ssl disables security.
Setting timeout too low or missing it can cause connection issues.