chore: update docs of supabase instructions

This commit is contained in:
Rotimi Best
2025-10-04 06:56:14 +01:00
parent 3bbc5d0927
commit 629753bcd0
4 changed files with 32 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
import { createClient } from '@supabase/supabase-js';
const supabase = createClient(
'https://kmpdoztwluxrgnthfkau.supabase.co',
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImttcGRvenR3bHV4cmdudGhma2F1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTc0MTA1NjAsImV4cCI6MjA3Mjk4NjU2MH0.A9pIKBSMNQXgumNYEzhQV6PjBV7iCc1bZ42hYkO0sC8'
);
const localSupabase = createClient(
'http://127.0.0.1:54321',
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
);
async function main() {
const { data, error } = await supabase.from('profile').select('*');
console.log(data);
console.log(error);
}
main();
@@ -52,12 +52,16 @@ Once you have an account just click on the _New Project_ on your dashboard. Afte
anywhere in the dashboard for security reasons.
</Callout>
### Setup Supabase CLI
Follow the instructions [here](https://supabase.com/docs/guides/local-development/cli/getting-started) to setup the Supabase CLI on your computer.
### Login to Supabase via the CLI
Open your terminal and go to the root of the project. Run the following:
```bash copy
pnpm supabase:login
supabase login
```
Follow the instruction in your terminal to generate your access token. Paste the token in the console and hit **Enter**
@@ -74,7 +78,7 @@ Follow the instruction in your terminal to generate your access token. Paste the
- Then run in your terminal:
```bash copy
pnpx supabase@1.51.1 db push --db-url "URL HERE"
supabase db push --db-url "URL HERE"
```
<Callout>