0
0
Supabasecloud~10 mins

JavaScript client installation in Supabase - Interactive Code Practice

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

Complete the code to import the Supabase client library.

Supabase
import { createClient } from '[1]';
Drag options to blanks, or click blank then click option'
Asupabase-client
B@supabase/supabase-js
Csupabase
Dsupabase-lib
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect package names like 'supabase-client' or 'supabase-lib'.
Forgetting to import the client before using it.
2fill in blank
medium

Complete the code to create a Supabase client instance with your project URL.

Supabase
const supabase = createClient('[1]', 'your-anon-key');
Drag options to blanks, or click blank then click option'
Aproject-url
Bsupabase-url
Cyour-project-url
DsupabaseProjectUrl
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong variable name or placeholder.
Confusing the URL with the anon key.
3fill in blank
hard

Fix the error in the code to correctly create the Supabase client.

Supabase
const supabase = createClient('your-project-url', [1]);
Drag options to blanks, or click blank then click option'
A'your-anon-key'
B'anon-key'
CanonKey
Danon_key
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the anon key without quotes causing a syntax error.
Using incorrect variable names.
4fill in blank
hard

Fill both blanks to initialize the Supabase client with environment variables.

Supabase
const supabase = createClient(process.env.[1], process.env.[2]);
Drag options to blanks, or click blank then click option'
ASUPABASE_URL
BSUPABASE_KEY
CSUPABASE_ANON_KEY
DSUPABASE_SECRET
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong environment variable names.
Mixing up anon key and secret key.
5fill in blank
hard

Fill all three blanks to import, create, and export the Supabase client.

Supabase
import { [1] } from '@supabase/supabase-js';

const supabase = [2]('[3]', process.env.SUPABASE_ANON_KEY);

export default supabase;
Drag options to blanks, or click blank then click option'
AcreateClient
BcreateClient()
Cyour-project-url
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses in the import statement.
Passing environment variable instead of string for URL in this example.