The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Move ref docs back to docs,again
Terry Sutton7f3048be823e
diff --git a/apps/docs/docs/reference/api.mdx b/apps/docs/docs/reference/api.mdxnew file mode 100644index 00000000000..371041af0bd--- /dev/null+++ b/apps/docs/docs/reference/api.mdx@@ -0,0 +1,37 @@+---+slug: /+sidebar_position: 1+id: management-api+title: Management API+sidebar_label: Management API+---++The Management API allows you to manage your projects programmatically.++## Status++The Management API is in `beta`. It is usable in it's current state, but it's likely that there will be breaking changes.++## Authentication++All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer <supabase_personal_token`.+To generate or manage your API token, visit your [account](https://app.supabase.com/account/tokens) page.+Your API tokens carry the same privileges as your user account, so be sure to keep it secret.++```bash+$ curl https://api.supabase.com/v1/projects \+-H "Authorization: Bearer sbp_bdd0••••••••••••••••••••••••••••••••4f23"+```++All API requests must be authenticated and made over HTTPS.++## Rate limits++The API is currently subject to our fair-use policy. In the future, are likely to introduce rate limits.+All resources created via the API are subject to the pricing detailed on our [Pricing](https://supabase.com/pricing) pages.++## Additional links++- [OpenAPI Docs](https://api.supabase.com/api/v1)+- [OpenAPI Spec](https://api.supabase.com/api/v1-json)+- Reporting bugs and issues: [github.com/supabase/supabase](https://github.com/supabase/supabase)diff --git a/apps/docs/docs/reference/api/release-notes.mdx b/apps/docs/docs/reference/api/release-notes.mdxnew file mode 100644index 00000000000..266d24b2f35--- /dev/null+++ b/apps/docs/docs/reference/api/release-notes.mdx@@ -0,0 +1,11 @@+---+id: release-notes+title: Release Notes+---++## v1.0.0 {#1.0.0}++Adds the following routes:++- `/v1/organizations`: Manage Supabase organizations+- `/v1/projects`: Manage Supabase projectsdiff --git a/apps/docs/docs/reference/auth.mdx b/apps/docs/docs/reference/auth.mdxnew file mode 100644index 00000000000..348d0858cd3--- /dev/null+++ b/apps/docs/docs/reference/auth.mdx@@ -0,0 +1,22 @@+---+slug: /+sidebar_position: 1+id: auth-server+title: Supabase Auth Server+sidebar_label: Supabase Auth Server+---++The Supabase Auth Server (GoTrue) is a JSON Web Token (JWT)-based API for managing users and issuing access tokens.++GoTrue is an open-source API written in Golang, that acts as a self-standing API service for handling user registration and authentication for JAM projects. It's based on OAuth2 and JWT and handles user signup, authentication, and custom user data.++## Client libraries++- [JavaScript](https://github.com/supabase/gotrue-js)+- [Dart](https://github.com/supabase/gotrue-dart)++## Additional Links++- [Source Code](https://github.com/supabase/gotrue)+- [Known bugs and issues](https://github.com/supabase/gotrue/issues)+- [Auth Guides](/docs/guides/auth)diff --git a/apps/docs/docs/reference/auth/release-notes.mdx b/apps/docs/docs/reference/auth/release-notes.mdxnew file mode 100644index 00000000000..31f92638755--- /dev/null+++ b/apps/docs/docs/reference/auth/release-notes.mdx@@ -0,0 +1,6 @@+---+id: release-notes+title: Release Notes+---++All release notes can be found in the [GitHub Releases](https://github.com/supabase/gotrue/releases) page.diff --git a/apps/docs/docs/reference/cli.mdx b/apps/docs/docs/reference/cli.mdxnew file mode 100644index 00000000000..5bfbe7e543a--- /dev/null+++ b/apps/docs/docs/reference/cli.mdx@@ -0,0 +1,28 @@+---+id: intro+slug: /+sidebar_position: 1+sidebar_label: Supabase CLI+title: Supabase CLI+hide_table_of_contents: true+---++The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform.+The CLI is still under development, but it contains all the functionality for working with your Supabase projects and the Supabase Platform.++- Run Supabase locally: [`supabase start`](/docs/reference/cli/usage#supabase-start)+- Manage database migrations: [`supabase migration`](/docs/reference/cli/usage#supabase-migration)+- CI/CD for releasing to production: [`supabase db push`](/docs/reference/cli/usage#supabase-db-push)+- Manage your Supabase projects: [`supabase projects`](/docs/reference/cli/usage#supabase-projects)+- Generate types directly from your database schema: [`supabase gen types`](/docs/reference/cli/usage#supabase-gen)+ - A [community-supported GitHub Action](https://github.com/lyqht/generate-supabase-db-types-github-action) to generate TypeScript types+- Shell autocomplete: [`supabase completion`](/docs/reference/cli/usage#supabase-completion)+ - A [community-supported Fig autocomplete spec](https://fig.io/manual/supabase) for macOS terminal++## Additional Links++- [Install the Supabase CLI](/docs/guides/cli)+- [Source code](https://github.com/supabase/cli)+- [Known bugs and issues](https://github.com/supabase/cli/issues)+- [Supabase CLI v1 and Management API Beta](https://supabase.com/blog/supabase-cli-v1-and-admin-api-beta)+- [The CLI team announcing CLI V1 and Management API Beta - Video](https://www.youtube.com/watch?v=OpPOaJI_Z28)diff --git a/apps/docs/docs/reference/cli/release-notes.mdx b/apps/docs/docs/reference/cli/release-notes.mdxnew file mode 100644index 00000000000..90221a3236c--- /dev/null+++ b/apps/docs/docs/reference/cli/release-notes.mdx@@ -0,0 +1,6 @@+---+id: release-notes+title: Release Notes+---++All release notes can be found in the [GitHub Releases page](https://github.com/supabase/cli/releases).diff --git a/apps/docs/docs/reference/dart.mdx b/apps/docs/docs/reference/dart.mdxnew file mode 100644index 00000000000..88095e50392--- /dev/null+++ b/apps/docs/docs/reference/dart.mdx@@ -0,0 +1,26 @@+---+id: intro+slug: /+title: Supabase Flutter Library+sidebar_label: Supabase Flutter Library+---++This reference documents every object and method available in Supabase's isomorphic Flutter library, [`supabase-flutter`](https://pub.dev/packages/supabase_flutter).++You can use the `supabase-flutter` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## For non-Flutter projects++We also have [supabase-dart](https://github.com/supabase-community/supabase-dart) for non-Flutter Dart projects, such as server-side Dart or Angular-Dart.+supabase-dart shares most of the APIs with supabase-flutter without being dependent on Flutter so that you can use Supabase anywhere you can run Dart!++## Additional Links++- Source Code: [github.com/supabase/supabase-flutter](https://github.com/supabase/supabase-flutter)+- [Known bugs and issues](https://github.com/supabase/supabase-flutter/issues)diff --git a/apps/docs/docs/reference/dart/initializing.mdx b/apps/docs/docs/reference/dart/initializing.mdxnew file mode 100644index 00000000000..00a69bbf1f3--- /dev/null+++ b/apps/docs/docs/reference/dart/initializing.mdx@@ -0,0 +1,42 @@+---+id: initializing+title: 'Initializing'+slug: initializing+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++## Flutter++For `supabase-flutter`, you will be using the static `initialize()` method on `Supabase` class.++### Flutter `initialize()`++```dart title=main.dart+Future<void> main() async {+ await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key');+ runApp(MyApp());+}+```++### Access `SupabaseClient` instance++Once you initialize Supabase in your `main()` method, you can access the `SupabaseClient` instance from anywhere in your app.++```dart+final supabase = Supabase.instance.client;+```++## Other Dart Projects++You can initialize a new Supabase client using the `SupabaseClient()` method.++The Supabase client is your entrypoint to the rest of the Supabase functionality+and is the easiest way to interact with everything we offer within the Supabase ecosystem.++### Dart `SupabaseClient()`++```dart+final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');+```diff --git a/apps/docs/docs/reference/dart/installing.mdx b/apps/docs/docs/reference/dart/installing.mdxnew file mode 100644index 00000000000..49822681a67--- /dev/null+++ b/apps/docs/docs/reference/dart/installing.mdx@@ -0,0 +1,24 @@+---+id: installing+title: 'Installing'+slug: installing+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++## Flutter++For Flutter project, you can use [supabase_flutter](https://pub.dev/packages/supabase_flutter) package.++```bash+flutter pub add supabase_flutter+```++## Other Dart projects++For non-Flutter projects using Dart, such as server-side Dart or Angular-Dart, you can use the [supabase](https://pub.dev/packages/supabase) package.++```bash+dart pub add supabase+```diff --git a/apps/docs/docs/reference/dart/upgrade-guide.mdx b/apps/docs/docs/reference/dart/upgrade-guide.mdxnew file mode 100644index 00000000000..707cdd06129--- /dev/null+++ b/apps/docs/docs/reference/dart/upgrade-guide.mdx@@ -0,0 +1,547 @@+---+id: upgrade-guide+title: Upgrade to supabase-flutter v1+description: 'Learn how to upgrade to supabase-flutter v1.'+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++supabase-flutter focuses on improving the developer experience and making it easier to use. This guide will help you upgrade from supabase-flutter v0 to v1.++## Upgrade the client library++Update the package in your pubspec.yaml file.++```yaml+supabase_flutter: ^1.0.0+```++## Error handling++The way supabase-flutter throws error has changed in v1. In v0, errors were returned as a response. In v1, errors are thrown as exceptions. This makes it more intuitive as a Flutter developer to handle errors.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final res = await supabase.from('my_table').select().execute();+final error = res.error;+if (error != null) {+ // handle error+}+final data = res.data;+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+try {+ final data = supabase.from('my_table').select();+} catch (error) {+ // handle error+}+```++</TabPanel>+</Tabs>++## Auth classes / methods++### Usage of `SupabaseAuthState` and `SupabaseAuthRequiredState` classes++In v0, `SupabaseAuthState` and `SupabaseAuthRequiredState` were required to handle automatic token refresh and to listen to auth state change. In v1, `SupabaseAuthState` and `SupabaseAuthRequiredState` are deprecated, and token refresh will happen automatically just by initializing Supabase. [`onAuthStateChange`](/docs/reference/dart/upgrade-guide#listening-to-auth-state-change) can be used to action on auth state change.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await Supabase.initialize(+ url: 'SUPABASE_URL',+ anonKey: 'SUPABASE_ANON_KEY',+);+...++class AuthState<T extends StatefulWidget> extends SupabaseAuthState<T> {+ ...+}++...++class AuthRequiredState<T extends StatefulWidget> extends SupabaseAuthState<T> {+ ...+}+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await Supabase.initialize(+ url: 'SUPABASE_URL',+ anonKey: 'SUPABASE_ANON_KEY',+);+```++</TabPanel>+</Tabs>++### Listening to auth state change++`onAuthStateChange` now returns a `Stream`.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final authSubscription = supabase.auth.onAuthStateChange((event, session) {+ // handle auth state change+});++// Unsubscribe when no longer needed+authSubscription.data?.unsubscribe();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+final authSubscription = supabase.auth.onAuthStateChange.listen((data) {+ final AuthChangeEvent event = data.event;+ final Session? session = data.session;+ // handle auth state change+ });++// Unsubscribe when no longer needed+authSubscription.cancel();+```++</TabPanel>+</Tabs>++### Sign in with email and password++The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.signIn(email: email, password: password);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.signInWithPassword(email: email, password: password);+```++</TabPanel>+</Tabs>++### Sign in with magic link++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.signIn(email: email);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.signInWithOtp(email: email);+```++</TabPanel>+</Tabs>++### Sign in with a third-party OAuth provider++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.signInWithProvider(+ Provider.github,+ options: AuthOptions(+ redirectTo: kIsWeb+ ? null+ : 'io.supabase.flutter://reset-callback/'),+);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.signInWithOAuth(+ Provider.github,+ redirectTo: kIsWeb ? null : 'io.supabase.flutter://reset-callback/',+);+```++</TabPanel>+</Tabs>++### Sign in with phone++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.signIn(+ phone: '+13334445555',+ password: 'example-password',+);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.signInWithPassword(+ phone: '+13334445555',+ password: 'example-password',+);+```++</TabPanel>+</Tabs>++### Sign in with phone using OTP++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final res = await supabase.auth.signIn(phone: phone);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.signInWithOtp(+ phone: phone,+);++// After receiving a SMS with a OTP.+await supabase.auth.verifyOTP(+ type: OtpType.sms,+ token: token,+ phone: phone,+);+```++</TabPanel>+</Tabs>++### Reset password for email++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.api.resetPasswordForEmail(+ email,+ options:+ AuthOptions(redirectTo: 'io.supabase.flutter://reset-callback/'),+);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.auth.resetPasswordForEmail(+ email,+ redirectTo: kIsWeb ? null : 'io.supabase.flutter://reset-callback/',+);+```++</TabPanel>+</Tabs>++### Get the user's current session++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final session = supabase.auth.session();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+final Session? session = supabase.auth.currentSession;+```++</TabPanel>+</Tabs>++### Get the logged-in user++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final user = supabase.auth.user();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+final User? user = supabase.auth.currentUser;+```++</TabPanel>+</Tabs>++### Update user data for a logged-in user++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase.auth.update(+ UserAttributes(data: {'hello': 'world'})+);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.updateUser(+ UserAttributes(+ data: { 'hello': 'world' },+ ),+);+```++</TabPanel>+</Tabs>++## Data methods++`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default.++Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end.++Also, calling `.execute()` at the end of the query was a requirement in v0, but in v1 `.execute` is deperecated.++### Insert without returning inserted data++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+await supabase+ .from('my_table')+ .insert(data, returning: ReturningOption.minimal)+ .execute();++```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.from('my_table').insert(data);+```++</TabPanel>+</Tabs>++### Insert with returning inserted data++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final res = await supabase+ .from('my_table')+ .insert(data)+ .execute();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+final insertedData = await supabase.from('my_table').insert(data).select();+```++</TabPanel>+</Tabs>++## Realtime methods++### Stream++`.stream()` no longer needs the `.execute()` at the end. Also, filtering by `eq` is a lot easier now. `primaryKey` is now a named parameter to make it more obvious what to pass.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+supabase.from('my_table:id=eq.120')+ .stream(['id'])+ .listen();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+supabase.from('my_table')+ .stream(primaryKey: ['id'])+ .eq('id', '120')+ .listen();+```++</TabPanel>+</Tabs>++### Subscribe++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+final subscription = supabase+ .from('countries')+ .on(SupabaseEventTypes.all, (payload) {+ // Handle realtime payload+ })+ .subscribe();+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+final channel = supabase.channel('*');+channel.on(+ RealtimeListenTypes.postgresChanges,+ ChannelFilter(event: '*', schema: '*'),+ (payload, [ref]) {+ // Handle realtime payload+ },+).subscribe();+```++</TabPanel>+</Tabs>++### Unsubscribe++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="0.x"+>+<TabPanel id="0.x" label="Before">++```dart+supabase.removeSubscription(subscription);+```++</TabPanel>+<TabPanel id="1.0x" label="After">++```dart+await supabase.removeChannel(channel);+```++</TabPanel>+</Tabs>diff --git a/apps/docs/docs/reference/dart/v0.mdx b/apps/docs/docs/reference/dart/v0.mdxnew file mode 100644index 00000000000..9d8f0a3c03e--- /dev/null+++ b/apps/docs/docs/reference/dart/v0.mdx@@ -0,0 +1,27 @@+---+id: intro+slug: /+sidebar_label: Supabase Dart Library+title: Supabase Dart Library+---++<Admonition type="caution">++You're viewing the docs for an older version of the `supabase-flutter` library.++</Admonition>++This reference documents every object and method available in Supabase's isomorphic Dart library, `supabase-dart`.++You can use the `supabase-dart` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## Additional Links++- Source Code: [github.com/supabase/supabase-dart](https://github.com/supabase/supabase-dart)+- [Known bugs and issues](https://github.com/supabase/supabase-dart/issues)diff --git a/apps/docs/docs/reference/javascript.mdx b/apps/docs/docs/reference/javascript.mdxnew file mode 100644index 00000000000..8f800d33dfc--- /dev/null+++ b/apps/docs/docs/reference/javascript.mdx@@ -0,0 +1,25 @@+---+slug: /+sidebar_position: 1+id: supabase-js+title: Supabase JavaScript Library+sidebar_label: Supabase JavaScript Library+hide_table_of_contents: true+---++This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.++You can use the `supabase-js` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## Additional Links++- Source Code: [github.com/supabase/supabase-js](https://github.com/supabase/supabase-js)+- TypeDoc: [supabase.github.io/supabase-js](https://supabase.github.io/supabase-js/v2/)+- NPM: [npmjs.com/package/@supabase/supabase-js](https://www.npmjs.com/package/@supabase/supabase-js)+- [Known bugs and issues](https://github.com/supabase/supabase-js/issues)diff --git a/apps/docs/docs/reference/javascript/installing.mdx b/apps/docs/docs/reference/javascript/installing.mdxnew file mode 100644index 00000000000..8fdc1a90e8a--- /dev/null+++ b/apps/docs/docs/reference/javascript/installing.mdx@@ -0,0 +1,37 @@+---+id: installing+title: 'Installing'+slug: installing+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++All JavaScript libraries are built directly by the Supabase team. this is in reference/js/installing++Other languages are built by the community and supported by Supabase.++## JavaScript++Via NPM++```bash+npm install @supabase/supabase-js+```++Via Yarn++```bash+yarn add @supabase/supabase-js+```++Find the source code on [GitHub](https://github.com/supabase/supabase-js).++Or via CDN++```js+<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>+//or+<script src="https://unpkg.com/@supabase/supabase-js@2"></script>+```diff --git a/apps/docs/docs/reference/javascript/release-notes.mdx b/apps/docs/docs/reference/javascript/release-notes.mdxnew file mode 100644index 00000000000..5204c4517b7--- /dev/null+++ b/apps/docs/docs/reference/javascript/release-notes.mdx@@ -0,0 +1,210 @@+---+id: release-notes+title: Release Notes+---++Supabase.js v2 release notes.++## 2.0.0++Install the latest with `npm install @supabase/supabase-js`.++### Explicit constructor options++All client specific options within the constructor are keyed to the library: [PR](https://github.com/supabase/supabase-js/pull/458):++```jsx+const supabase = createClient(apiURL, apiKey, {+ db: {+ schema: 'public',+ },+ auth: {+ storage: AsyncStorage,+ autoRefreshToken: true,+ persistSession: true,+ detectSessionInUrl: true,+ },+ realtime: {+ channels,+ endpoint,+ },+ global: {+ fetch: customFetch,+ headers: DEFAULT_HEADERS,+ },+})+```++### Typescript support++The libraries now support typescript.++```ts+// v2 - definitions are injected in `createClient()`+import type { Database } from './DatabaseDefinitions'+const supabase = createClient<Database>(SUPABASE_URL, ANON_KEY)+const { data } = await supabase.from('messages').select().match({ id: 1 })++// v1 -- previously definitions were injected in the `from()` method+supabase.from<Definitions['Message']>('messages').select('*')+```++Types can be generated via the CLI:++```bash+supabase start+supabase gen types typescript --local > DatabaseDefinitions.ts+```++### Data operations return minimal++`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).++Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end, e.g.:++```sql+const { data, error } = await supabase+ .from('my_table')+ .delete()+ .eq('id', 1)+ .select()+```++### New ordering defaults++`.order()` now defaults to Postgres’s default: [PR](https://github.com/supabase/postgrest-js/pull/283).++Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last. This is bad for performance if e.g. the column uses an index with `NULLS FIRST` (which is the default direction for indexes).++### Cookies and localstorage namespace++Storage key name in the Auth library has changed to include project reference which means that existing websites that had their JWT expiry set to a longer time could find their users logged out with this upgrade.++```jsx+const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`+```++### New Auth Types++Typescript typings have been reworked. `Session` interface now guarantees that it will always have an `access_token`, `refresh_token` and `user`++```jsx+interface Session {+ provider_token?: string | null+ access_token: string+ expires_in?: number+ expires_at?: number+ refresh_token: string+ token_type: string+ user: User+}+```++### New Auth methods++We're removing the `signIn()` method in favor of more explicit function signatures:+`signInWithPassword()`, `signInWithOtp()`, and `signInWithOtp()`.++```ts+// v2+const { data } = await supabase.auth.signInWithPassword({+ email: 'hello@example',+ password: 'pass',+})+// v1+const { data } = await supabase.auth.signIn({+ email: 'hello@example',+ password: 'pass',+})+```++### New Realtime methods++There is a new `channel()` method in the Realtime library, which will be used for our Multiplayer updates.++```ts+supabase+ .channel('any_string_you_want')+ .on('presence', { event: 'track' }, (payload) => {+ console.log(payload)+ })+ .subscribe()++supabase+ .channel('any_string_you_want')+ .on(+ 'postgres_changes',+ {+ event: 'INSERT',+ schema: 'public',+ table: 'movies',+ },+ (payload) => {+ console.log(payload)+ }+ )+ .subscribe()+```++We will deprecate the `.from().on().subscribe()` method previosuly used for listening to postgres changes.++### Deprecated setAuth()++Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead, pass the custom header into the `createClient()` method provided: ([PR](https://github.com/supabase/gotrue-js/pull/340))++### All changes++- `supabase-js`+ - `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).+- `postgrest-js`+ - TypeScript typings have been reworked [PR](https://github.com/supabase/postgrest-js/pull/279)+ - Use `undefined` instead of `null` for function params, types, etc. (https://github.com/supabase/postgrest-js/pull/278)+ - Some features are now obsolete: (https://github.com/supabase/postgrest-js/pull/275)+ - filter shorthands (e.g. `cs` vs. `contains`)+ - `body` in response (vs. `data`)+ - `upsert`ing through the `.insert()` method+ - `auth` method on `PostgrestClient`+ - client-level `throwOnError`+- `gotrue-js`+ - `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))+ - `signIn` method is now split into `signInWithPassword` , `signInWithOtp` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))+ - Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))+ - Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))+ - No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))+ - `AuthSessionMissingError`+ - Indicates that a session is expected but missing+ - `AuthNoCookieError`+ - Indicates that a cookie is expected but missing+ - `AuthInvalidCredentialsError`+ - Indicates that the incorrect credentials were passed+ - Renamed the `api` namespace to `admin` , the `admin` namespace will only contain methods that should only be used in a trusted server-side environment with the service role key+ - Moved `resetPasswordForEmail` , `getUser` and `updateUser` to the `GoTrueClient` which means they will be accessible from the `supabase.auth` namespace in `supabase-js` instead of having to do `supabase.auth.api` to access them+ - Removed `sendMobileOTP` , `sendMagicLinkEmail` in favor of `signInWithOtp`+ - Removed `signInWithEmail`, `signInWithPhone` in favor of `signInWithPassword`+ - Removed `signUpWithEmail` , `signUpWithPhone` in favor of `signUp`+ - Replaced `update` with `updateUser`+- `storage-js`+ - Return types are more strict. Functions types used to indicate that the data returned could be null even if there was no error. We now make use of union types which only mark the data as null if there is an error and vice versa. ([PR](https://github.com/supabase/storage-js/pull/60))+ - The `upload` and `update` function returns the path of the object uploaded as the `path` parameter. Previously the returned value had the bucket name prepended to the path which made it harder to pass the value on to other storage-js methods since all methods take the bucket name and path separately. We also chose to call the returned value `path` instead of `Key` ([PR](https://github.com/supabase/storage-js/pull/75))+ - `getPublicURL` only returns the public URL inside the data object. This keeps it consistent with our other methods of returning only within the data object. No error is returned since this method cannot does not throw an error ([PR](https://github.com/supabase/storage-js/pull/93))+ - signed urls are returned as `signedUrl` instead of `signedURL` in both `createSignedUrl` and `createSignedUrls` ([PR](https://github.com/supabase/storage-js/pull/94))+ - Encodes URLs returned by `createSignedUrl`, `createSignedUrls` and `getPublicUrl` ([PR](https://github.com/supabase/storage-js/pull/86))+ - `createsignedUrl` used to return a url directly and and within the data object. This was inconsistent. Now we always return values only inside the data object across all methods. ([PR](https://www.notion.so/LW5-supabase-js-v2-7b0bfcdf571d4f20b9b7a9308883f24b))+ - `createBucket` returns a data object instead of the name of the bucket directly. ([PR](https://github.com/supabase/storage-js/pull/89))+ - Fixed types for metadata ([PR](https://github.com/supabase/storage-js/pull/90))+ - Better error types make it easier to track down what went wrong quicker.+ - `SupabaseStorageClient` is no longer exported. Use `StorageClient` instead. ([PR](https://github.com/supabase/storage-js/pull/92)).+- `realtime-js`+ - `RealtimeSubscription` class no longer exists and replaced by `RealtimeChannel`.+ - `RealtimeClient`'s `disconnect` method now returns type of `void` . It used to return type of `Promise<{ error: Error | null; data: boolean }`.+ - Removed `removeAllSubscriptions` and `removeSubscription` methods from `SupabaseClient` class.+ - Removed `SupabaseRealtimeClient` class.+ - Removed `SupabaseQueryBuilder` class.+ - Removed `SupabaseEventTypes` type.+ - Thinking about renaming this to something like `RealtimePostgresChangeEvents` and moving it to `realtime-js` v2.+ - Removed `.from(’table’).on(’INSERT’, () ⇒ {}).subscribe()` in favor of new Realtime client API.+- `functions-js`+ - supabase-js v1 only threw an error if the fetch call itself threw an error (network errors, etc) and not if the function returned HTTP errors like 400s or 500s. We have changed this behaviour to return an error if your function throws an error.+ - We have introduced new error types to distinguish between different kinds of errors. A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function.+ - The correct content-type headers are automatically attached when sending the request if you don’t pass in a `Content-Type` header and pass in an argument to your function. We automatically attach the content type for `Blob`, `ArrayBuffer`, `File`, `FormData` ,`String` . If it doesn’t match any of these we assume the payload is `json` , we serialise the payload as JSON and attach the content type as `application/json`.+ - `responseType` does not need to be explicitly passed in. We parse the response based on the `Content-Type` response header sent by the function. We support parsing the responses as `text`, `json`, `blob`, `form-data` and are parsed as `text` by default.diff --git a/apps/docs/docs/reference/javascript/typescript-support.mdx b/apps/docs/docs/reference/javascript/typescript-support.mdxnew file mode 100644index 00000000000..fc1c765f752--- /dev/null+++ b/apps/docs/docs/reference/javascript/typescript-support.mdx@@ -0,0 +1,80 @@+---+id: typescript-support+title: Typescript Support+---++`supabase-js` supports Typescript.++## Generating types++You can use our CLI to generate types:++```bash+supabase start+supabase gen types typescript --local > lib/database.types.ts+```++These types are generated directly from your database. Given a table `public.movies`, the definition will provide the following data:++```ts+interface Database {+ public: {+ Tables: {+ movies: {+ Row: {} // The data expected to be returned from a "select" statement.+ Insert: {} // The data expected passed to an "insert" statement.+ Update: {} // The data expected passed to an "update" statement.+ }+ }+ }+}+```++There is a difference between `selects`, `inserts`, and `updates`, because often you will set default values in your database for specific columns.+With default values you do not need to send any data over the network, even if that column is a "required" field. Our type system is granular+enough to handle these situations.++## Injecting type definitions++You can enrich the supabase client with the types you generated with Supabase.++```ts+import { createClient } from '@supabase/supabase-js'+import { Database } from 'lib/database.types'++const supabase = createClient<Database>(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)+```++## Type hints++`supabase-js` always returns a `data` object (for success), and an `error` response (for unsuccessful requests).+This provides a simple interface to get the relevant types returned from any function:++```ts+export async function getMovies() {+ return await supabase.from('movies').select(`id, title`)+}++type MoviesResponse = Awaited<ReturnType<typeof getMovies>>+export type MoviesResponseSuccess = MoviesResponse['data']+export type MoviesResponseError = MoviesResponse['error']+```++## Nested tables++For advanced queries such as nested tables, you may want to construct your own types.++```ts+import supabase from '~/lib/supabase'+import type { Database } from '~/lib/database.types'++async function getMovies() {+ return await supabase.from('movies').select('id, title, actors(*)')+}++type Actors = Database['public']['Tables']['actors']['Row']+type MoviesResponse = Awaited<ReturnType<typeof getMovies>>+type MoviesResponseSuccess = MoviesResponse['data'] & {+ actors: Actors[]+}+```diff --git a/apps/docs/docs/reference/javascript/upgrade-guide.mdx b/apps/docs/docs/reference/javascript/upgrade-guide.mdxnew file mode 100644index 00000000000..282d66d4966--- /dev/null+++ b/apps/docs/docs/reference/javascript/upgrade-guide.mdx@@ -0,0 +1,439 @@+---+id: upgrade-guide+title: Upgrade to supabase-js v2+description: 'Learn how to upgrade to supabase-js v2.'+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++supabase-js v2 focuses on "quality-of-life" improvements for developers and addresses some of the largest pain points in v1. v2 includes type support, a rebuilt Auth library with async methods, improved errors, and more.++No new features will be added to supabase-js v1 , but we'll continuing merging security fixes to v1, with maintenance patches for the next 3 months.++## Upgrade the client library++```sh+npm install @supabase/supabase-js@2+```++_Optionally_ if you are using custom configuration with `createClient` then follow below:++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts title=src/supabaseClient.ts+const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ schema: 'custom',+ persistSession: false,+})+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts title=src/supabaseClient.ts+const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ db: {+ schema: 'custom',+ },+ auth: {+ persistSession: true,+ },+})+```++</TabPanel>+</Tabs>++Read more about the [constructor options](/docs/reference/javascript/release-notes#explicit-constructor-options).++### Auth methods++The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).++#### Sign in with email and password++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { user, error } = await supabase.auth.signIn({ email, password })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const {+ data: { user },+ error,+} = await supabase.auth.signInWithPassword({ email, password })+```++</TabPanel>+</Tabs>++#### Sign in with magic link++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { error } = await supabase.auth.signIn({ email })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { error } = await supabase.auth.signInWithOtp({ email })+```++</TabPanel>+</Tabs>++#### Sign in with a third-party provider++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { error } = await supabase.auth.signIn({ provider })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { error } = await supabase.auth.signInWithOAuth({ provider })+```++</TabPanel>+</Tabs>++#### Sign in with phone++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { error } = await supabase.auth.signIn({ phone, password })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { error } = await supabase.auth.signInWithPassword({ phone, password })+```++</TabPanel>+</Tabs>++#### Sign in with phone using OTP++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { error } = await supabase.auth.api.sendMobileOTP(phone)+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { data, error } = await supabase.auth.signInWithOtp({ phone })++// After receiving a SMS with a OTP.+const { data, error } = await supabase.auth.verifyOtp({ phone, token })+```++</TabPanel>+</Tabs>++#### Reset password for email++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { data, error } = await supabase.auth.api.resetPasswordForEmail(email)+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { data, error } = await supabase.auth.resetPasswordForEmail(email)+```++</TabPanel>+</Tabs>++#### Get the user's current session++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const session = supabase.auth.session()+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const {+ data: { session },+} = await supabase.auth.getSession()+```++</TabPanel>+</Tabs>++#### Get the logged-in user++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const user = supabase.auth.user()+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const {+ data: { session },+} = await supabase.auth.getSession()+const { user } = session+```++</TabPanel>+</Tabs>++#### Update user data for a logged-in user++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { user, error } = await supabase.auth.update({ attributes })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const {+ data: { user },+ error,+} = await supabase.auth.updateUser({ attributes })+```++</TabPanel>+</Tabs>++#### Use a custom `access_token` JWT with Supabase++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { user, error } = supabase.auth.setAuth(access_token)+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ global: {+ headers: {+ Authorization: `Bearer ${access_token}`,+ },+ },+})+```++</TabPanel>+</Tabs>++#### Cookie methods++The cookie-related methods like `setAuthCookie` and `getUserByCookie` have been removed.++For Next.js you can use the [Auth Helpers](https://supabase.com/docs/guides/auth/auth-helpers/nextjs) to help you manage cookies.+If you can't use the Auth Helpers, you can use [server-side rendering](https://supabase.com/docs/guides/auth/server-side-rendering).++Some the [PR](https://github.com/supabase/gotrue-js/pull/340) for additional background information.++### Data methods++`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).++Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end.++#### Insert and return data++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { data, error } = await supabase.auth.insert({ new_data })+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { data, error } = await supabase.auth.insert({ new_data }).select()+```++</TabPanel>+</Tabs>++#### Update and return data++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const { data, error } = await supabase.auth.update({ new_data }).eq('id', id)+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const { data, error } = await supabase.auth.update({ new_data }).eq('id', id).select()+```++</TabPanel>+</Tabs>++### Realtime methods++#### Subscribe++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+const userListener = supabase+ .from('users')+ .on('*', (payload) => handleAllEventsPayload(payload.new))+ .subscribe()+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+const userListener = supabase+ .channel('public:user')+ .on('postgres_changes', { event: '*', schema: 'public', table: 'user' }, (payload) =>+ handleAllEventsPayload()+ )+ .subscribe()+```++</TabPanel>+</Tabs>++#### Unsubscribe++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="1.0x"+>+<TabPanel id="1.0x" label="Before">++```ts+userListener.unsubscribe()+```++</TabPanel>+<TabPanel id="2.0x" label="After">++```ts+supabase.removeChannel(userListener)+```++</TabPanel>+</Tabs>diff --git a/apps/docs/docs/reference/javascript/v1.mdx b/apps/docs/docs/reference/javascript/v1.mdxnew file mode 100644index 00000000000..d31fd568739--- /dev/null+++ b/apps/docs/docs/reference/javascript/v1.mdx@@ -0,0 +1,22 @@+---+id: intro+title: 'Supabase JavaScript Library'+slug: /+sidebar_label: Supabase JavaScript Library+---++<Admonition type="caution">++You're viewing the docs for an older version of the `supabase-js` library.++</Admonition>++This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.++You can use the `supabase-js` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large filesdiff --git a/apps/docs/docs/reference/javascript/v1/generating-types.mdx b/apps/docs/docs/reference/javascript/v1/generating-types.mdxnew file mode 100644index 00000000000..033cfdb9165--- /dev/null+++ b/apps/docs/docs/reference/javascript/v1/generating-types.mdx@@ -0,0 +1,42 @@+---+id: generating-types+title: 'Generating Types'+slug: generating-types+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/api/generating-types).++## Usage with TypeScript++`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor.++When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain.+If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.++```ts+type Message = {+ id: number+ inserted_at: string+ message: string+ user_id: string+ channel_id: number+ author: { username: string }+}++const response = await supabase+ .from<Message>('messages') // Message maps to the type of the row in your database.+ .select('*, author:user_id(username)')+ .match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion.+response.data // Response data will be of type Array<Message>.++// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.+const response = await supabase+ .from<any>('messages')+ .select('*, author:user_id(username)')+ .match({ channel_id: 2 })+response.data // Response data will be of type Array<any>.+```diff --git a/apps/docs/docs/reference/javascript/v1/initializing.mdx b/apps/docs/docs/reference/javascript/v1/initializing.mdxnew file mode 100644index 00000000000..46d057e1cca--- /dev/null+++ b/apps/docs/docs/reference/javascript/v1/initializing.mdx@@ -0,0 +1,136 @@+---+id: initializing+title: 'Initializing'+slug: initializing+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++You can initialize a new Supabase client using the `createClient()` method.++The Supabase client is your entrypoint to the rest of the Supabase functionality+and is the easiest way to interact with everything we offer within the Supabase ecosystem.++## Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ supabaseUrl+ </span>+ <span className="method-list-item-label-badge required">+ required+ </span>+ <span className="method-list-item-validation">+ <code>string</code>+ </span>+ </h4>+ <div className="method-list-item-description">++The unique Supabase URL which is supplied when you create a new project in your project dashboard.++ </div>++</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ supabaseKey+ </span>+ <span className="method-list-item-label-badge required">+ required+ </span>+ <span className="method-list-item-validation">+ <code>string</code>+ </span>+ </h4>+ <div className="method-list-item-description">++The unique Supabase Key which is supplied when you create a new project in your project dashboard.++ </div>++</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ options+ </span>+ <span className="method-list-item-label-badge false">+ optional+ </span>+ <span className="method-list-item-validation">+ <code>SupabaseClientOptions</code>+ </span>+ </h4>+ <div className="method-list-item-description">++No description provided.++ </div>++</li>++</ul>++## Examples++### createClient()++```js+import { createClient } from '@supabase/supabase-js'++// Create a single supabase client for interacting with your database+const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')+```++### With additional parameters++```js+import { createClient } from '@supabase/supabase-js'++const options = {+ schema: 'public',+ headers: { 'x-my-custom-header': 'my-app-name' },+ autoRefreshToken: true,+ persistSession: true,+ detectSessionInUrl: true,+}+const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', options)+```++### API schemas++```js+import { createClient } from '@supabase/supabase-js'++// Provide a custom schema. Defaults to "public".+const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {+ schema: 'other_schema',+})+```++By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.+Go to `Settings > API > Schema` and add the schema which you want to expose to the API.++Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.++### Custom `fetch` implementation++```js+import { createClient } from '@supabase/supabase-js'++const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {+ fetch: fetch.bind(globalThis),+})+```++`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,+but an alternative `fetch` implementation can be provided as an option.+This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).diff --git a/apps/docs/docs/reference/javascript/v1/installing.mdx b/apps/docs/docs/reference/javascript/v1/installing.mdxnew file mode 100644index 00000000000..4441c7253d7--- /dev/null+++ b/apps/docs/docs/reference/javascript/v1/installing.mdx@@ -0,0 +1,37 @@+---+id: installing+title: 'Installing'+slug: installing+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++All JavaScript libraries are built directly by the Supabase team.++Other languages are built by the community and supported by Supabase.++## JavaScript++Via NPM++```bash+npm install @supabase/supabase-js+```++Via Yarn++```bash+yarn add @supabase/supabase-js+```++Find the source code on [GitHub](https://github.com/supabase/supabase-js).++Or via CDN++```js+<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@1"></script>+//or+<script src="https://unpkg.com/@supabase/supabase-js@1"></script>+```diff --git a/apps/docs/docs/reference/postgres/changing-timezones.mdx b/apps/docs/docs/reference/postgres/changing-timezones.mdxnew file mode 100644index 00000000000..d05e32afc8b--- /dev/null+++ b/apps/docs/docs/reference/postgres/changing-timezones.mdx@@ -0,0 +1,119 @@+---+id: changing-timezones+title: "Changing Timezones"+slug: changing-timezones+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Data types.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter database postgres+set timezone to 'America/New_York';+```+++</TabsPanel>++</Tabs>++++++## Notes++- View a full list of timezones on [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).+++++++++++## Examples++### Change timezone++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter database postgres+set timezone to 'America/New_York';+```+++</TabsPanel>++</Tabs>++### Full list of timezones++Get a full list of timezones supported by your database. This will return the following columns:++- `name`: Time zone name+- `abbrev`: Time zone abbreviation+- `utc_offset`: Offset from UTC (positive means east of Greenwich)+- `is_dst`: True if currently observing daylight savings+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+select name, abbrev, utc_offset, is_dst+from pg_timezone_names()+order by name;+```+++</TabsPanel>++</Tabs>++### Search for a specific timezone++Use `ilike` (case insensitive search) to find specific timezones.++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+select *+from pg_timezone_names()+where name ilike '%york%';+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/columns.mdx b/apps/docs/docs/reference/postgres/columns.mdxnew file mode 100644index 00000000000..0ccaa830381--- /dev/null+++ b/apps/docs/docs/reference/postgres/columns.mdx@@ -0,0 +1,95 @@+---+id: columns+title: "Columns"+slug: columns+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Creating columns.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create table table_name (+ id integer primary key,+ data jsonb,+ name text+);+```+++</TabsPanel>++</Tabs>++++++++++++++++++## Examples++### During table creation++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create table table_name (+ id integer primary key,+ data jsonb,+ name text+);+```+++</TabsPanel>++</Tabs>++### Create column++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter table new_table+add new_column text;+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/connection-strings.mdx b/apps/docs/docs/reference/postgres/connection-strings.mdxnew file mode 100644index 00000000000..12e4f919c9c--- /dev/null+++ b/apps/docs/docs/reference/postgres/connection-strings.mdx@@ -0,0 +1,135 @@+---+id: connection-strings+title: "Connection Strings"+slug: connection-strings+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++There are various ways to connect to your database, depending on the configuration of your Postgres instance and the tool which you are connecting with.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```bash+postgres://postgres:postgres@localhost:5432/postgres+# or+postgresql://postgres:postgres@localhost:5432/postgres+```+++</TabsPanel>++</Tabs>++++++## Notes++- [Official Documentation](https://www.postgresql.org/docs/current/libpq-connect.html).+- Avoid using special characters usernames and passwords. If you use special characters in a connection URL, you'll need to URL encode any special characters.+++++++++++## Examples++### Basic connection string++If you're using a default setup, your postgres connection string will likely be in the format:++`postgres://{user}:{password}@{host}:{port}/{database_name}`+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```bash+postgres://postgres:postgres@localhost:5432/postgres+# or+postgresql://postgres:postgres@localhost:5432/postgres+```+++</TabsPanel>++</Tabs>++### JDBC++See full [documentation](http://jdbc.postgresql.org/documentation/head/connect.html).++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```bash+jdbc:postgresql://{host}:{port}/{database_name}+```+++</TabsPanel>++</Tabs>++### ADO.NET++See full [documentation](http://npgsql.projects.postgresql.org/docs/manual/UserManual.html).++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```bash+Server=host;Port=5432;User Id=username;Password=secret;Database=database_name;+```+++</TabsPanel>++</Tabs>++### PHP++See full [documentation](http://php.net/manual/en/book.pgsql.php).++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```bash+host=hostname port=5432 dbname=databasename user=username password=secret+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/database-passwords.mdx b/apps/docs/docs/reference/postgres/database-passwords.mdxnew file mode 100644index 00000000000..9f58234b1a1--- /dev/null+++ b/apps/docs/docs/reference/postgres/database-passwords.mdx@@ -0,0 +1,53 @@+---+id: database-passwords+title: "Database Passwords"+slug: database-passwords+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Manage the passwords of your database users using any super user.+++++++++++++++++++++## Examples++### Password reset++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter user postgres+with password 'new_password';+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/database-users.mdx b/apps/docs/docs/reference/postgres/database-users.mdxnew file mode 100644index 00000000000..8ccca2ce94a--- /dev/null+++ b/apps/docs/docs/reference/postgres/database-users.mdx@@ -0,0 +1,53 @@+---+id: database-users+title: "Database Users"+slug: database-users+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Users and Roles are almost interchangeable.+++++++++++++++++++++## Examples++### Create New User++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create user new_user+with password 'hello';+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/index.mdx b/apps/docs/docs/reference/postgres/index.mdxnew file mode 100644index 00000000000..b6641472785--- /dev/null+++ b/apps/docs/docs/reference/postgres/index.mdx@@ -0,0 +1,15 @@+---+id: index+title: "Getting started"+slug: getting-started+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';+++PostgreSQL, also known as Postgres, is a free and open-source relational+database management system emphasizing extensibility and SQL compliance.+It was originally named POSTGRES, referring to its origins as a successor+to the Ingres database developed at the University of California, Berkeley.\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/publications.mdx b/apps/docs/docs/reference/postgres/publications.mdxnew file mode 100644index 00000000000..87559a38e34--- /dev/null+++ b/apps/docs/docs/reference/postgres/publications.mdx@@ -0,0 +1,210 @@+---+id: publications+title: "Publications"+slug: publications+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Publications are a way of grouping changes generated from a table or a group of tables.+These changes can then be sent to other systems (usually another Postgres database).+++++++++++++++++++++## Examples++### Create a Publication++This publication will contain all changes to all tables.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create publication publication_name+for all tables;+```+++</TabsPanel>++</Tabs>++### Create a Publication which listens to individual tables++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create publication publication_name+for table table_one, table_two;+```+++</TabsPanel>++</Tabs>++### Add tables to an existing publication++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter publication publication_name+add table table_name;+```+++</TabsPanel>++</Tabs>++### Listens to inserts only++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create publication publication_name+for all tables+with (publish = 'insert');+```+++</TabsPanel>++</Tabs>++### Listens to updates only++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create publication publication_name+for all tables+with (publish = 'update');+```+++</TabsPanel>++</Tabs>++### Listens to deletions only++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create publication publication_name+for all tables+with (publish = 'delete');+```+++</TabsPanel>++</Tabs>++### Remove a Publication++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+drop publication if exists publication_name;+```+++</TabsPanel>++</Tabs>++### Recreate a Publication++If you are planning to re-create a publication, it's best to do it in a transaction to ensure the operation succeeds.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+begin;+ -- remove the realtime publication+ drop publication if exists publication_name;++ -- re-create the publication but don't enable it for any tables+ create publication publication_name;+commit;+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/schemas.mdx b/apps/docs/docs/reference/postgres/schemas.mdxnew file mode 100644index 00000000000..ad4fbf6d9ef--- /dev/null+++ b/apps/docs/docs/reference/postgres/schemas.mdx@@ -0,0 +1,114 @@+---+id: schemas+title: "Schemas"+slug: schemas+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Schemas are like "folders". They help to keep your database organized.++Schemas are particularly useful for security. You can set different permissions on each schema.+For example, you might want to use a `public` schema for user-facing data, and an `auth` schema for all logins and secured data.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create schema schema_name;+```+++</TabsPanel>++</Tabs>++++++## Notes++- Schemas contain [tables](/docs/reference/postgres/tables), columns, triggers, functions, etc.+- Postgres comes with a `public` schema set up by default.+- It is best practice to use lowercase and underscores when naming schemas. For example: `schema_name`, not `Schema Name`.+++++++++++## Examples++### Creating a schema++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create schema schema_name;+```+++</TabsPanel>++</Tabs>++### Removing a schema++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+drop schema if exists schema_name;+```+++</TabsPanel>++</Tabs>++### Using special characters++Although it's not recommended, you can use uppercase and spaces when naming your schema by wrapping the name with double-quotes.+As a result, you will always need to use double-quotes when referencing your schema.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create schema "Schema Name";+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/postgres/tables.mdx b/apps/docs/docs/reference/postgres/tables.mdxnew file mode 100644index 00000000000..05df802a961--- /dev/null+++ b/apps/docs/docs/reference/postgres/tables.mdx@@ -0,0 +1,161 @@+---+id: tables+title: "Tables"+slug: tables+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml+---++import Tabs from '@theme/Tabs';+import TabsPanel from '@theme/TabsPanel';++Tables are similar to excel spreadsheets. They contain columns & rows of data. There are a few key differences from a spreadsheet however:++- Every column is a strict type of data. When you set up a column, you must define what "data type" it is.+- Tables can be joined together through relationships. For example you can have a "users" table, which is joined to a "teams" table.+++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create table table_name (+ id integer primary key,+ data jsonb,+ name text+);++# with schema+create table schema_name.table_name (+ id integer primary key,+ data jsonb,+ name text+);+```+++</TabsPanel>++</Tabs>++++++## Notes++- Tables contain columns, rows, triggers, comments,+- It is best practice to use lowercase and underscores when naming tables. For example: `table_name`, not `Table Name`.+- Tables belong to [schemas](/docs/reference/postgres/schemas). If you don't explicitly pass the schema, Postgres will assume that you want to create the table in the `public` schema.+++++++++++## Examples++### Create table++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create table table_name (+ id integer primary key,+ data jsonb,+ name text+);++# with schema+create table schema_name.table_name (+ id integer primary key,+ data jsonb,+ name text+);+```+++</TabsPanel>++</Tabs>++### Primary keys using multiple columns++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+create table table_name (+ column_1 data_type,+ column_2 data_type+ -- Constraints:+ primary key (column_1, column_2)+);+```+++</TabsPanel>++</Tabs>++### Multiple foreign keys to the same table++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+alter table table_name+ add constraint constraint_name_1 foreign key (column_1) references foreign_table(id),+ add constraint constraint_name_2 foreign key (column_2) references foreign_table(id);+```+++</TabsPanel>++</Tabs>++### Delete a table++++<Tabs+ defaultActiveId="sql"+ groupId="reference/postgres"+ values={[{ label: 'SQL', value: 'sql' }]}>++<TabsPanel id="sql" label="sql">++```sql+delete table if exists table_name;+```+++</TabsPanel>++</Tabs>\ No newline at end of filediff --git a/apps/docs/docs/reference/realtime.mdx b/apps/docs/docs/reference/realtime.mdxnew file mode 100644index 00000000000..890440d0ee9--- /dev/null+++ b/apps/docs/docs/reference/realtime.mdx@@ -0,0 +1,57 @@+---+slug: /+sidebar_position: 1+id: realtime+title: Supabase Realtime Server+sidebar_label: Supabase Realtime Server+---++Supabase Realtime is a server built with Elixir using the [Phoenix Framework](https://www.phoenixframework.org) that allows you to listen to changes in your PostgreSQL database via logical replication and then broadcast those changes via WebSockets.++There are two versions of this server: `Realtime` and `Realtime RLS`.++`Realtime` server works by:++1. listening to PostgreSQL's replication functionality (using PostgreSQL's logical decoding)+2. converting the byte stream into JSON+3. broadcasting to all connected clients over WebSockets++`Realtime RLS` server works by:++1. polling PostgreSQL's replication functionality (using PostgreSQL's logical decoding and [wal2json](https://github.com/eulerto/wal2json) output plugin)+2. passing database changes to a [Write Ahead Log Realtime Unified Security (WALRUS)](https://github.com/supabase/walrus) PostgresSQL function and receiving a list of authorized subscribers depending on Row Level Security (RLS) policies+3. converting the changes into JSON+4. broadcasting to authorized subscribers over WebSockets++## Why not just use PostgreSQL's `NOTIFY`?++A few reasons:++1. You don't have to set up triggers on every table.+2. `NOTIFY` has a payload limit of 8000 bytes and will fail for anything larger. The usual solution is to send an ID and then fetch the record, but that's heavy on the database.+3. `Realtime` server consumes two connections to the database, then you can connect many clients to this server. Easier on your database, and to scale up you just add additional `Realtime` servers.++## Benefits++1. The beauty of listening to the replication functionality is that you can make changes to your database from anywhere - your API, directly in the DB, via a console, etc. - and you will still receive the changes via WebSockets.+2. Decoupling. For example, if you want to send a new slack message every time someone makes a new purchase you might build that functionality directly into your API. This allows you to decouple your async functionality from your API.+3. This is built with Phoenix, an [extremely scalable Elixir framework](https://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections).++## Does this server guarantee delivery of every data change?++Not yet! Due to the following limitations:++1. Postgres database runs out of disk space due to Write-Ahead Logging (WAL) buildup, which can crash the database and prevent Realtime server from receiving and broadcasting changes. This can be mitigated in the Realtime RLS version of this server by setting the Postgres config `max_slot_wal_keep_size` to a reasonable size.+2. Realtime server can crash due to a larger replication lag than available memory, forcing the creation of a new replication slot and resetting replication to read from the latest WAL data.+3. When Realtime server falls too far behind for any reason, for example disconnecting from database as WAL continues to build up, then database can delete WAL segments the server still needs to read from, for example after reconnecting.++## Client libraries++- [JavaScript](https://github.com/supabase/realtime-js)+- [Dart](https://github.com/supabase/realtime-dart)++## Additional Links++- [Source Code](https://github.com/supabase/realtime)+- [Known bugs and issues](https://github.com/supabase/realtime/issues)+- [Realtime Guides](https://supabase.com/docs/guides/realtime)diff --git a/apps/docs/docs/reference/realtime/release-notes.mdx b/apps/docs/docs/reference/realtime/release-notes.mdxnew file mode 100644index 00000000000..b402b0d2708--- /dev/null+++ b/apps/docs/docs/reference/realtime/release-notes.mdx@@ -0,0 +1,7 @@+---+id: release-notes+---++# Release Notes++All release notes can be found in the [GitHub Releases](https://github.com/supabase/realtime/releases) page.diff --git a/apps/docs/docs/reference/storage.mdx b/apps/docs/docs/reference/storage.mdxnew file mode 100644index 00000000000..2ee380acae1--- /dev/null+++ b/apps/docs/docs/reference/storage.mdx@@ -0,0 +1,28 @@+---+slug: /+sidebar_position: 1+id: storage-server+title: Supabase Storage Server+sidebar_label: Supabase Storage Server+---++An S3 compatible object storage service that integrates with Postgres.++- Uses Postgres as it's datastore for storing metadata+- Authorization rules are written as Postgres Row Level Security policies+- Integrates with S3 as the storage backend (with more in the pipeline!)+- Extremely lightweight and performant++Read [this post](https://supabase.com/blog/supabase-storage) on why we decided to build a new object storage service.++## Client libraries++- [JavaScript](https://github.com/supabase/storage-js)+- [Dart](https://github.com/supabase/storage-dart)++## Additional Links++- [Source Code](https://github.com/supabase/storage-api)+- [Known bugs and issues](https://github.com/supabase/storage-js/issues)+- [Storage Guides](/guides/storage)+- [OpenAPI Docs](https://supabase.github.io/storage-api/)diff --git a/apps/docs/docs/reference/storage/release-notes.mdx b/apps/docs/docs/reference/storage/release-notes.mdxnew file mode 100644index 00000000000..52c333f12fb--- /dev/null+++ b/apps/docs/docs/reference/storage/release-notes.mdx@@ -0,0 +1,6 @@+---+id: release-notes+title: Release Notes+---++All release notes can be found in the [GitHub Releases](https://github.com/supabase/storage-api/releases) page.diff --git a/apps/docs/layouts/DefaultGuideLayout.tsx b/apps/docs/layouts/DefaultGuideLayout.tsxindex bcf0e870b1e..bcab55391c9 100644--- a/apps/docs/layouts/DefaultGuideLayout.tsx+++ b/apps/docs/layouts/DefaultGuideLayout.tsx@@ -84,7 +84,6 @@ const Layout: FC<Props> = ({ meta, children }) => {} doc-content-container prose dark:prose-dark dark:bg-scale-200 width-full mt-8 2xl:max-w-[880px]`}>{meta?.title && <h1>{meta.title}</h1>}-<MDXProvider components={components}>{children}</MDXProvider></article></div>diff --git a/apps/docs/pages/introduction.mdx b/apps/docs/pages/index.mdxsimilarity index 100%rename from apps/docs/pages/introduction.mdxrename to apps/docs/pages/index.mdxdiff --git a/apps/docs/pages/index.tsx b/apps/docs/pages/index.tsxdeleted file mode 100644index f915b10605b..00000000000--- a/apps/docs/pages/index.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { MDXProvider } from '@mdx-js/react'-import { MDXRemote } from 'next-mdx-remote'-import { serialize } from 'next-mdx-remote/serialize'-import components from '~/components'-import { menuItems } from '~/components/Navigation/Navigation.constants'--import Layout from '~/layouts/Default'-import { getDocsBySlug } from '../lib/docs'-export default function Home({- meta,- content,-}: {- meta: { title: string; description: string }- content: any-}) {- return (- <Layout meta={meta} menuItems={menuItems['docs']} currentPage="docs">- <MDXProvider components={components}>- <MDXRemote {...content} />- </MDXProvider>- </Layout>- )-}-export async function getStaticProps() {- const doc = getDocsBySlug('pages/introduction')- const content = await serialize(doc.content || '')- return {- props: {- ...doc,- content,- },- }-}