The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: docs cleanup oct 22 (#9697)
Thor 雷神 Schaeff8bf9cd147741
diff --git a/apps/reference/docs/about.mdx b/apps/reference/docs/about.mdxindex cae9cc7125c..9c297d50491 100755--- a/apps/reference/docs/about.mdx+++ b/apps/reference/docs/about.mdx@@ -33,13 +33,13 @@ const frameworks = [{name: 'Expo',logo: ExpoLogo,- href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list',+ href: '/guides/with-expo',},{ name: 'Flutter', logo: FlutterLogo, href: '/guides/with-flutter' },{name: 'JavaScript',logo: JavascriptLogo,- href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth',+ href: '/reference/javascript/installing#javascript',},{name: 'Next.js',diff --git a/apps/reference/docs/guides/_partials/project_setup.mdx b/apps/reference/docs/guides/_partials/project_setup.mdxnew file mode 100644index 00000000000..271a3c426cb--- /dev/null+++ b/apps/reference/docs/guides/_partials/project_setup.mdx@@ -0,0 +1,66 @@+import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'+import UserManagementSQLTemplate from './user_management_quickstart_sql_template.md'++## Project set up++Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase+and then creating a "schema" inside the database.++### Create a project++1. Go to [app.supabase.com](https://app.supabase.com).+1. Click on "New Project".+1. Enter your project details.+1. Wait for the new database to launch.++### Set up the database schema++Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,+or you can just copy/paste the SQL from below and run it yourself.++<Tabs+ groupId="language"+ defaultValue="dashboard"+ values={[+ {label: 'Dashboard', value: 'dashboard'},+ {label: 'SQL', value: 'sql'},+ ]}>+<TabItem value="dashboard">++1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.+2. Click **User Management Starter**.+3. Click **Run**.++<video width="99%" muted playsInline controls="true">+ <source+ src="/docs/videos/sql-user-management-starter.mp4"+ type="video/mp4"+ muted+ playsInline+ />+</video>++</TabItem>+<TabItem value="sql">+<UserManagementSQLTemplate />+</TabItem>+</Tabs>++### Get the API Keys++Now that you've created some database tables, you are ready to insert data using the auto-generated API.+We just need to get the URL and `anon` key from the API settings.++1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.+2. Click **API** in the sidebar.+3. Find your API `URL`, `anon`, and `service_role` keys on this page.++<video width="99%" muted playsInline controls="true">+ <source+ src="/docs/videos/api/api-url-and-key.mp4"+ type="video/mp4"+ muted+ playsInline+ />+</video>diff --git a/apps/reference/docs/guides/_partials/quickstart_intro.md b/apps/reference/docs/guides/_partials/quickstart_intro.mdnew file mode 100644index 00000000000..36b56131364--- /dev/null+++ b/apps/reference/docs/guides/_partials/quickstart_intro.md@@ -0,0 +1,11 @@+## Intro++This example provides the steps to build a basic user management app. It includes:++- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.+- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).+- Supabase [Storage](/docs/guides/storage): users can upload a photo.+- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.+- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.++By the end of this guide you'll have an app which allows users to login and update some basic profile details:diff --git a/apps/reference/docs/guides/_partials/user_management_quickstart_sql_template.md b/apps/reference/docs/guides/_partials/user_management_quickstart_sql_template.mdnew file mode 100644index 00000000000..ba55c4aeab3--- /dev/null+++ b/apps/reference/docs/guides/_partials/user_management_quickstart_sql_template.md@@ -0,0 +1,55 @@+```sql+-- Create a table for public profiles+create table profiles (+ id uuid references auth.users not null primary key,+ updated_at timestamp with time zone,+ username text unique,+ full_name text,+ avatar_url text,+ website text,++ constraint username_length check (char_length(username) >= 3)+);+-- Set up Row Level Security (RLS)+-- See https://supabase.com/docs/guides/auth/row-level-security for more details.+alter table profiles+ enable row level security;++create policy "Public profiles are viewable by everyone." on profiles+ for select using (true);++create policy "Users can insert their own profile." on profiles+ for insert with check (auth.uid() = id);++create policy "Users can update own profile." on profiles+ for update using (auth.uid() = id);++-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.+-- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.+create function public.handle_new_user()+returns trigger as $$+begin+ insert into public.profiles (id, full_name, avatar_url)+ values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');+ return new;+end;+$$ language plpgsql security definer;+create trigger on_auth_user_created+ after insert on auth.users+ for each row execute procedure public.handle_new_user();++-- Set up Storage!+insert into storage.buckets (id, name)+ values ('avatars', 'avatars');++-- Set up access controls for storage.+-- See https://supabase.com/docs/guides/storage#policy-examples for more details.+create policy "Avatar images are publicly accessible." on storage.objects+ for select using (bucket_id = 'avatars');++create policy "Anyone can upload an avatar." on storage.objects+ for insert with check (bucket_id = 'avatars');++create policy "Anyone can update their own avatar." on storage.objects+ for update using (auth.uid() = owner) with check (bucket_id = 'avatars');+```diff --git a/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx b/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdxindex 700a1a75765..b69b42d8936 100644--- a/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx+++ b/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx@@ -290,9 +290,9 @@ export default function ProtectedPage({export const getServerSideProps = withPageAuth({redirectTo: '/',- async getServerSideProps(ctx, supabaseServerClient) {+ async getServerSideProps(ctx, supabase) {// Run queries with RLS on the server- const { data } = await supabaseServerClient(ctx).from('test').select('*')+ const { data } = await supabase.from('test').select('*')return { props: { data } }},})@@ -366,13 +366,9 @@ Wrap an API Route to check that the user has a valid session. If they're not log```js title="pages/api/protected-route.js"import { withApiAuth } from '@supabase/auth-helpers-nextjs'-export default withApiAuth(async function ProtectedRoute(- req,- res,- supabaseServerClient-) {+export default withApiAuth(async function ProtectedRoute(req, res, supabase) {// Run queries with RLS on the server- const { data } = await supabaseServerClient.from('test').select('*')+ const { data } = await supabase.from('test').select('*')res.json(data)})```diff --git a/apps/reference/docs/guides/examples.mdx b/apps/reference/docs/guides/examples.mdxindex 5234c5db680..30fc3eff526 100644--- a/apps/reference/docs/guides/examples.mdx+++ b/apps/reference/docs/guides/examples.mdx@@ -4,7 +4,9 @@ title: Examples and Resourcesdescription: 'Examples you can use to get started with Supabase'----We have a [set of examples](https://github.com/supabase/examples) in our [main repository](https://github.com/supabase/supabase) to help you get started.+<!-- This page is outdated and should not be added to the sidebar until it has been reworked -->++We have a [set of examples](https://github.com/supabase/supabase/tree/master/examples) in our [main repository](https://github.com/supabase/supabase) to help you get started.## Featured@@ -56,7 +58,7 @@ Build a basic Todo List with Supabase and your favorite frontend framework:- [Expo Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list)- [Next.js Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/nextjs-todo-list)- [React Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-todo-list)-- [Svelte Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/sveltejs-todo-list)+- [Svelte Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list)- [Vue 3 Todo List (Typescript).](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list)- [Angular Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/angular-todo-list)- [Nuxt 3 Todo List.](https://github.com/nuxt-community/supabase-module/tree/main/demo)@@ -64,7 +66,7 @@ Build a basic Todo List with Supabase and your favorite frontend framework:### Auth examples- [Supabase Auth with vanilla JavaScript.](https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth). Use Supabase without any frontend frameworks.-- [Supabase Auth with Next.js SSR.](https://github.com/supabase/examples/tree/main/supabase-js-v1/nextjs-with-supabase-auth) Uses cookies to persist auth between the server and the client.+- [Supabase Auth with Next.js](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management).- [Supabase Auth with RedwoodJS.](https://redwood-playground-auth.netlify.app/supabase) Try out Supabase authentication in the [RedwoodJS](https://redwoodjs.com) Authentication Playground complete with OAuth support and code samples.### Collaborativediff --git a/apps/reference/docs/guides/storage.mdx b/apps/reference/docs/guides/storage.mdxindex 7170f5857c9..566802059b7 100644--- a/apps/reference/docs/guides/storage.mdx+++ b/apps/reference/docs/guides/storage.mdx@@ -38,7 +38,7 @@ keep all video files in a "video" bucket, and profile pictures in an "avatar" bu## Getting startedThis is a quick guide that shows the basic functionality of Supabase Storage. Find a full-[example application in GitHub](https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management/nextjs-ts-user-management),+[example application in GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management),which you can deploy yourself.[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fuser-management%2Fnextjs-ts-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-nextjs-ts-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management)diff --git a/apps/reference/docs/guides/with-angular.mdx b/apps/reference/docs/guides/with-angular.mdxindex 604808ae2cb..2de33c1ae72 100644--- a/apps/reference/docs/guides/with-angular.mdx+++ b/apps/reference/docs/guides/with-angular.mdx@@ -7,143 +7,18 @@ sidebar_label: Angularimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Angular. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started!-### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management).-1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );-```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the App@@ -180,7 +55,7 @@ export const environment = {Now that we have the API credentials in place, let's create a **SupabaseService** with `ng g s supabase` to initialize the Supabase client and implement functions to communicate with the Supabase API.```ts title="src/app/supabase.service.ts"-import { Injectable } from '@angular/core';+import { Injectable } from '@angular/core'import {AuthChangeEvent,AuthSession,@@ -188,36 +63,36 @@ import {Session,SupabaseClient,User,-} from '@supabase/supabase-js';-import { environment } from 'src/environments/environment';-import { Database } from 'src/schema';+} from '@supabase/supabase-js'+import { environment } from 'src/environments/environment'+import { Database } from 'src/schema'export interface Profile {- id?: string;- username: string;- website: string;- avatar_url: string;+ id?: string+ username: string+ website: string+ avatar_url: string}@Injectable({providedIn: 'root',})export class SupabaseService {- private supabase: SupabaseClient;- _session: AuthSession | null = null;+ private supabase: SupabaseClient+ _session: AuthSession | null = nullconstructor() {this.supabase = createClient(environment.supabaseUrl,environment.supabaseKey- );+ )}get session() {this.supabase.auth.getSession().then(({ data }) => {- this._session = data.session;+ this._session = data.session})- return this._session;+ return this._session}profile(user: User) {@@ -225,38 +100,38 @@ export class SupabaseService {.from('profiles').select(`username, website, avatar_url`).eq('id', user.id)- .single();+ .single()}authChanges(callback: (event: AuthChangeEvent, session: Session | null) => void) {- return this.supabase.auth.onAuthStateChange(callback);+ return this.supabase.auth.onAuthStateChange(callback)}signIn(email: string) {- return this.supabase.auth.signInWithOtp({ email });+ return this.supabase.auth.signInWithOtp({ email })}signOut() {- return this.supabase.auth.signOut();+ return this.supabase.auth.signOut()}updateProfile(profile: Profile) {const update = {...profile,updated_at: new Date(),- };+ }- return this.supabase.from('profiles').upsert(update);+ return this.supabase.from('profiles').upsert(update)}downLoadImage(path: string) {- return this.supabase.storage.from('avatars').download(path);+ return this.supabase.storage.from('avatars').download(path)}uploadAvatar(filePath: string, file: File) {- return this.supabase.storage.from('avatars').upload(filePath, file);+ return this.supabase.storage.from('avatars').upload(filePath, file)}}```@@ -269,9 +144,9 @@ Let's set up an Angular component to manage logins and sign ups. We'll use MagicCreate an **AuthComponent** with `ng g c auth` Angular CLI command.```ts title="src/app/auth/auth.component.ts"-import { Component, OnInit } from '@angular/core';-import { FormBuilder } from '@angular/forms';-import { SupabaseService } from '../supabase.service';+import { Component, OnInit } from '@angular/core'+import { FormBuilder } from '@angular/forms'+import { SupabaseService } from '../supabase.service'@Component({selector: 'app-auth',@@ -279,11 +154,11 @@ import { SupabaseService } from '../supabase.service';styleUrls: ['./auth.component.css'],})export class AuthComponent implements OnInit {- loading = false;+ loading = falsesignInForm = this.formBuilder.group({email: '',- });+ })constructor(private readonly supabase: SupabaseService,@@ -294,18 +169,18 @@ export class AuthComponent implements OnInit {async onSubmit(): Promise<void> {try {- this.loading = true;- const email = this.signInForm.value.email as string;- const { error } = await this.supabase.signIn(email);- if (error) throw error;- alert('Check your email for the login link!');+ this.loading = true+ const email = this.signInForm.value.email as string+ const { error } = await this.supabase.signIn(email)+ if (error) throw error+ alert('Check your email for the login link!')} catch (error) {if (error instanceof Error) {- alert(error.message);+ alert(error.message)}} finally {- this.signInForm.reset();- this.loading = false;+ this.signInForm.reset()+ this.loading = false}}}@@ -347,10 +222,10 @@ Users also need a way to edit their profile details and manage their accounts afCreate an **AccountComponent** with the `ng g c account` Angular CLI command.```ts title="src/app/account/account.component.ts"-import { Component, Input, OnInit } from '@angular/core';-import { FormBuilder } from '@angular/forms';-import { AuthSession } from '@supabase/supabase-js';-import { Profile, SupabaseService } from '../supabase.service';+import { Component, Input, OnInit } from '@angular/core'+import { FormBuilder } from '@angular/forms'+import { AuthSession } from '@supabase/supabase-js'+import { Profile, SupabaseService } from '../supabase.service'@Component({selector: 'app-account',@@ -358,17 +233,17 @@ import { Profile, SupabaseService } from '../supabase.service';styleUrls: ['./account.component.css'],})export class AccountComponent implements OnInit {- loading = false;- profile!: Profile;+ loading = false+ profile!: Profile@Input()- session!: AuthSession;+ session!: AuthSessionupdateProfileForm = this.formBuilder.group({username: '',website: '',avatar_url: '',- });+ })constructor(private readonly supabase: SupabaseService,@@ -376,98 +251,90 @@ export class AccountComponent implements OnInit {) {}async ngOnInit(): Promise<void> {- await this.getProfile();+ await this.getProfile()- const { username, website, avatar_url } = this.profile;+ const { username, website, avatar_url } = this.profilethis.updateProfileForm.patchValue({username,website,avatar_url,- });+ })}async getProfile() {try {- this.loading = true;- const { user } = this.session;- let { data: profile, error, status } = await this.supabase.profile(user);+ this.loading = true+ const { user } = this.session+ let { data: profile, error, status } = await this.supabase.profile(user)if (error && status !== 406) {- throw error;+ throw error}if (profile) {- this.profile = profile;+ this.profile = profile}} catch (error) {if (error instanceof Error) {- alert(error.message);+ alert(error.message)}} finally {- this.loading = false;+ this.loading = false}}async updateProfile(): Promise<void> {try {- this.loading = true;- const { user } = this.session;+ this.loading = true+ const { user } = this.session- const username = this.updateProfileForm.value.username as string;- const website = this.updateProfileForm.value.website as string;- const avatar_url = this.updateProfileForm.value.avatar_url as string;+ const username = this.updateProfileForm.value.username as string+ const website = this.updateProfileForm.value.website as string+ const avatar_url = this.updateProfileForm.value.avatar_url as stringconst { error } = await this.supabase.updateProfile({id: user.id,username,website,avatar_url,- });- if (error) throw error;+ })+ if (error) throw error} catch (error) {if (error instanceof Error) {- alert(error.message);+ alert(error.message)}} finally {- this.loading = false;+ this.loading = false}}async signOut() {- await this.supabase.signOut();+ await this.supabase.signOut()}}``````html title="src/app/account/account.component.html"-<form [formGroup]="updateProfileForm" (ngSubmit)="updateProfile()" class="form-widget">+<form+ [formGroup]="updateProfileForm"+ (ngSubmit)="updateProfile()"+ class="form-widget"+><div><label for="email">Email</label><input id="email" type="text" [value]="session.user.email" disabled /></div><div><label for="username">Name</label>- <input- formControlName="username"- id="username"- type="text"- />+ <input formControlName="username" id="username" type="text" /></div><div><label for="website">Website</label>- <input- formControlName="website"- id="website"- type="url"- />+ <input formControlName="website" id="website" type="url" /></div><div>- <button- type="submit"- class="button primary block"- [disabled]="loading"- >+ <button type="submit" class="button primary block" [disabled]="loading">{{ loading ? 'Loading ...' : 'Update' }}</button></div>@@ -483,8 +350,8 @@ export class AccountComponent implements OnInit {Now that we have all the components in place, let's update **AppComponent**:```ts title="src/app/app.component.ts"-import { Component, OnInit } from '@angular/core';-import { SupabaseService } from './supabase.service';+import { Component, OnInit } from '@angular/core'+import { SupabaseService } from './supabase.service'@Component({selector: 'app-root',@@ -492,14 +359,14 @@ import { SupabaseService } from './supabase.service';styleUrls: ['./app.component.css'],})export class AppComponent implements OnInit {- title = 'angular-user-management';+ title = 'angular-user-management'- session = this.supabase.session;+ session = this.supabase.sessionconstructor(private readonly supabase: SupabaseService) {}ngOnInit() {- this.supabase.authChanges((_, session) => (this.session = session));+ this.supabase.authChanges((_, session) => (this.session = session))}}```@@ -516,14 +383,14 @@ export class AppComponent implements OnInit {`app.module.ts` also needs to be modified to include the `ReactiveFormsModule` from the `@angular/forms` package.```ts title="src/app/app.module.ts"-import { NgModule } from '@angular/core';-import { BrowserModule } from '@angular/platform-browser';+import { NgModule } from '@angular/core'+import { BrowserModule } from '@angular/platform-browser'-import { AppComponent } from './app.component';-import { AuthComponent } from './auth/auth.component';-import { AccountComponent } from './account/account.component';-import { ReactiveFormsModule } from '@angular/forms';-import { AvatarComponent } from './avatar/avatar.component';+import { AppComponent } from './app.component'+import { AuthComponent } from './auth/auth.component'+import { AccountComponent } from './account/account.component'+import { ReactiveFormsModule } from '@angular/forms'+import { AvatarComponent } from './avatar/avatar.component'@NgModule({declarations: [@@ -559,9 +426,9 @@ Let's create an avatar for the user so that they can upload a profile photo.Create an **AvatarComponent** with `ng g c avatar` Angular CLI command.```ts title="src/app/avatar/avatar.component.ts"-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';-import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';-import { SupabaseService } from '../supabase.service';+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'+import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'+import { SupabaseService } from '../supabase.service'@Component({selector: 'app-avatar',@@ -569,17 +436,17 @@ import { SupabaseService } from '../supabase.service';styleUrls: ['./avatar.component.css'],})export class AvatarComponent implements OnInit {- _avatarUrl: SafeResourceUrl | undefined;- uploading = false;+ _avatarUrl: SafeResourceUrl | undefined+ uploading = false@Input()set avatarUrl(url: string | null) {if (url) {- this.downloadImage(url);+ this.downloadImage(url)}}- @Output() upload = new EventEmitter<string>();+ @Output() upload = new EventEmitter<string>()constructor(private readonly supabase: SupabaseService,@@ -590,38 +457,38 @@ export class AvatarComponent implements OnInit {async downloadImage(path: string) {try {- const { data } = await this.supabase.downLoadImage(path);+ const { data } = await this.supabase.downLoadImage(path)if (data instanceof Blob) {this._avatarUrl = this.dom.bypassSecurityTrustResourceUrl(URL.createObjectURL(data)- );+ )}} catch (error) {if (error instanceof Error) {- console.error('Error downloading image: ', error.message);+ console.error('Error downloading image: ', error.message)}}}async uploadAvatar(event: any) {try {- this.uploading = true;+ this.uploading = trueif (!event.target.files || event.target.files.length === 0) {- throw new Error('You must select an image to upload.');+ throw new Error('You must select an image to upload.')}- const file = event.target.files[0];- const fileExt = file.name.split('.').pop();- const filePath = `${Math.random()}.${fileExt}`;+ const file = event.target.files[0]+ const fileExt = file.name.split('.').pop()+ const filePath = `${Math.random()}.${fileExt}`- await this.supabase.uploadAvatar(filePath, file);- this.upload.emit(filePath);+ await this.supabase.uploadAvatar(filePath, file)+ this.upload.emit(filePath)} catch (error) {if (error instanceof Error) {- alert(error.message);+ alert(error.message)}} finally {- this.uploading = false;+ this.uploading = false}}}@@ -662,10 +529,12 @@ export class AvatarComponent implements OnInit {And then we can add the widget on top of the **AccountComponent** html template:```html title="src/app/account.component.html"-<form [formGroup]="updateProfileForm" (ngSubmit)="updateProfile()" class="form-widget">- <app-avatar- [avatarUrl]="this.avatarUrl"- (upload)="updateAvatar($event)">+<form+ [formGroup]="updateProfileForm"+ (ngSubmit)="updateProfile()"+ class="form-widget"+>+ <app-avatar [avatarUrl]="this.avatarUrl" (upload)="updateAvatar($event)"></app-avatar><!-- input fields --></form>@@ -682,14 +551,14 @@ And add an `updateAvatar` function along with an `avatarUrl` getter to the **Accexport class AccountComponent implements OnInit {// ...get avatarUrl() {- return this.updateProfileForm.value.avatar_url as string;+ return this.updateProfileForm.value.avatar_url as string}async updateAvatar(event: string): Promise<void> {this.updateProfileForm.patchValue({avatar_url: event,- });- await this.updateProfile();+ })+ await this.updateProfile()}// ...}diff --git a/apps/reference/docs/guides/with-expo.mdx b/apps/reference/docs/guides/with-expo.mdxindex 95c7650e9b2..598fbf8f03d 100644--- a/apps/reference/docs/guides/with-expo.mdx+++ b/apps/reference/docs/guides/with-expo.mdx@@ -7,129 +7,18 @@ sidebar_label: Expoimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro+<QuickstartIntro />-This example provides the steps to build a simple user management app (from scratch!) using Supabase and React Native. It includes:+-- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.+### GitHub-By the end of this guide you'll have an app which allows users to login and update some basic profile details:+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/expo-user-management).-## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-flutter.mdx b/apps/reference/docs/guides/with-flutter.mdxindex 5b7b1970134..a904307801f 100644--- a/apps/reference/docs/guides/with-flutter.mdx+++ b/apps/reference/docs/guides/with-flutter.mdx@@ -7,131 +7,18 @@ sidebar_label: Flutterimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Flutter. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/flutter-user-management).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name, public)-values ('avatars', 'avatars', true);--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/flutter-user-management).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the App@@ -325,7 +212,7 @@ class _SplashPageState extends State<SplashPage> {Let's create a Flutter widget to manage logins and sign ups.We'll use Magic Links, so users can sign in with their email without using passwords.Notice that this page sets up a listener on the user's auth state using `onAuthStateChange`.-A new event will fire when the user comes back to the app by clicking their magic link, which this page can catch and redirect the user accordingly.+A new event will fire when the user comes back to the app by clicking their magic link, which this page can catch and redirect the user accordingly.```dart title="lib/pages/login_page.dart"import 'dart:async';diff --git a/apps/reference/docs/guides/with-ionic-angular.mdx b/apps/reference/docs/guides/with-ionic-angular.mdxindex 81acd5113f1..a0dea8bc0b7 100644--- a/apps/reference/docs/guides/with-ionic-angular.mdx+++ b/apps/reference/docs/guides/with-ionic-angular.mdx@@ -7,143 +7,18 @@ sidebar_label: Ionic Angularimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Ionic Angular. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started!-### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/mhartington/supabase-ionic-angular).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );-```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-angular).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-ionic-react.mdx b/apps/reference/docs/guides/with-ionic-react.mdxindex 6885fd6fbac..7ca3cb9ced7 100644--- a/apps/reference/docs/guides/with-ionic-react.mdx+++ b/apps/reference/docs/guides/with-ionic-react.mdx@@ -7,143 +7,18 @@ sidebar_label: Ionic Reactimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Ionic React. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started!-### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/mhartington/supabase-ionic-react).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );-```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-react).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-ionic-vue.mdx b/apps/reference/docs/guides/with-ionic-vue.mdxindex ed4984c797e..4292b8b9545 100644--- a/apps/reference/docs/guides/with-ionic-vue.mdx+++ b/apps/reference/docs/guides/with-ionic-vue.mdx@@ -7,143 +7,18 @@ sidebar_label: Ionic Vueimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Ionic Vue. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started!-### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/mhartington/supabase-ionic-vue).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );-```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-vue).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-nextjs.mdx b/apps/reference/docs/guides/with-nextjs.mdxindex 3d40b368b08..083567f8ed5 100644--- a/apps/reference/docs/guides/with-nextjs.mdx+++ b/apps/reference/docs/guides/with-nextjs.mdx@@ -7,161 +7,18 @@ sidebar_label: 'Next.js'import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Next.js. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-<!-- ## Video demo--Coming soon.--Use the annotated timeline to step through this tutorial.--## Instant deploy--Want to deploy a completed version of this example without following the guide?--[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Freact-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-react-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management)--Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started: -->--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- groupId="language"- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>+### GitHub-</TabItem>-<TabItem value="sql">--```sql--- Create a table for public profiles-create table profiles (- id uuid references auth.users not null primary key,- updated_at timestamp with time zone,- username text unique,- full_name text,- avatar_url text,- website text,-- constraint username_length check (char_length(username) >= 3)-);--- Set up Row Level Security (RLS)--- See https://supabase.com/docs/guides/auth/row-level-security for more details.-alter table profiles- enable row level security;--create policy "Public profiles are viewable by everyone." on profiles- for select using (true);--create policy "Users can insert their own profile." on profiles- for insert with check (auth.uid() = id);--create policy "Users can update own profile." on profiles- for update using (auth.uid() = id);---- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.--- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.-create function public.handle_new_user()-returns trigger as $$-begin- insert into public.profiles (id, full_name, avatar_url)- values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');- return new;-end;-$$ language plpgsql security definer;-create trigger on_auth_user_created- after insert on auth.users- for each row execute procedure public.handle_new_user();---- Set up Storage!-insert into storage.buckets (id, name)- values ('avatars', 'avatars');---- Set up access controls for storage.--- See https://supabase.com/docs/guides/storage#policy-examples for more details.-create policy "Avatar images are publicly accessible." on storage.objects- for select using (bucket_id = 'avatars');--create policy "Anyone can upload an avatar." on storage.objects- for insert with check (bucket_id = 'avatars');--create policy "Anyone can update their own avatar." on storage.objects- for update using ( auth.uid() = owner ) with check (bucket_id = 'avatars');--```+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management).-</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the App@@ -244,17 +101,18 @@ import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs'import { SessionContextProvider } from '@supabase/auth-helpers-react'function MyApp({ Component, pageProps }) {- const router = useRouter()const [supabaseClient] = useState(() => createBrowserSupabaseClient())return (<SessionContextProvidersupabaseClient={supabaseClient}initialSession={pageProps.initialSession}+ ><Component {...pageProps} /></SessionContextProvider>)}+export default MyApp```</TabItem>@@ -285,6 +143,7 @@ function MyApp({</SessionContextProvider>)}+export default MyApp```See the [Auth Helpers docs](/docs/guides/auth/auth-helpers/nextjs#usage-with-typescript) for more details on usage with TypeScript.@@ -305,11 +164,10 @@ npm install @supabase/auth-ui-reactAdd the `Auth` component to your home page```jsx title="pages/index.js"-import type { NextPage } from 'next'import { Auth, ThemeSupa } from '@supabase/auth-ui-react'import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'-const Home: NextPage = () => {+const Home = () => {const session = useSession()const supabase = useSupabaseClient()@@ -898,7 +756,9 @@ return (At this stage you have a fully functional application!- See the complete [example on GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management) and deploy it to Vercel.-- Explore the [Auth Helpers for Next.js](https://supabase.com/docs/guides/auth/auth-helpers/nextjs).- Explore the [pre-built Auth UI for React](https://supabase.com/docs/guides/auth/auth-helpers/auth-ui).+- Explore the [Auth Helpers for Next.js](https://supabase.com/docs/guides/auth/auth-helpers/nextjs).+- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers).+- See the [Next.js Supscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub.- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).- Sign in: [app.supabase.com](https://app.supabase.com)diff --git a/apps/reference/docs/guides/with-nuxt-3.mdx b/apps/reference/docs/guides/with-nuxt-3.mdxindex 604e642239c..d912f99bea5 100644--- a/apps/reference/docs/guides/with-nuxt-3.mdx+++ b/apps/reference/docs/guides/with-nuxt-3.mdx@@ -7,135 +7,18 @@ sidebar_label: Nuxt 3import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Nuxt 3. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />### Github-Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase-community/nuxt3-quickstarter).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase-community/nuxt3-quickstarter).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-react.mdx b/apps/reference/docs/guides/with-react.mdxindex a348e36e5f8..43deef7a598 100644--- a/apps/reference/docs/guides/with-react.mdx+++ b/apps/reference/docs/guides/with-react.mdx@@ -7,152 +7,18 @@ sidebar_label: Reactimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and React. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-<!-- ## Video demo--Coming soon.--Use the annotated timeline to step through this tutorial.--## Instant deploy--Want to deploy a completed version of this example without following the guide?--[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Freact-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-react-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management)--Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started: -->--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.+### GitHub-1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/react-user-management).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-solidjs.mdx b/apps/reference/docs/guides/with-solidjs.mdxindex 2aa83e84992..8cdacfcc4cf 100644--- a/apps/reference/docs/guides/with-solidjs.mdx+++ b/apps/reference/docs/guides/with-solidjs.mdx@@ -7,152 +7,18 @@ sidebar_label: SolidJSimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Solid JS. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-<!-- ## Video demo--Coming soon.--Use the annotated timeline to step through this tutorial.--## Instant deploy--Want to deploy a completed version of this example without following the guide?--[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fsolid-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-solid-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management)--Clicking this button the application will:--- Launch and prepare the Postgres database in Supabase.-- Launch the app in Vercel.-- Fork the example into your own GitHub account.-- Prepare the deployed application with all the necessary environment variables.--If you want to do it yourself, let's get started: -->--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.+### GitHub-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/solid-user-management).-</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the App@@ -271,9 +137,9 @@ interface Props {const Account: Component<Props> = ({ session }) => {const [loading, setLoading] = createSignal(true)- const [username, setUsername] = createSignal<string | null>(null)- const [website, setWebsite] = createSignal<string | null>(null)- const [avatarUrl, setAvatarUrl] = createSignal<string | null>(null)+ const [username, setUsername] = (createSignal < string) | (null > null)+ const [website, setWebsite] = (createSignal < string) | (null > null)+ const [avatarUrl, setAvatarUrl] = (createSignal < string) | (null > null)createEffect(() => {getProfile()diff --git a/apps/reference/docs/guides/with-svelte.mdx b/apps/reference/docs/guides/with-svelte.mdxindex c3fdea765d2..2a423276170 100644--- a/apps/reference/docs/guides/with-svelte.mdx+++ b/apps/reference/docs/guides/with-svelte.mdx@@ -7,135 +7,18 @@ sidebar_label: Svelteimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Svelte. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/svelte-user-management).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/svelte-user-management).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-sveltekit.mdx b/apps/reference/docs/guides/with-sveltekit.mdxindex 6687292a82f..8cf78ec9ff4 100644--- a/apps/reference/docs/guides/with-sveltekit.mdx+++ b/apps/reference/docs/guides/with-sveltekit.mdx@@ -7,135 +7,18 @@ sidebar_label: SvelteKitimport Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Svelte. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />-### Github--Whenever you get stuck at any point, take a look at [this repo](https://github.com/yustarandomname/svelte-supabase-quickstart).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new project to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.+### GitHub-<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/sveltekit-user-management).-1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the Appdiff --git a/apps/reference/docs/guides/with-vue-3.mdx b/apps/reference/docs/guides/with-vue-3.mdxindex 80b652a9f67..30a7be5449e 100644--- a/apps/reference/docs/guides/with-vue-3.mdx+++ b/apps/reference/docs/guides/with-vue-3.mdx@@ -7,135 +7,18 @@ sidebar_label: 'Vue 3'import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'+import QuickstartIntro from './_partials/quickstart_intro.md'+import ProjectSetup from './_partials/project_setup.mdx'-## Intro--This example provides the steps to build a simple user management app (from scratch!) using Supabase and Vue 3. It includes:--- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.-- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).-- Supabase [Storage](/docs/guides/storage): users can upload a photo.-- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.-- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.--By the end of this guide you'll have an app which allows users to login and update some basic profile details:+<QuickstartIntro />### GitHub-Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/vue3-user-management).--## Project set up--Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase-and then creating a "schema" inside the database.--### Create a project--1. Go to [app.supabase.com](https://app.supabase.com).-1. Click on "New Project".-1. Enter your project details.-1. Wait for the new database to launch.--### Set up the database schema--Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,-or you can just copy/paste the SQL from below and run it yourself.--<Tabs- defaultValue="dashboard"- values={[- {label: 'Dashboard', value: 'dashboard'},- {label: 'SQL', value: 'sql'},- ]}>-<TabItem value="dashboard">--1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.-2. Click **User Management Starter**.-3. Click **Run**.--<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/sql-user-management-starter.mp4"- type="video/mp4"- muted- playsInline- />-</video>--</TabItem>-<TabItem value="sql">--```sql--- Create a table for public "profiles"-create table profiles (- id uuid references auth.users not null,- updated_at timestamp with time zone,- username text unique,- avatar_url text,- website text,-- primary key (id),- unique(username),- constraint username_length check (char_length(username) >= 3)-);--alter table profiles enable row level security;--create policy "Public profiles are viewable by everyone."- on profiles for select- using ( true );--create policy "Users can insert their own profile."- on profiles for insert- with check ( auth.uid() = id );--create policy "Users can update own profile."- on profiles for update- using ( auth.uid() = id );---- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime add table profiles;---- Set up Storage!-insert into storage.buckets (id, name)-values ('avatars', 'avatars');--create policy "Avatar images are publicly accessible."- on storage.objects for select- using ( bucket_id = 'avatars' );--create policy "Anyone can upload an avatar."- on storage.objects for insert- with check ( bucket_id = 'avatars' );--```--</TabItem>-</Tabs>--### Get the API Keys--Now that you've created some database tables, you are ready to insert data using the auto-generated API.-We just need to get the URL and `anon` key from the API settings.--1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard.-2. Click **API** in the sidebar.-3. Find your API `URL`, `anon`, and `service_role` keys on this page.+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/vue3-user-management).-<video width="99%" muted playsInline controls="true">- <source- src="/docs/videos/api/api-url-and-key.mp4"- type="video/mp4"- muted- playsInline- />-</video>+<ProjectSetup />## Building the App@@ -190,26 +73,28 @@ Let's set up a Vue component to manage logins and sign ups. We'll use Magic Link```html title="/src/components/Auth.vue"<script setup>-import { ref } from 'vue'-import { supabase } from '../supabase'--const loading = ref(false)-const email = ref('')--const handleLogin = async () => {- try {- loading.value = true- const { error } = await supabase.auth.signInWithOtp({ email: email.value })- if (error) throw error- alert('Check your email for the login link!')- } catch (error) {- if (error instanceof Error) {- alert(error.message)+ import { ref } from 'vue'+ import { supabase } from '../supabase'++ const loading = ref(false)+ const email = ref('')++ const handleLogin = async () => {+ try {+ loading.value = true+ const { error } = await supabase.auth.signInWithOtp({+ email: email.value,+ })+ if (error) throw error+ alert('Check your email for the login link!')+ } catch (error) {+ if (error instanceof Error) {+ alert(error.message)+ }+ } finally {+ loading.value = false}- } finally {- loading.value = false}-}</script><template>@@ -218,11 +103,20 @@ const handleLogin = async () => {<h1 class="header">Supabase + Vue 3</h1><p class="description">Sign in via magic link with your email below</p><div>- <input class="inputField" type="email" placeholder="Your email" v-model="email" />+ <input+ class="inputField"+ type="email"+ placeholder="Your email"+ v-model="email"+ /></div><div>- <input type="submit" class="button block" :value="loading ? 'Loading' : 'Send magic link'"- :disabled="loading" />+ <input+ type="submit"+ class="button block"+ :value="loading ? 'Loading' : 'Send magic link'"+ :disabled="loading"+ /></div></div></form>@@ -236,80 +130,80 @@ Let's create a new component for that called `Account.vue`.```html title="src/components/Account.vue"<script setup>-import { supabase } from '../supabase'-import { onMounted, ref, toRefs } from 'vue'--const props = defineProps(['session'])-const { session } = toRefs(props)--const loading = ref(true)-const username = ref('')-const website = ref('')-const avatar_url = ref('')--onMounted(() => {- getProfile()-})--async function getProfile() {- try {- loading.value = true- const { user } = session.value-- let { data, error, status } = await supabase- .from('profiles')- .select(`username, website, avatar_url`)- .eq('id', user.id)- .single()-- if (error && status !== 406) throw error-- if (data) {- username.value = data.username- website.value = data.website- avatar_url.value = data.avatar_url+ import { supabase } from '../supabase'+ import { onMounted, ref, toRefs } from 'vue'++ const props = defineProps(['session'])+ const { session } = toRefs(props)++ const loading = ref(true)+ const username = ref('')+ const website = ref('')+ const avatar_url = ref('')++ onMounted(() => {+ getProfile()+ })++ async function getProfile() {+ try {+ loading.value = true+ const { user } = session.value++ let { data, error, status } = await supabase+ .from('profiles')+ .select(`username, website, avatar_url`)+ .eq('id', user.id)+ .single()++ if (error && status !== 406) throw error++ if (data) {+ username.value = data.username+ website.value = data.website+ avatar_url.value = data.avatar_url+ }+ } catch (error) {+ alert(error.message)+ } finally {+ loading.value = false}- } catch (error) {- alert(error.message)- } finally {- loading.value = false}-}--async function updateProfile() {- try {- loading.value = true- const { user } = session.value-- const updates = {- id: user.id,- username: username.value,- website: website.value,- avatar_url: avatar_url.value,- updated_at: new Date(),- }- let { error } = await supabase.from('profiles').upsert(updates)+ async function updateProfile() {+ try {+ loading.value = true+ const { user } = session.value++ const updates = {+ id: user.id,+ username: username.value,+ website: website.value,+ avatar_url: avatar_url.value,+ updated_at: new Date(),+ }- if (error) throw error- } catch (error) {- alert(error.message)- } finally {- loading.value = false+ let { error } = await supabase.from('profiles').upsert(updates)++ if (error) throw error+ } catch (error) {+ alert(error.message)+ } finally {+ loading.value = false+ }}-}--async function signOut() {- try {- loading.value = true- let { error } = await supabase.auth.signOut()- if (error) throw error- } catch (error) {- alert(error.message)- } finally {- loading.value = false++ async function signOut() {+ try {+ loading.value = true+ let { error } = await supabase.auth.signOut()+ if (error) throw error+ } catch (error) {+ alert(error.message)+ } finally {+ loading.value = false+ }}-}</script><template>@@ -328,8 +222,12 @@ async function signOut() {</div><div>- <input type="submit" class="button primary block" :value="loading ? 'Loading ...' : 'Update'"- :disabled="loading" />+ <input+ type="submit"+ class="button primary block"+ :value="loading ? 'Loading ...' : 'Update'"+ :disabled="loading"+ /></div><div>@@ -347,22 +245,22 @@ Now that we have all the components in place, let's update `App.vue`:```html title="src/App.vue"<script setup>-import { onMounted, ref } from 'vue'-import Account from './components/Account.vue'-import Auth from './components/Auth.vue'-import { supabase } from './supabase'+ import { onMounted, ref } from 'vue'+ import Account from './components/Account.vue'+ import Auth from './components/Auth.vue'+ import { supabase } from './supabase'-const session = ref()+ const session = ref()-onMounted(() => {- supabase.auth.getSession().then(({ data }) => {- session.value = data.session- })+ onMounted(() => {+ supabase.auth.getSession().then(({ data }) => {+ session.value = data.session+ })- supabase.auth.onAuthStateChange((_, _session) => {- session.value = _session+ supabase.auth.onAuthStateChange((_, _session) => {+ session.value = _session+ })})-})</script><template>@@ -393,72 +291,87 @@ Let's create an avatar for the user so that they can upload a profile photo. We```html title="src/components/Avatar.vue"<script setup>-import { ref, toRefs, watch } from 'vue'-import { supabase } from '../supabase'--const prop = defineProps(['path', 'size'])-const { path, size } = toRefs(prop)--const emit = defineEmits(['upload', 'update:path'])-const uploading = ref(false)-const src = ref('')-const files = ref()--const downloadImage = async () => {- try {- const { data, error } = await supabase.storage- .from('avatars')- .download(path.value)- if (error) throw error- src.value = URL.createObjectURL(data)- } catch (error) {- console.error('Error downloading image: ', error.message)- }-}--const uploadAvatar = async (evt) => {- files.value = evt.target.files- try {- uploading.value = true- if (!files.value || files.value.length === 0) {- throw new Error('You must select an image to upload.')+ import { ref, toRefs, watch } from 'vue'+ import { supabase } from '../supabase'++ const prop = defineProps(['path', 'size'])+ const { path, size } = toRefs(prop)++ const emit = defineEmits(['upload', 'update:path'])+ const uploading = ref(false)+ const src = ref('')+ const files = ref()++ const downloadImage = async () => {+ try {+ const { data, error } = await supabase.storage+ .from('avatars')+ .download(path.value)+ if (error) throw error+ src.value = URL.createObjectURL(data)+ } catch (error) {+ console.error('Error downloading image: ', error.message)}+ }- const file = files.value[0]- const fileExt = file.name.split('.').pop()- const filePath = `${Math.random()}.${fileExt}`-- let { error: uploadError } = await supabase.storage- .from('avatars')- .upload(filePath, file)-- if (uploadError) throw uploadError- emit('update:path', filePath)- emit('upload')- } catch (error) {- alert(error.message)- } finally {- uploading.value = false+ const uploadAvatar = async (evt) => {+ files.value = evt.target.files+ try {+ uploading.value = true+ if (!files.value || files.value.length === 0) {+ throw new Error('You must select an image to upload.')+ }++ const file = files.value[0]+ const fileExt = file.name.split('.').pop()+ const filePath = `${Math.random()}.${fileExt}`++ let { error: uploadError } = await supabase.storage+ .from('avatars')+ .upload(filePath, file)++ if (uploadError) throw uploadError+ emit('update:path', filePath)+ emit('upload')+ } catch (error) {+ alert(error.message)+ } finally {+ uploading.value = false+ }}-}-watch(path, () => {- if (path.value) downloadImage()-})+ watch(path, () => {+ if (path.value) downloadImage()+ })</script><template><div>- <img v-if="src" :src="src" alt="Avatar" class="avatar image"- :style="{ height: size + 'em', width: size + 'em' }" />- <div v-else class="avatar no-image" :style="{ height: size + 'em', width: size + 'em' }" />+ <img+ v-if="src"+ :src="src"+ alt="Avatar"+ class="avatar image"+ :style="{ height: size + 'em', width: size + 'em' }"+ />+ <div+ v-else+ class="avatar no-image"+ :style="{ height: size + 'em', width: size + 'em' }"+ /><div :style="{ width: size + 'em' }"><label class="button primary block" for="single">{{ uploading ? "Uploading ..." : "Upload" }}</label>- <input style="visibility: hidden; position: absolute" type="file" id="single" accept="image/*"- @change="uploadAvatar" :disabled="uploading" />+ <input+ style="visibility: hidden; position: absolute"+ type="file"+ id="single"+ accept="image/*"+ @change="uploadAvatar"+ :disabled="uploading"+ /></div></div></template>@@ -470,8 +383,8 @@ And then we can add the widget to the Account page:```html title="src/components/Account.vue"<script>-// Import the new component-import Avatar from './Avatar.vue'+ // Import the new component+ import Avatar from './Avatar.vue'</script><template>diff --git a/apps/reference/nav/_referenceSidebars.js b/apps/reference/nav/_referenceSidebars.jsindex dff79340fb5..d7bb0ce9bb1 100644--- a/apps/reference/nav/_referenceSidebars.js+++ b/apps/reference/nav/_referenceSidebars.js@@ -4,7 +4,7 @@ const sidebars = {type: 'category',label: 'Overview',collapsed: true,- items: ['about', 'guides/features', 'architecture', 'guides/examples'],+ items: ['about', 'guides/features', 'architecture'],},{type: 'category',diff --git a/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx b/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdxindex 6f4eb3c9995..7d0618917e9 100644--- a/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx+++ b/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx@@ -95,7 +95,7 @@ Thanks to a comunity contribution ([@\_mateomorris](https://twitter.com/_mateomo- Ionic Integration by [Simon Grimm](https://www.youtube.com/user/saimon1924) [[Video](https://www.youtube.com/watch?v=pl9XfIWutKE)]- Flutter Integration by [Aditya Thakur](https://www.youtube.com/channel/UChCAJNpMwoEUYCsE_eSyU4w) by [[Video](https://www.youtube.com/watch?v=fqfHEZvQPlY)]- Svelte Integration by [Khaerunnisa Isnaeni](https://www.youtube.com/channel/UCqNDj6eQeTLHuEwgEHWOGjw) [[Video](https://www.youtube.com/watch?v=odPYzJJyEJI)]-- An [example app](https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management) for adding User Profiles to your Next.js app+- An [example app](https://github.com/supabase/supabase/tree/master/examples/user-management) for adding User Profiles to your Next.js appdiff --git a/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx b/apps/www/_blog/2022-03-31-supabase-edge-functions.mdxindex 17965805b2a..fe17cc6ef21 100644--- a/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx+++ b/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx@@ -98,7 +98,7 @@ Our observability pipeline has been built [using Logflare](https://supabase.com/new —> deploy —> invoke —> logs-To round off the end-to-end experience, `supabase-js` now works in Deno, making it easy to interact with the rest of your Supabase project from within your Edge Functions. Your project's URLs, API keys, and database connection strings are made available as environment variables within your Function to make this even easier. And if you want to interact with third-party APIs which require a secret key, such as Stripe, you can easily and securely make these available to your Function as environment variables via the Supabase CLI. To get an idea for what is possible, check out our examples page [here](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions).+To round off the end-to-end experience, `supabase-js` now works in Deno, making it easy to interact with the rest of your Supabase project from within your Edge Functions. Your project's URLs, API keys, and database connection strings are made available as environment variables within your Function to make this even easier. And if you want to interact with third-party APIs which require a secret key, such as Stripe, you can easily and securely make these available to your Function as environment variables via the Supabase CLI. To get an idea for what is possible, check out our examples page [here](https://github.com/supabase/supabase/tree/master/examples/edge-functions).## Quickstartdiff --git a/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx b/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdxindex a77bde33aa4..9cc8c81b623 100644--- a/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx+++ b/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx@@ -130,7 +130,7 @@ Here's a collection of resources that will help you get started building with Su- [Edge Functions Guide](https://supabase.com/docs/guides/functions)- [Edge Functions Quickstart video](https://youtu.be/rzglqRdZUQE)- [Supabase CLI local development guide](https://supabase.com/docs/guides/local-development)-- [Edge Functions examples](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions)+- [Edge Functions examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions)### Additional Infodiff --git a/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx b/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdxindex 249fa8b6ea1..603cb16ea8f 100644--- a/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx+++ b/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx@@ -99,6 +99,6 @@ If you're inspired to build, check out some of the latest resources:- [Edge Functions Guide](https://supabase.com/docs/guides/functions)- [Edge Functions Quickstart video](https://youtu.be/rzglqRdZUQE)- [Supabase CLI local development guide](https://supabase.com/docs/guides/local-development)-- [Edge Functions examples](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions)+- [Edge Functions examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions)[^1]: Updated on June 14 2022 for search optimization: Removed links as account does not exist anymore on GitHubdiff --git a/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx b/apps/www/_blog/2022-06-07-beta-update-may-2022.mdxindex 8651a209a51..a35cc7d2a77 100644--- a/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx+++ b/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx@@ -20,9 +20,9 @@ Wildcard redirects are especially useful for Jamstack platforms with preview dep## Supabase Edge functions with Webhooks-Now you can deploy functions with optional JWT verification. This makes it easier to trigger Edge Functions with webhooks. Use the -no-verify-jwt flag when deploying your functions via the CLI to enable this mode. You can test this out with our [Edge Functions Telegram Bot example](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/telegram-bot).+Now you can deploy functions with optional JWT verification. This makes it easier to trigger Edge Functions with webhooks. Use the -no-verify-jwt flag when deploying your functions via the CLI to enable this mode. You can test this out with our [Edge Functions Telegram Bot example](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/telegram-bot).-[](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/telegram-bot)+[](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/telegram-bot)## Metrics for everybodydiff --git a/apps/www/components/BuiltWithSupabase/index.tsx b/apps/www/components/BuiltWithSupabase/index.tsxindex 25278aea0a1..f6d5541a538 100644--- a/apps/www/components/BuiltWithSupabase/index.tsx+++ b/apps/www/components/BuiltWithSupabase/index.tsx@@ -21,8 +21,8 @@ const BuiltExamples = () => {</Button></Link><Link- href="https://github.com/supabase/examples"- as="https://github.com/supabase/examples"+ href="https://github.com/supabase/supabase/tree/master/examples"+ as="https://github.com/supabase/supabase/tree/master/examples"passHref><Button as="a" type="default" icon={<IconGitHub />} size="small">diff --git a/apps/www/components/Sections/GithubExamples.tsx b/apps/www/components/Sections/GithubExamples.tsxindex c1ced5548e4..bbf0686b155 100644--- a/apps/www/components/Sections/GithubExamples.tsx+++ b/apps/www/components/Sections/GithubExamples.tsx@@ -42,8 +42,8 @@ function GithubExamples() {</Button></Link><Link- href="https://github.com/supabase/examples"- as="https://github.com/supabase/examples"+ href="https://github.com/supabase/supabase/tree/master/examples"+ as="https://github.com/supabase/supabase/tree/master/examples"><Button size="small" as="a" type="default" icon={<IconGitHub size={12} />}>Official GitHub librarydiff --git a/apps/www/data/Developers.json b/apps/www/data/Developers.jsonindex 63566610b8b..da5baac96f6 100644--- a/apps/www/data/Developers.json+++ b/apps/www/data/Developers.json@@ -14,7 +14,7 @@{"text": "Guides","description": "Examples and references for using Supabase.",- "url": "/docs/guides/examples",+ "url": "/docs/","icon": "M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"},{diff --git a/apps/www/data/Examples.json b/apps/www/data/Examples.jsonindex 7a590586647..2796512d6fa 100644--- a/apps/www/data/Examples.json+++ b/apps/www/data/Examples.json@@ -21,7 +21,7 @@"author_url": "https://github.com/supabase","author_img": "https://avatars.githubusercontent.com/u/54469796","repo_name": "nextjs-slack-clone",- "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone",+ "repo_url": "https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone","vercel_deploy_url": "","demo_url": ""},@@ -138,7 +138,7 @@"author_url": "https://github.com/supabase","author_img": "https://avatars.githubusercontent.com/u/54469796","repo_name": "sveltejs-todo-list",- "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/sveltejs-todo-list",+ "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list","vercel_deploy_url": "","demo_url": ""},diff --git a/apps/www/data/Footer.json b/apps/www/data/Footer.jsonindex bc567325dd5..3f7a76d2f40 100644--- a/apps/www/data/Footer.json+++ b/apps/www/data/Footer.json@@ -82,7 +82,7 @@},{"text": "Guides",- "url": "/docs/guides/examples"+ "url": "/docs/"},{"text": "Changelog",diff --git a/apps/www/data/ProjectExamples.json b/apps/www/data/ProjectExamples.jsonindex fe61e2014c5..34245e2c18b 100644--- a/apps/www/data/ProjectExamples.json+++ b/apps/www/data/ProjectExamples.json@@ -23,7 +23,7 @@{"imgUrl": "images/slack-clone.jpg","title": "Chat app with Next.js",- "url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone",+ "url": "https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone","description": "Build a full-stack Slack clone using Next.js and Supabase.","icons": [{diff --git a/apps/www/pages/storage/Storage.tsx b/apps/www/pages/storage/Storage.tsxindex d3c1fe1925b..686d543921a 100644--- a/apps/www/pages/storage/Storage.tsx+++ b/apps/www/pages/storage/Storage.tsx@@ -155,7 +155,7 @@ function StoragePage() {author_img={'https://avatars.githubusercontent.com/u/54469796'}repo_name={'nextjs-ts-user-management'}repo_url={- 'https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management/nextjs-ts-user-management'+ 'https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management'}vercel_deploy_url={'https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fuser-mangement%2Fnextjs-ts-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-nextjs-ts-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management'diff --git a/studio/components/interfaces/Home/Home.constants.ts b/studio/components/interfaces/Home/Home.constants.tsindex 7a3f187c7f4..e9752dc6b3a 100644--- a/studio/components/interfaces/Home/Home.constants.ts+++ b/studio/components/interfaces/Home/Home.constants.ts@@ -33,7 +33,7 @@ export const EXAMPLE_PROJECTS = [framework: 'NextJS',title: 'Next.js Realtime chat app',description: 'Next.js Slack clone app using Supabase realtime subscriptions',- url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone',+ url: 'https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone',},{framework: 'NextJS',@@ -87,7 +87,7 @@ export const EXAMPLE_PROJECTS = [framework: 'Svelte',title: 'Svelte todo list app',description: 'Sveltejs todo with TailwindCSS and Snowpack',- url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/sveltejs-todo-list',+ url: 'https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list',},{framework: 'VueJS',diff --git a/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts b/studio/components/interfaces/SQLEditor/SQLEditor.constants.tsindex 72bb1ebb60f..8e42b2291f7 100644--- a/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts+++ b/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts@@ -810,19 +810,19 @@ create publication supabase_realtimetitle: 'User Management Starter',description: 'Sets up a public Profiles table which you can access with your API.',sql: `--- Create a table for Public Profiles+-- Create a table for public profilescreate table profiles (- id uuid references auth.users not null,+ id uuid references auth.users not null primary key,updated_at timestamp with time zone,username text unique,+ full_name text,avatar_url text,website text,- primary key (id),- unique(username),constraint username_length check (char_length(username) >= 3));-+-- Set up Row Level Security (RLS)+-- See https://supabase.com/docs/guides/auth/row-level-security for more details.alter table profilesenable row level security;@@ -835,26 +835,34 @@ create policy "Users can insert their own profile." on profilescreate policy "Users can update own profile." on profilesfor update using (auth.uid() = id);--- Set up Realtime!-begin;- drop publication if exists supabase_realtime;- create publication supabase_realtime;-commit;-alter publication supabase_realtime- add table profiles;+-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.+-- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.+create function public.handle_new_user()+returns trigger as $$+begin+ insert into public.profiles (id, full_name, avatar_url)+ values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');+ return new;+end;+$$ language plpgsql security definer;+create trigger on_auth_user_created+ after insert on auth.users+ for each row execute procedure public.handle_new_user();-- Set up Storage!insert into storage.buckets (id, name)values ('avatars', 'avatars');+-- Set up access controls for storage.+-- See https://supabase.com/docs/guides/storage#policy-examples for more details.create policy "Avatar images are publicly accessible." on storage.objectsfor select using (bucket_id = 'avatars');create policy "Anyone can upload an avatar." on storage.objectsfor insert with check (bucket_id = 'avatars');-create policy "Anyone can update an avatar." on storage.objects- for update with check (bucket_id = 'avatars');+create policy "Anyone can update their own avatar." on storage.objects+ for update using ( auth.uid() = owner ) with check (bucket_id = 'avatars');`.trim(),},]