The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update all admonitions
Joshen Lima7f7cae6ffe5
diff --git a/apps/temp-docs/components/Admonition.tsx b/apps/temp-docs/components/Admonition.tsxindex 50d530128ca..39b6b03c044 100644--- a/apps/temp-docs/components/Admonition.tsx+++ b/apps/temp-docs/components/Admonition.tsx@@ -3,19 +3,20 @@ import { IconInfo, IconHelpCircle, IconAlertTriangle } from 'ui'interface Props {type: 'note' | 'tip' | 'info' | 'caution' | 'danger'+ label?: stringchildren: any}-const Admonition: FC<Props> = ({ type = 'note', children }) => {+const Admonition: FC<Props> = ({ type = 'note', label, children }) => {return (<divclassName={[- 'shadow p-4 rounded border-l-[5px] space-y-2',+ 'shadow p-4 rounded border-l-[5px] space-y-2 my-4',`${type === 'note'? 'bg-scale-500 border-scale-800': type === 'info'- ? 'bg-blue-500 border-blue-800'+ ? 'bg-scale-500 border-scale-800': type === 'tip'? 'bg-brand-500 border-brand-800': type === 'caution'@@ -40,9 +41,9 @@ const Admonition: FC<Props> = ({ type = 'note', children }) => {) : (<IconInfo className="text-scale-1200" size={18} strokeWidth={1.5} />)}- <p className="text-base text-scale-1200 uppercase my-0">{type}</p>+ <p className="text-base text-scale-1200 uppercase my-0">{label || type}</p></div>- <div className="admonition-content text-scale-1200 text-base">{children}</div>+ <div className="admonition-content text-scale-1200 text-base space-y-1">{children}</div></div>)}diff --git a/apps/temp-docs/docs/guides/api.mdx b/apps/temp-docs/docs/guides/api.mdxindex 3feff939b1d..fcc10d60d83 100644--- a/apps/temp-docs/docs/guides/api.mdx+++ b/apps/temp-docs/docs/guides/api.mdx@@ -41,11 +41,11 @@ It provides everything you need from a CRUD API:## GraphQL API {#graphql-api-overview}-:::note+<Admonition type='note'>GraphQL is in Beta, and may have breaking changes. It is only available on self-hosted setups and Supabase projects created after 28th March 2022.-:::+</Admonition>GraphQL in Supabase works through [pg_graphql](https://supabase.com/blog/pg-graphql), an open source PostgreSQL extension for GraphQL.@@ -199,12 +199,12 @@ JS Reference: [select()](../reference/javascript/select),### GraphQL API-:::note+<Admonition type='note'>To rebuild your GraphQL schema from the SQL schema, call `select graphql.rebuild_schema();`.Be sure to rebuild the GraphQL schema after altering the SQL schema.-:::+</Admonition>You can use any GraphQL client with the Supabase GraphQL API. For our GraphQL example we will use [urql](https://formidable.com/open-source/urql/docs/).diff --git a/apps/temp-docs/docs/guides/auth/auth-azure.mdx b/apps/temp-docs/docs/guides/auth/auth-azure.mdxindex 6475d9d8470..7b9fd0093bf 100644--- a/apps/temp-docs/docs/guides/auth/auth-azure.mdx+++ b/apps/temp-docs/docs/guides/auth/auth-azure.mdx@@ -65,9 +65,11 @@ This will allow your users to use your custom Azure login page when logging in.## Add login code to your client app-:::tip+<Admonition type="tip">+Supabase Auth requires that Azure returns a valid email address. Therefore you must request the `email` scope in the `signIn` method above.-:::++</Admonition>When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `azure` as the `provider`:diff --git a/apps/temp-docs/docs/guides/auth/auth-email.mdx b/apps/temp-docs/docs/guides/auth/auth-email.mdxindex d83cfb328be..78fda24826c 100644--- a/apps/temp-docs/docs/guides/auth/auth-email.mdx+++ b/apps/temp-docs/docs/guides/auth/auth-email.mdx@@ -20,12 +20,12 @@ Setting up Email logins for your Supabase application.1. For **Site URL**, enter the final (hosted) URL of your app.1. Under Auth Providers, **enable email provider**.-:::note Self hosting+<Admonition type="info" label="Self hosting">For self-hosting, you can update your project configuration using the files and environment variables provided.See the [self-hosting docs](/docs/guides/hosting/overview#configuration) for details.-:::+</Admonition>## Add login code to your client appdiff --git a/apps/temp-docs/docs/guides/auth/auth-helpers/auth-ui.mdx b/apps/temp-docs/docs/guides/auth/auth-helpers/auth-ui.mdxindex 0ee2493a61e..20259ec4a96 100644--- a/apps/temp-docs/docs/guides/auth/auth-helpers/auth-ui.mdx+++ b/apps/temp-docs/docs/guides/auth/auth-helpers/auth-ui.mdx@@ -32,10 +32,7 @@ Pass `supabaseClient` from `@supabase/supabase-js` as a prop to the component.import { createClient } from '@supabase/supabase-js'import { Auth } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => <Auth supabaseClient={supabase} />```@@ -80,10 +77,7 @@ import { createClient } from '@supabase/supabase-js'//highlight-next-lineimport { Auth, ThemeSupa } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Auth@@ -94,9 +88,11 @@ const App = () => ()```-:::info+<Admonition type="info">+Currently there is only one predefined theme available, but we plan to add more.-:::++</Admonition>### Switch theme variations@@ -106,10 +102,7 @@ Auth UI comes with two theme variations: `default` and `dark`. You can switch beimport { createClient } from '@supabase/supabase-js'import { Auth, ThemeSupa } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Auth@@ -131,10 +124,7 @@ Auth UI themes can be overridden using variable tokens. See the [list of variablimport { createClient } from '@supabase/supabase-js'import { Auth, ThemeSupa } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Auth@@ -219,10 +209,7 @@ You can use custom CSS classes for the following elements:import { createClient } from '@supabase/supabase-js'import { Auth } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Auth@@ -247,10 +234,7 @@ You can use custom CSS inline styles for the following elements:import { createClient } from '@supabase/supabase-js'import { Auth } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Auth@@ -274,10 +258,7 @@ You can use custom labels with `localization.variables`. See the [list of labelsimport { createClient } from '@supabase/supabase-js'import { Auth } from '@supabase/auth-ui-react'-const supabase = createClient(- '<INSERT PROJECT URL>',- '<INSERT PROJECT ANON API KEY>'-)+const supabase = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>')const App = () => (<Authdiff --git a/apps/temp-docs/docs/guides/auth/auth-mfa.mdx b/apps/temp-docs/docs/guides/auth/auth-mfa.mdxindex ed52db81718..83c6af27cd8 100644--- a/apps/temp-docs/docs/guides/auth/auth-mfa.mdx+++ b/apps/temp-docs/docs/guides/auth/auth-mfa.mdx@@ -4,13 +4,15 @@ title: 'Multi-Factor Authentication'description: Add an additional layer of security to your apps with Supabase Auth multi-factor authentication.----import { Mermaid } from 'mdx-mermaid/Mermaid';+import { Mermaid } from 'mdx-mermaid/Mermaid'++<Admonition type="note">-:::noteMulti-Factor Authentication is in early access preview only. Although webelieve it is production ready, APIs and some behavior may change based onfeedback we receive in the preview period.-:::++</Admonition>Multi-factor authentication (MFA), sometimes called two-factorauthentication (2FA), adds an additional layer of security to your@@ -25,9 +27,9 @@ MFA because they require the user to provide proof ofboth of these:- Something they know.-Password, or access to a social-login account.+ Password, or access to a social-login account.- Something they have.-Access to an authenticator app (a.k.a. TOTP), mobile phone or recovery code.+ Access to an authenticator app (a.k.a. TOTP), mobile phone or recovery code.## Overview@@ -38,11 +40,12 @@ authenticator app in the control of users.Applications using MFA require two important flows:1. **Enrollment flow.**-This lets users set up and control MFA in your app.+ This lets users set up and control MFA in your app.2. **Authentication flow.**-This lets users sign in using any factors after the conventional login step.+ This lets users sign in using any factors after the conventional login step.Supabase Auth provides:+- **Enrollment API** - build rich user interfaces for adding and removing factors.- **Challenge and Verify APIs** - securely verify that the user has access to a factor.- **List Factors API** - build rich user interfaces for signing in with additional factors.@@ -50,7 +53,8 @@ Supabase Auth provides:Below is a flow chart illustrating how these APIs work together to enable MFAfeatures in your app.-<Mermaid chart={`+<Mermaid+ chart={`graph TD;InitS((Setup flow)) --> SAAL1[/Session is AAL1/] --> Enroll[Enroll API] --> ShowQR[Show QR code] --> Scan([User: Scan QR code in authenticator]) --> Enter([User: Enter code]) --> Verify[Challenge + Verify API] --> Check{{Is code correct?}}Check -->|Yes| AAL2[/Upgrade to AAL2/] --> Done((Done))@@ -58,7 +62,8 @@ graph TD;InitA((Login flow)) --> SignIn([User: Sign-in]) --> AAL1[/Upgrade to AAL1/] --> ListFactors[List Factors API]ListFactors -->|1 or more factors| OpenAuth([User: Open authenticator]) --> EnterListFactors -->|0 factors| Setup[[Setup flow]]-`} />+`}+/>These sets of APIs let you control the MFA experience that works for you. Youcan create flows where MFA is optional, mandatory for all or only specific@@ -74,12 +79,12 @@ standard measure about the assurance Supabase Auth has of the user's identityfor that particular session. There are two levels recognized today:1. **Assurance Level 1: `aal1`**-Means that the user's identity was verified using a conventional login method-such as email+password, magic link, one-time password, phone auth or social-login.+ Means that the user's identity was verified using a conventional login method+ such as email+password, magic link, one-time password, phone auth or social+ login.2. **Assurance Level 2: `aal2`**-Means that the user's identity was additionally verified using at least one-second factor, such as a TOTP code.+ Means that the user's identity was additionally verified using at least one+ second factor, such as a TOTP code.This assurance level is encoded in the `aal` claim in the JWT associated withthe user. By decoding this value you can create custom authorization rules in@@ -91,17 +96,17 @@ for your application. JWTs without an `aal` claim are at the `aal1` level.Adding MFA to your app involves these three steps:1. **Add enrollment flow.**-You need to provide a UI within your app that your users will be able to set-up-MFA in. You can add this right after sign-up, or as part of a separate flow in-the settings portion of your app.+ You need to provide a UI within your app that your users will be able to set-up+ MFA in. You can add this right after sign-up, or as part of a separate flow in+ the settings portion of your app.2. **Add challenge step to login.**-If a user has set-up MFA, your app's login flow needs to present a challenge-screen to the user asking them to prove they have access to the additional-factor.+ If a user has set-up MFA, your app's login flow needs to present a challenge+ screen to the user asking them to prove they have access to the additional+ factor.3. **Enforce rules for MFA logins.**-Once your users have a way to enroll and log in with MFA, you need to enforce-authorization rules across your app: on the frontend, backend, API servers or-Row-Level Security policies.+ Once your users have a way to enroll and log in with MFA, you need to enforce+ authorization rules across your app: on the frontend, backend, API servers or+ Row-Level Security policies.### Add enrollment flow@@ -109,12 +114,12 @@ An enrollment flow provides a UI for users to set up additional authentication fMost applications add the enrollment flow in two places within their app:1. Right after login or sign up.-This lets users quickly set up MFA immediately after they log in or create an-account. We recommend encouraging all users to set up MFA if that makes sense-for your application. Many applications offer this as an opt-in step in an-effort to reduce onboarding friction.+ This lets users quickly set up MFA immediately after they log in or create an+ account. We recommend encouraging all users to set up MFA if that makes sense+ for your application. Many applications offer this as an opt-in step in an+ effort to reduce onboarding friction.2. From within a settings page.-Allows users to set up, disable or modify their MFA settings.+ Allows users to set up, disable or modify their MFA settings.We recommend building one generic flow that you can reuse in both cases withminor modifications.@@ -122,18 +127,18 @@ minor modifications.Enrolling a factor for use with MFA takes three steps:1. Call `supabase.auth.mfa.enroll()`.-This method returns a QR code and a secret. Display the QR-code to the user and ask them to scan it with their authenticator application.-If they are unable to scan the QR code, show the secret in plain text which-they can type or paste into their authenticator app.+ This method returns a QR code and a secret. Display the QR+ code to the user and ask them to scan it with their authenticator application.+ If they are unable to scan the QR code, show the secret in plain text which+ they can type or paste into their authenticator app.2. Calling the `supabase.auth.mfa.challenge()` API.-This prepares Supabase Auth to accept a verification code from the user-and returns a challenge ID.+ This prepares Supabase Auth to accept a verification code from the user+ and returns a challenge ID.3. Calling the `supabase.auth.mfa.verify()` API.-This verifies that the user has indeed added the secret from step (1) into-their app and is working correctly. If the verification succeeds, the factor-immediately becomes active for the user account. If not, you should repeat-steps 2 and 3.+ This verifies that the user has indeed added the secret from step (1) into+ their app and is working correctly. If the verification succeeds, the factor+ immediately becomes active for the user account. If not, you should repeat+ steps 2 and 3.#### Example: React@@ -142,15 +147,15 @@ the important pieces of the MFA enrollment flow.- When the component appears on screen, the `supabase.auth.mfa.enroll()` API iscalled once to start the process of enrolling a new factor for the current-user.+ user.- This API returns a QR code in the SVG format, which is shown on screen usinga normal `<img>` tag by encoding the SVG as a data URL.- Once the user has scanned the QR code with their authenticator app, theyshould enter the verification code within the `verifyCode` input field and-click on `Enable`.+ click on `Enable`.- A challenge is created using the `supabase.auth.mfa.challenge()` API and thecode from the user is submitted for verification using the-`supabase.auth.mfa.verify()` challenge.+ `supabase.auth.mfa.verify()` challenge.- `onEnabled` is a callback that notifies the other components that enrollmenthas completed.- `onCancelled` is a callback that notifies the other components that the user@@ -169,56 +174,55 @@ export function EnrollMFA({onEnrolled,onCancelled,}: {- onEnrolled: () => void;- onCancelled: () => void;+ onEnrolled: () => void+ onCancelled: () => void}) {- const [factorId, setFactorId] = useState("");- const [qr, setQR] = useState(""); // holds the QR code image SVG- const [verifyCode, setVerifyCode] = useState(""); // contains the code entered by the user- const [error, setError] = useState(""); // holds an error message+ const [factorId, setFactorId] = useState('')+ const [qr, setQR] = useState('') // holds the QR code image SVG+ const [verifyCode, setVerifyCode] = useState('') // contains the code entered by the user+ const [error, setError] = useState('') // holds an error messageconst onEnableClicked = () => {- setError("");-- (async () => {- const challenge = await supabase.auth.mfa.challenge({ factorId });+ setError('')+ ;(async () => {+ const challenge = await supabase.auth.mfa.challenge({ factorId })if (challenge.error) {- setError(challenge.error.message);- throw challenge.error;+ setError(challenge.error.message)+ throw challenge.error}- const challengeId = challenge.data.id;+ const challengeId = challenge.data.idconst verify = await supabase.auth.mfa.verify({factorId,challengeId,code: verifyCode,- });+ })if (verify.error) {- setError(verify.error.message);- throw verify.error;+ setError(verify.error.message)+ throw verify.error}- onEnrolled();- })();- };+ onEnrolled()+ })()+ }useEffect(() => {- (async () => {+ ;(async () => {const { data, error } = await supabase.auth.mfa.enroll({- factorType: "totp",- });+ factorType: 'totp',+ })if (error) {- throw error;+ throw error}- setFactorId(data.id);+ setFactorId(data.id)// Supabase Auth returns an SVG QR code which you can convert into a data// URL that you can place in an <img> tag.- setQR(data.totp.qr_code);- })();- }, []);+ setQR(data.totp.qr_code)+ })()+ }, [])return (<>@@ -232,7 +236,7 @@ export function EnrollMFA({<input type="button" value="Enable" onClick={onEnableClicked} /><input type="button" value="Cancel" onClick={onCancelled} /></>- );+ )}```@@ -248,16 +252,16 @@ in and is redirected back to your app, you should call this method to extractthe user's current and next authenticator assurance level (AAL).Therefore if you receive a `currentLevel` which is `aal1` but a `nextLevel`-of `aal2`, the user should be given the option to go through MFA.+of `aal2`, the user should be given the option to go through MFA.Below is a table that explains the combined meaning.-| Current Level | Next Level | Meaning |-| -------------:|:---------- |:------------------------------------------ |-| `aal1` | `aal1` | User does not have MFA enrolled. |-| `aal1` | `aal2` | User has an MFA factor enrolled but has not verified it. |-| `aal2` | `aal2` | User has verified their MFA factor. |-| `aal2` | `aal1` | User has disabled their MFA factor. (Stale JWT.) |+| Current Level | Next Level | Meaning |+| ------------: | :--------- | :------------------------------------------------------- |+| `aal1` | `aal1` | User does not have MFA enrolled. |+| `aal1` | `aal2` | User has an MFA factor enrolled but has not verified it. |+| `aal2` | `aal2` | User has verified their MFA factor. |+| `aal2` | `aal1` | User has disabled their MFA factor. (Stale JWT.) |#### Example: React@@ -272,44 +276,43 @@ illustrated in the `AppWithMFA` example below.```tsxfunction AppWithMFA() {- const [readyToShow, setReadyToShow] = useState(false);- const [showMFAScreen, setShowMFAScreen] = useState(false);+ const [readyToShow, setReadyToShow] = useState(false)+ const [showMFAScreen, setShowMFAScreen] = useState(false)useEffect(() => {- (async () => {+ ;(async () => {try {- const { data, error } =- await supabase.auth.mfa.getAuthenticatorAssuranceLevel();+ const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()if (error) {- throw error;+ throw error}- console.log(data);+ console.log(data)- if (data.nextLevel === "aal2" && data.nextLevel !== data.currentLevel) {- setShowMFAScreen(true);+ if (data.nextLevel === 'aal2' && data.nextLevel !== data.currentLevel) {+ setShowMFAScreen(true)}} finally {- setReadyToShow(true);+ setReadyToShow(true)}- })();- }, []);+ })()+ }, [])if (readyToShow) {if (showMFAScreen) {- return <AuthMFA />;+ return <AuthMFA />}- return <App />;+ return <App />}- return <></>;+ return <></>}```- `supabase.auth.mfa.getAuthenticatorAssuranceLevel()` does return a promise.Don't worry, this is a very fast method (microseconds) as it rarely uses the-network.+ network.- `readyToShow` only makes sure the AAL check completes before showing anyapplication UI to the user.- If the current level can be upgraded to the next one, the MFA screen is@@ -321,45 +324,44 @@ Below is the component that implements the challenge and verify logic.```tsxfunction AuthMFA() {- const [verifyCode, setVerifyCode] = useState("");- const [error, setError] = useState("");+ const [verifyCode, setVerifyCode] = useState('')+ const [error, setError] = useState('')const onSubmitClicked = () => {- setError("");-- (async () => {- const factors = await supabase.auth.mfa.listFactors();+ setError('')+ ;(async () => {+ const factors = await supabase.auth.mfa.listFactors()if (factors.error) {- throw factors.error;+ throw factors.error}- const totpFactor = factors.data.totp[0];+ const totpFactor = factors.data.totp[0]if (!totpFactor) {- throw new Error("No TOTP factors found!");+ throw new Error('No TOTP factors found!')}- const factorId = totpFactor.id;+ const factorId = totpFactor.id- const challenge = await supabase.auth.mfa.challenge({ factorId });+ const challenge = await supabase.auth.mfa.challenge({ factorId })if (challenge.error) {- setError(challenge.error.message);- throw challenge.error;+ setError(challenge.error.message)+ throw challenge.error}- const challengeId = challenge.data.id;+ const challengeId = challenge.data.idconst verify = await supabase.auth.mfa.verify({factorId,challengeId,code: verifyCode,- });+ })if (verify.error) {- setError(verify.error.message);- throw verify.error;+ setError(verify.error.message)+ throw verify.error}- })();- };+ })()+ }return (<>@@ -372,22 +374,22 @@ function AuthMFA() {/><input type="button" value="Submit" onClick={onSubmitClicked} /></>- );+ )}```- You can extract the available MFA factors for the user by calling`supabase.auth.mfa.listFactors()`. Don't worry this method is also very quick-and rarely uses the network.+ and rarely uses the network.- If `listFactors()` returns more than one factor (or of a different type) youshould present the user with a choice. For simplicity this is not shown in-the example.+ the example.- Each time the user presses the "Submit" button a new challenge is created forthe chosen factor (in this case the first one) and it is immediately-verified. Any errors are displayed to the user.+ verified. Any errors are displayed to the user.- On successful verification, the client library will refresh the session inthe background automatically and finally call the `onSuccess` callback, which-will show the authenticated `App` component on screen.+ will show the authenticated `App` component on screen.### Enforce rules for MFA logins@@ -399,27 +401,29 @@ Depending on your application's needs, there are three ways you can choose toenforce MFA.1. **Enforce for all users (new and existing).**-Any user account will have to enroll MFA to continue using your app.-The application will not allow access without going through MFA first.+ Any user account will have to enroll MFA to continue using your app.+ The application will not allow access without going through MFA first.2. **Enforce for new users only.**-Only new users will be forced to enroll MFA, while old users will be encouraged-to do so.-The application will not allow access for new users without going through MFA-first.+ Only new users will be forced to enroll MFA, while old users will be encouraged+ to do so.+ The application will not allow access for new users without going through MFA+ first.3. **Enforce only for users that have opted-in.**-Users that want MFA can enroll in it and the application will not allow access-without going through MFA first.+ Users that want MFA can enroll in it and the application will not allow access+ without going through MFA first.#### DatabaseYour app should sufficiently deny or allow access to tables or rows based onthe user's current and possible authenticator levels.-:::warning+<Admonition type="caution">+PostgreSQL has two types of policies: permissive and restrictive. This guideuses restrictive policies. Make sure you don't omit the `as restrictive`clause.-:::++</Admonition>##### Enforce for all users (new and existing)@@ -463,7 +467,7 @@ create policy "Policy name."- The policy will accept both `aal1` and `aal2` for users with a `created_at`timestamp prior to 12th December 2022 at 00:00 UTC, but will only accept-`aal2` for all other timestamps.+ `aal2` for all other timestamps.- The `<@` operator is PostgreSQL's ["contained in"operator.](https://www.postgresql.org/docs/current/functions-array.html)- `NULL` appears because some JWTs originating from prior to the introduction@@ -505,12 +509,14 @@ create policy "Policy name."### Server-Side Rendering-:::tip+<Admonition type="tip">+When using the Supabase JavaScript library in a server-side rendering context,make sure you always create a new object for each request! This will preventyou from accidentally rendering and serving content belonging to differentusers.-:::++</Admonition>It is possible to enforce MFA on the Server-Side Rendering level. However, thiscan be tricky do to well.@@ -524,11 +530,11 @@ However, encountering a different AAL level on the server may not actually be asecurity problem. Consider these likely scenarios:1. User signed-in with a conventional method but closed their tab on the MFA-flow.+ flow.2. User forgot a tab open for a very long time. (This happens more often than-you might imagine.)+ you might imagine.)3. User has lost their authenticator device and is confused about the next-steps.+ steps.We thus recommend you redirect users to a page where they can authenticateusing their additional factor, instead of rendering a HTTP 401 Unauthorized or@@ -542,14 +548,14 @@ event that you have other APIs that you wish to protect, follow these generalguidelines:1. **Use a good JWT verification and parsing library for your language.**-This will let you securely parse JWTs and extract their claims.+ This will let you securely parse JWTs and extract their claims.2. **Retrieve the `aal` claim from the JWT and compare its value according to-your needs.**-If you've encountered an AAL level that can be increased, ask the user to-continue the login process instead of logging them out.+ your needs.**+ If you've encountered an AAL level that can be increased, ask the user to+ continue the login process instead of logging them out.3. **Use the `https://<project-ref>.supabase.co/rest/v1/auth/factors` REST-endpoint to identify if the user has enrolled any MFA factors.**-Only `verified` factors should be acted upon.+ endpoint to identify if the user has enrolled any MFA factors.**+ Only `verified` factors should be acted upon.## Frequently asked questions@@ -602,11 +608,10 @@ You can use this PostgreSQL snippet in RLS policies, too:json_query_path(auth.jwt(), '$.amr[0]')```-- [`json_query_path(json,- path)`](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)-is a function that allows access to elements in a JSON object according to a-[SQL/JSON-path](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-SQLJSON-PATH).+- [`json_query_path(json, path)`](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)+ is a function that allows access to elements in a JSON object according to a+ [SQL/JSON+ path](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-SQLJSON-PATH).- `$.amr[0]` is a SQL/JSON path expression that fetches the most recentauthentication method in the JWT.@@ -622,4 +627,3 @@ Currently recognized methods are:- `mfa/totp` - a TOTP additional factor.This list will expand in the future.-diff --git a/apps/temp-docs/docs/guides/auth/row-level-security.mdx b/apps/temp-docs/docs/guides/auth/row-level-security.mdxindex d12ff68f464..97d714140cd 100644--- a/apps/temp-docs/docs/guides/auth/row-level-security.mdx+++ b/apps/temp-docs/docs/guides/auth/row-level-security.mdx@@ -332,11 +332,11 @@ We have deprecate some functions to ensure better performance and extensibilty o### `auth.role()`-:::caution+<Admonition type="caution">Deprecated: The `auth.role()` function has been deprecated in favour of using the `TO` field, natively supported within Postgres.-:::+</Admonition>```sql-- DEPRECATED@@ -356,10 +356,10 @@ using (### `auth.email()`-:::caution+<Admonition type="caution">Deprecated. Use `auth.jwt() ->> 'email'` instead.-:::+</Admonition>Returns the email of the user making the request.diff --git a/apps/temp-docs/docs/guides/auth/server-side-rendering.mdx b/apps/temp-docs/docs/guides/auth/server-side-rendering.mdxindex 1c1e3818b78..60d5340038e 100644--- a/apps/temp-docs/docs/guides/auth/server-side-rendering.mdx+++ b/apps/temp-docs/docs/guides/auth/server-side-rendering.mdx@@ -22,10 +22,12 @@ Most Supabase projects have their auth server listening onset as `sb-access-token` and `sb-refresh-token` cookies on the`<project-ref>.supabase.co` domain.-:::note+<Admonition type="note">+These cookie names are for internal Supabase use only and may change withoutwarning. They are included in this guide for illustration purposes only.-:::++</Admonition>Web browsers limit access to cookies across domains, consistent with the[Same-Origin Policy@@ -44,10 +46,12 @@ or use a social login (if you have any setup in your project).Upon successful verification of the identity of the user, the Supabase Authserver redirects the user back to your single-page app.-:::tip+<Admonition type="tip">+You can configure [redirects URLs](https://app.supabase.com/project/_/auth/settings) in the Supabase Dashboard. You can use wildcard match patternslike `*` and `**` to allow redirects to different forms of URLs.-:::++</Admonition>These redirect URLs have the following structure:@@ -63,7 +67,8 @@ The client libraries are designed to listen for this type of URL, extractthe access token, refresh token and some extra information from it, and finallypersist it in local storage for further use by the library and your app.-:::info+<Admonition type="info">+Web browsers do not send the URL fragment to the server they're making therequest to. Since you may not be hosting the single-page app on a server underyour direct control (such as on GitHub Pages or other freemium hosting@@ -71,7 +76,8 @@ providers), we want to prevent hosting services from getting access to youruser's authorization credentials by default. Even if the server is under yourdirect control, `GET` requests and their full URLs are often logged. Thisapproach also avoids leaking credentials in request or access logs.-:::++</Admonition>## Bringing it together@@ -91,15 +97,15 @@ can add to the root of your application:```typescriptsupabase.auth.onAuthStateChange((event, session) => {- if (event === "SIGNED_OUT" || event === "USER_DELETED") {+ if (event === 'SIGNED_OUT' || event === 'USER_DELETED') {// delete cookies on sign out- const expires = new Date(0).toUTCString();- document.cookie = `my-access-token=; path=/; expires=${expires}; SameSite=Lax; secure`;- document.cookie = `my-refresh-token=; path=/; expires=${expires}; SameSite=Lax; secure`;- } else if (event === "SIGNED_IN" || event === "TOKEN_REFRESHED") {- const maxAge = 100 * 365 * 24 * 60 * 60; // 100 years, never expires- document.cookie = `my-access-token=${session.access_token}; path=/; max-age=${maxAge}; SameSite=Lax; secure`;- document.cookie = `my-refresh-token=${session.refresh_token}; path=/; max-age=${maxAge}; SameSite=Lax; secure`;+ const expires = new Date(0).toUTCString()+ document.cookie = `my-access-token=; path=/; expires=${expires}; SameSite=Lax; secure`+ document.cookie = `my-refresh-token=; path=/; expires=${expires}; SameSite=Lax; secure`+ } else if (event === 'SIGNED_IN' || event === 'TOKEN_REFRESHED') {+ const maxAge = 100 * 365 * 24 * 60 * 60 // 100 years, never expires+ document.cookie = `my-access-token=${session.access_token}; path=/; max-age=${maxAge}; SameSite=Lax; secure`+ document.cookie = `my-refresh-token=${session.refresh_token}; path=/; max-age=${maxAge}; SameSite=Lax; secure`}})```@@ -114,27 +120,26 @@ parameters can be changed).In your server-side rendering code you can now access user and sessioninformation:-```typescript-const refreshToken = req.cookies['my-refresh-token'];-const accessToken = req.cookies['my-access-token'];+const refreshToken = req.cookies['my-refresh-token']+const accessToken = req.cookies['my-access-token']if (refreshToken && accessToken) {await supabase.auth.setSession({refresh_token: refreshToken,- access_token: accessToken- });+ access_token: accessToken,+ })} else {// make sure you handle this case!- throw new Error("User is not authenticated.")+ throw new Error('User is not authenticated.')}// returns user information-await supabase.auth.getUser();+await supabase.auth.getUser()```Use `setSession({ access_token, refresh_token })` instead of-`setSession(refreshToken)` or `getUser(accessToken)` as refresh tokens or access tokens alone do not properly identify a user session.+`setSession(refreshToken)` or `getUser(accessToken)` as refresh tokens or access tokens alone do not properly identify a user session.Access tokens are valid only for a short amount of time.diff --git a/apps/temp-docs/docs/guides/cli/local-development.mdx b/apps/temp-docs/docs/guides/cli/local-development.mdxindex 5e2c11119e4..269c288e823 100644--- a/apps/temp-docs/docs/guides/cli/local-development.mdx+++ b/apps/temp-docs/docs/guides/cli/local-development.mdx@@ -107,9 +107,11 @@ http://localhost:54321/auth/v1/ # Auth (GoTrue)</TabPanel></Tabs>-:::note+<Admonition type="note">+To access the database from an edge function in your local Supabase setup, replace `localhost` with `host.docker.internal`.-:::++</Admonition>## Database migrations@@ -126,9 +128,11 @@ create table employees ();```-:::note+<Admonition type="note">+You can execute any SQL using the `DB URL` shown by [`supabase status`](/reference/cli/usage#supabase-status).-:::++</Admonition>Run the [`db diff`](/reference/cli/usage#supabase-db-diff) command to detect changes in the local database:@@ -181,9 +185,11 @@ Go to the [Supabase Dashboard](https://app.supabase.com) and create a project to### Link your project-:::note+<Admonition type="note">+There are a few commands required to link your project. We are in the process of consolidating these commands into a single command. Bear with us!-:::++</Admonition>Associate your project with your remote project using [`supabase link`](/reference/cli/usage#supabase-link).diff --git a/apps/temp-docs/docs/guides/cli/managing-environments.mdx b/apps/temp-docs/docs/guides/cli/managing-environments.mdxindex 31d5a01c280..a358b1557d3 100644--- a/apps/temp-docs/docs/guides/cli/managing-environments.mdx+++ b/apps/temp-docs/docs/guides/cli/managing-environments.mdx@@ -93,13 +93,14 @@ supabase db resetThis command recreates your local database from scratch and applies all migration scripts under `supabase/migrations` directory. Now your local database is up to date.-:::tip+<Admonition type="tip">The new migration command also supports stdin as input.This allows you to pipe in an existing script from another file or stdout:`supabase migration new new_employee < create_employees_table.sql`-:::++</Admonition>### Auto schema diff@@ -149,14 +150,14 @@ This is because the default schema diff tool does not account for default privilCommit the new migration script to git and you are ready to deploy.-:::tip+<Admonition type="tip">Alternatively, you may pass in the `--use-migra` experimental flag to generate a more concise migration using [migra](https://github.com/djrobstep/migra).Without the `-f` file flag, the output is written to stdout by default.`supabase db diff --use-migra`-:::+</Admonition>## Deploy a migration@@ -171,11 +172,11 @@ Prepare your environments by:- Creating separate Supabase projects for staging and production- Pushing your git repository to GitHub and enabling GitHub Actions-:::caution+<Admonition type="caution">You need a _new_ project for staging. A project which has already been modified to reflect the production project's schema can't be used because the CLI would reapply these changes.-:::+</Admonition>### Configure GitHub Actionsdiff --git a/apps/temp-docs/docs/guides/database.mdx b/apps/temp-docs/docs/guides/database.mdxindex ee4234bd43c..ace142b022a 100644--- a/apps/temp-docs/docs/guides/database.mdx+++ b/apps/temp-docs/docs/guides/database.mdx@@ -25,7 +25,7 @@ simplicity, so we also refer to it as Postgres.You don't have to be a database expert to start using Supabase. Our table view makes Postgres as easy to use as a spreadsheet.-+### Relationships@@ -40,12 +40,7 @@ Dig into the relationships within your data.You can duplicate your tables, just like you would inside a spreadsheet.<video width="99%" muted playsInline controls={true}>- <source- src="/docs/videos/duplicate-tables.mp4"- type="video/mp4"- muted- playsInline- />+ <source src="/docs/videos/duplicate-tables.mp4" type="video/mp4" muted playsInline /></video>### The SQL Editor@@ -63,9 +58,13 @@ Supabase comes with a SQL Editor. You can also save your favorite queries to run- Supabase manages your database backups.- Import data directly from a CSV or excel spreadsheet.-:::info-Database backups **do not** include objects stored via the Storage API, as the database only includes metadata about these objects. Restoring an old backup does not restore objects that have been deleted since then.-:::+<Admonition type="note">++Database backups **do not** include objects stored via the Storage API, as the database only+includes metadata about these objects. Restoring an old backup does not restore objects that have+been deleted since then.++</Admonition>### Extensions@@ -73,12 +72,7 @@ To expand the functionality of your Postgres database, you can use extensions.You can enable Postgres extensions with the click of a button within the Supabase dashboard.<video width="99%" muted playsInline controls={true}>- <source- src="/docs/videos/toggle-extensions.mp4"- type="video/mp4"- muted- playsInline- />+ <source src="/docs/videos/toggle-extensions.mp4" type="video/mp4" muted playsInline /></video>[Learn more](/docs/guides/database/extensions) about all the extensions provided on Supabase.diff --git a/apps/temp-docs/docs/guides/database/database-webhooks.mdx b/apps/temp-docs/docs/guides/database/database-webhooks.mdxindex 6828a0bbc7b..96c51011d2f 100644--- a/apps/temp-docs/docs/guides/database/database-webhooks.mdx+++ b/apps/temp-docs/docs/guides/database/database-webhooks.mdx@@ -17,11 +17,11 @@ using the [pg_net](/docs/guides/database/extensions/pgnet) extension. This extenThis video demonstrates how you can create a new customer in Stripe each time a row is inserted into a `profiles` table:-:::note+<Admonition type="note">Database Webhooks were previously known as Function Hooks.-:::+</Admonition><div class="video-container"><iframediff --git a/apps/temp-docs/docs/guides/database/extensions.mdx b/apps/temp-docs/docs/guides/database/extensions.mdxindex ace05a764b0..fe844b7da8a 100644--- a/apps/temp-docs/docs/guides/database/extensions.mdx+++ b/apps/temp-docs/docs/guides/database/extensions.mdx@@ -43,9 +43,11 @@ drop extension pgtap;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension call `drop extension`.-:::caution+<Admonition type="caution">+Enabling some extensions with `create extension <extension-name> with schema extensions` may lead to permission issues (e.g., `dblink`, `http`, `pg_cron`).-:::++</Admonition></TabPanel></Tabs>diff --git a/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx b/apps/temp-docs/docs/guides/database/extensions/pgnet.mdxindex 624dcecdef7..58fb475be27 100644--- a/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx+++ b/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx@@ -7,11 +7,11 @@ description: 'pg_net: an async networking extension for PostgreSQL.'import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'-:::caution+<Admonition type="caution">The pg_net API is in beta. Functions signatures may change.-:::+</Admonition>[pg_net](https://github.com/supabase/pg_net/) is a PostgreSQL extension exposing a SQL interface for async networking with a focus on scalability and UX.@@ -60,11 +60,11 @@ Creates an HTTP GET request returning the request's ID. HTTP requests are not st### Signature-:::caution+<Admonition type="caution">This is a Postgres SECURITY DEFINER function.-:::+</Admonition>```sqlnet.http_get(@@ -107,11 +107,11 @@ The body's character set encoding matches the database's `server_encoding` setti### Signature-:::caution+<Admonition type="caution">This is a Postgres SECURITY DEFINER function-:::+</Admonition>```sqlnet.http_post(@@ -159,11 +159,11 @@ When `async:=false` is set it is recommended that [statement_timeout](https://ww### Signature-:::caution+<Admonition type="caution">This is a Postgres SECURITY DEFINER function-:::+</Admonition>```sqlnet.http_collect_response(@@ -182,11 +182,11 @@ net.http_collect_response(### Usage-:::caution+<Admonition type="caution">`net.http_collect_response` must be in a separate transaction from the calls to `net.http_<method>`-:::+</Admonition>```sqlselectdiff --git a/apps/temp-docs/docs/guides/database/tables.mdx b/apps/temp-docs/docs/guides/database/tables.mdxindex 0c86ce97fba..fd81b8e802e 100644--- a/apps/temp-docs/docs/guides/database/tables.mdx+++ b/apps/temp-docs/docs/guides/database/tables.mdx@@ -65,9 +65,11 @@ create table movies (</TabPanel></Tabs>-:::note+<Admonition type="note">+When naming tables, use lowercase and underscores instead of spaces (e.g., `table_name`, not `Table Name`).-:::++</Admonition>## Columns@@ -336,11 +338,11 @@ create table salaries (A View is a convenient shortcut to a query. Creating a view does not involve new tables or data. When run, an underlying query is executed, returning its results to the user.-:::caution+<Admonition type="caution">By default, PostgreSQL views bypass Row Level Security unless you change their owner (see https://github.com/supabase/supabase/discussions/901). PostgreSQL v15 (coming soon) will have a more intuitive control for this through [security invoker views](https://www.depesz.com/2022/03/22/waiting-for-postgresql-15-add-support-for-security-invoker-views/) and the previous step won't be needed.-:::+</Admonition>Say we have the following tables from a database of a university:diff --git a/apps/temp-docs/docs/guides/functions.mdx b/apps/temp-docs/docs/guides/functions.mdxindex 8bcab320554..b4dc7ee1fad 100644--- a/apps/temp-docs/docs/guides/functions.mdx+++ b/apps/temp-docs/docs/guides/functions.mdx@@ -63,13 +63,13 @@ supabase functions deploy hello-worldThis command bundles your Edge Function from `./functions/hello-world/index.ts` and deploys it to the Supabase platform.The command outputs a URL to the Supabase Dashboard which you can open to find view more details. Let's open the link to find the execution command.-:::note+<Admonition type="note">By default, Edge Functions require a valid JWT in the authorization header. This header is automatically set when invoking your function via a Supabase client library.If you want to use Edge Functions to handle webhooks (e.g. [Stripe payment webhooks](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/stripe-webhooks) etc.), you need to pass the `--no-verify-jwt` flag when deploying your function.-:::+</Admonition>### Executing Remote Functions@@ -93,7 +93,7 @@ You can debug your deployed Edge Functions using the "Functions" section of the- Invocations: shows the Request and Response for each execution.- Logs: shows any platform events, including deployments and errors.-+## Developing locally@@ -159,11 +159,11 @@ echo "MY_NAME=Yoda" >> ./supabase/.env.localThis creates a new file `./supabase/.env.local` for storing your local development secrets.-:::caution+<Admonition type="caution">Never check your .env files into Git!-:::+</Admonition>Now let's access this environment variable `MY_NAME` inside our Function. Anywhere in your function, add this line:@@ -189,11 +189,11 @@ cp ./supabase/.env.local ./supabase/.envThis creates a new file `./supabase/.env` for storing your production secrets.-:::caution+<Admonition type="caution">Never check your `.env` files into Git!-:::+</Admonition>Let's push all the secrets from the `.env` file to our remote project using [`supabase secrets set`](/docs/reference/cli/usage#supabase-secrets-set):diff --git a/apps/temp-docs/docs/guides/integrations/dhiwise.mdx b/apps/temp-docs/docs/guides/integrations/dhiwise.mdxindex 15b4110ed1e..87fbf20e938 100644--- a/apps/temp-docs/docs/guides/integrations/dhiwise.mdx+++ b/apps/temp-docs/docs/guides/integrations/dhiwise.mdx@@ -3,8 +3,9 @@ id: dhiwisetitle: 'DhiWise'description: 'Get started with Supabase and DhiWise. Convert your Figma designs into Flutter apps, store data, and authenticate your users'----import select from "/img/guides/integrations/dhiwise/select.png"-import create from "/img/guides/integrations/dhiwise/create.png"++import select from '/docs/img/guides/integrations/dhiwise/select.png'+import create from '/docs/img/guides/integrations/dhiwise/create.png'This guide explains how to connect Supabase backend to DhiWise Flutter application quickly.@@ -29,13 +30,13 @@ Click on `New project` from the Dashboard and select an organization. If you don- Choose the `region` where your app's backend is hosted.- Click `Create new project.`-+## Step 3: Find the API key and URLOnce your project is created, you can access the API Key and URL string, Or if you already have an account go to your `organization-> app-> settings-> API`.-+## Step 4: Integrations@@ -50,64 +51,74 @@ You can integrate `Supabase Email/Password SignUp` or `Supabase Email/Password S- on the `onClick` method - select `authentication`- From the list, If you want SignUp - select `SignUp with Email/Password`; otherwise, select `SignIn with Email/Password` from Supabase Auth section-+And that's it. Supabase authentication will be added to the selected component.After downloading the application source code,-1. Add Supabase URL and Supabase public key inside ***lib/core/utils/initial_bindings*** file.++1. Add Supabase URL and Supabase public key inside **_lib/core/utils/initial_bindings_** file.2. For additional details, refer ***https://supabase.com/docs/guides/with-flutter***### Working with Data-When you first integrate Supabase in your DhiWise Flutter application, You will be asked to add [Supabase auth key and URL](##step-3-find-the-api-key-and-url). When you add them, all the tables available in your Supabase project will be synced in DhiWise. You can integrate Select and Create queries on your Flutter screen for a particular table in DhiWise.+When you first integrate Supabase in your DhiWise Flutter application, You will be asked to add [Supabase auth key and URL](##step-3-find-the-api-key-and-url). When you add them, all the tables available in your Supabase project will be synced in DhiWise. You can integrate Select and Create queries on your Flutter screen for a particular table in DhiWise.<h3> Select records </h3>-#### **Step 1:**+#### **Step 1:**+Select the screen from the screen list where you want to integrate Supabase.-#### **Step 2:**+#### **Step 2:**+Next, go to the view where you want to add Integration, and from the suggestion box for the `onClick` property, choose `Supabase integration,` which will take you to the Integration screen. Where you will be asked to `Enter function name.` Enter the name of your function and click `Submit.`-#### **Step 3:**+#### **Step 3:**+After submitting the function name, you will be asked to select a type of Supabase integration. To retrieve data from Supabase, choose `select.`-#### **Step 4:**+#### **Step 4:**+Next, select the table from which you want to fetch records from the listed Tables.-#### **Step 5:**+#### **Step 5:**+Select the type of integration-| Type | Description |-| --- | --- |-| **Single** | Used to fetch a single record from the database. |+| Type | Description |+| ------------ | ------------------------------------------------- |+| **Single** | Used to fetch a single record from the database. || **Multiple** | Used to fetch multiple records from the database. |-:::info+<Admonition type="info">+For Multiple types, you need to set `data limit,` `order by, and `order.`-:::-#### **Step 6:**+</Admonition>++#### **Step 6:**+You will be redirected to the API Integration screen, where you can set request and response.For request binding, the below types are supported. Also, Select the operator for comparison before moving forward.-| Type | Description |-| --- | --- |-| **View** | Select any component from your screen. |-| **Constant** | Select a constant you've created in your app. |-| **Get from preference** | Select the key you want to fetch from preference. |+| Type | Description |+| ----------------------- | ---------------------------------------------------------- |+| **View** | Select any component from your screen. |+| **Constant** | Select a constant you've created in your app. |+| **Get from preference** | Select the key you want to fetch from preference. || **Navigation argument** | Select data that's been passed from one screen to another. |For response binding, the below types are supported.-| Type | Description |-| --- | --- |-| **View** | Select any component from the screen. |-| **Save to preference** | Storing the data to preference. |+| Type | Description |+| ---------------------- | ------------------------------------- |+| **View** | Select any component from the screen. |+| **Save to preference** | Storing the data to preference. |++#### **Select 7:**-#### **Select 7:**`Handle action` - Select the action you wish to take once the Supabase call has either been accepted successfully or refused due to an error.Available action for On success and On error are,@@ -115,50 +126,60 @@ Available action for On success and On error are,1. [Show Alert](https://docs.dhiwise.com/docs/flutter/show-alert)2. [Navigation](https://docs.dhiwise.com/docs/flutter/navigation)-#### **Step 8:**+#### **Step 8:**+Finally, you have added Supabase to your application to fetch records on your screen!-:::tip Example+<Admonition type="tip" label="Example">+Suppose you want to fetch records from Supabase and populate the item list on your screen. You can integrate Supabase as discussed above and bind the response with your list view.-:::++</Admonition><h3> Create records </h3>-#### **Step 1:**+#### **Step 1:**+Choose the screen you wish to integrate Supabase for from the list of screens.-#### **Step 2:**+#### **Step 2:**+Next, switch to the component you want to add Integration, and on the `onClick` property, choose `Supabase integration,` which will take you to its integration screen, where you will be asked to **Enter function name**, which will be used in generated code. Enter the name for it and click `Submit`-#### **Step 3:**+#### **Step 3:**+After submitting the function name, you will be asked to select a type of Supabase integration. For example, to create a record in Supabase, choose `Create.`-#### **Step 4:**+#### **Step 4:**+Next, select the table where you want to create a record from the listed Tables.-#### **Step 5:**+#### **Step 5:**+If you want to create a Single record, Select **Select**. Otherwise, **Multiple**.-#### **Step 6:**+#### **Step 6:**+Now, you will be redirected to the API Integration screen, where you can set request and response.For request binding, the below types are supported.-| Type | Description |-| --- | --- |-| **View** | Select any component from the screen |-| **Constant** | Select a constant you've created in your app.|-| **Get from preference** | Select the key you want to fetch from preference. |+| Type | Description |+| ----------------------- | ---------------------------------------------------------- |+| **View** | Select any component from the screen |+| **Constant** | Select a constant you've created in your app. |+| **Get from preference** | Select the key you want to fetch from preference. || **Navigation argument** | Select data that's been passed from one screen to another. |For response binding, the below types are supported.-| Type | Description |-| --- | --- |-| **View** | Select any component from the screen |-| **Save to preference** | Storing the data to preference. |+| Type | Description |+| ---------------------- | ------------------------------------ |+| **View** | Select any component from the screen |+| **Save to preference** | Storing the data to preference. |++#### **Select 7:**-#### **Select 7:**`Handle action` - Select the action you wish to take once the Supabase call has either been accepted successfully or refused due to an error.Available action for On success and On error are,@@ -166,10 +187,11 @@ Available action for On success and On error are,1. [Show Alert](https://docs.dhiwise.com/docs/flutter/show-alert)2. [Navigation](https://docs.dhiwise.com/docs/flutter/navigation)-#### **Step 9:**+#### **Step 9:**+Finally, you have added Supabase to your application to create records from your screen data!## Resources- [DhiWise Official Website](https://dhiwise.com)-- [DhiWise Documentation](https://docs.dhiwise.com)\ No newline at end of file+- [DhiWise Documentation](https://docs.dhiwise.com)diff --git a/apps/temp-docs/docs/guides/migrations/firebase-storage.mdx b/apps/temp-docs/docs/guides/migrations/firebase-storage.mdxindex 6b2904b70f5..c078899f690 100644--- a/apps/temp-docs/docs/guides/migrations/firebase-storage.mdx+++ b/apps/temp-docs/docs/guides/migrations/firebase-storage.mdx@@ -53,9 +53,11 @@ To process in batches using multiple command-line executions, you must use the s- `<folder>`: Name of subfolder of files to upload. The selected folder is read as a subfolder of the current folder (e.g., `./downloads/`). The default is `downloads`.- `<bucket>`: Name of the bucket to upload to.-:::note+<Admonition type="note">+If the bucket doesn't exist, it's created as a `non-public` bucket. You must set permissions on this new bucket in the [Supabase Dashboard](https://app.supabase.com/project/_/storage/buckets) before users can download any files.-:::++</Admonition>## Resourcesdiff --git a/apps/temp-docs/docs/guides/platform/custom-domains.mdx b/apps/temp-docs/docs/guides/platform/custom-domains.mdxindex 87f831172b4..83f339ade3b 100644--- a/apps/temp-docs/docs/guides/platform/custom-domains.mdx+++ b/apps/temp-docs/docs/guides/platform/custom-domains.mdx@@ -7,11 +7,11 @@ description: Configuring a Custom Domain for your Supabase project.import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'-:::note+<Admonition type="note">Custom Domains are currently in beta, and are being slowly made available to projects.-:::+</Admonition>Custom domains allow you to present a branded experience to your users. You can also use a subdomain for the purposes of this guide.diff --git a/apps/temp-docs/docs/guides/platform/database-usage.mdx b/apps/temp-docs/docs/guides/platform/database-usage.mdxindex 353b8f6c734..00238a38fc6 100644--- a/apps/temp-docs/docs/guides/platform/database-usage.mdx+++ b/apps/temp-docs/docs/guides/platform/database-usage.mdx@@ -44,9 +44,11 @@ If you intend to grow beyond this, reach out to our team to learn more about ourPostgres does not immediately reclaim the physical space used by dead tuples (i.e., deleted rows) in the DB. Instead, they are internally marked as removed until a [vacuum operation](https://www.postgresql.org/docs/current/routine-vacuuming.html) is executed.As a result, deleting data from your database may not immediately reduce the reported disk usage.-:::note+<Admonition type="note">+Vacuum operations can temporarily increase resource utilization, which may adversely impact the observed performance of your project until the maintenance is completed.-:::++</Admonition>Supabase projects have automatic vacuuming enabled, which ensures that these operations are performed regularly to keep the database healthy and performant.However, it can be necessary to either [fine-tune](https://www.percona.com/blog/2018/08/10/tuning-autovacuum-in-postgresql-and-autovacuum-internals/)diff --git a/apps/temp-docs/docs/guides/platform/logs.mdx b/apps/temp-docs/docs/guides/platform/logs.mdxindex 26a5d608201..ddd2a4f18c5 100644--- a/apps/temp-docs/docs/guides/platform/logs.mdx+++ b/apps/temp-docs/docs/guides/platform/logs.mdx@@ -10,10 +10,12 @@ import ThemedImage from '@theme/ThemedImage'The Supabase Platform includes a Logs Explorer that allows log tracing and debugging. Log retention is based on your [project's pricing plan](https://supabase.com/pricing).-:::note+<Admonition type="note">+These features are not currently available for self-hosting and local development.<br/>This is on the roadmap and you can follow the progress in the [Logflare repository](https://github.com/Logflare/logflare).-:::++</Admonition>## Product Logsdiff --git a/apps/temp-docs/docs/guides/platform/metrics.mdx b/apps/temp-docs/docs/guides/platform/metrics.mdxindex 8fba89eace9..1ba60fc4c26 100644--- a/apps/temp-docs/docs/guides/platform/metrics.mdx+++ b/apps/temp-docs/docs/guides/platform/metrics.mdx@@ -8,17 +8,17 @@ In addition to the reports and charts built in to the Supabase dashboard, each pYou can use this endpoint to ingest data into your own monitoring and alerting infrastructure, as long as it is capable of scraping Prometheus-compatible endpoints, in order to set up custom rules beyond those supported by the Supabase dashboard.-:::note+<Admonition type="note">The endpoint discussed in this article is in beta, and the metrics returned by it might evolve or be changed in the future to increase its utility.-:::+</Admonition>-:::note+<Admonition type="note">The endpoint discussed in this article is not available on self-hosted.-:::+</Admonition>## Accessing the metrics endpointdiff --git a/apps/temp-docs/docs/guides/realtime/postgres-cdc.mdx b/apps/temp-docs/docs/guides/realtime/postgres-cdc.mdxindex 5752274dbbc..f14fc3f58a0 100644--- a/apps/temp-docs/docs/guides/realtime/postgres-cdc.mdx+++ b/apps/temp-docs/docs/guides/realtime/postgres-cdc.mdx@@ -16,9 +16,11 @@ Postgres CDC works out of the box for tables in the `public` schema. You can lisGRANT SELECT ON "private_schema"."table" TO authenticated;```-:::caution+<Admonition type="caution">+We strongly encourage you to enable RLS and create policies for tables in private schemas. Otherwise, any role you grant access to will have unfettered read access to the table.-:::++</Admonition>You can do this in the [Replication](https://app.supabase.com/project/_/database/replication) section in the Dashboard or with the [SQL editor](https://app.supabase.com/project/_/sql):@@ -47,10 +49,7 @@ To listen to all changes in the `public` schema:```jsconst { createClient } = require('@supabase/supabase-js')-const supabase = createClient(- process.env.SUPABASE_URL,- process.env.SUPABASE_KEY-)+const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY)/*Channel name can be any string.@@ -62,9 +61,7 @@ const supabase = createClient(*/const channel = supabase.channel('schema-db-changes')- .on('postgres_changes', { event: '*', schema: 'public' }, (payload) =>- console.log(payload)- )+ .on('postgres_changes', { event: '*', schema: 'public' }, (payload) => console.log(payload)).subscribe()```@@ -75,10 +72,8 @@ To listen to changes on a table in the `public` schema:const channel = supabase.channel('table-db-changes')- .on(- 'postgres_changes',- { event: 'INSERT', schema: 'public', table: 'messages' },- (payload) => console.log(payload)+ .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages' }, (payload) =>+ console.log(payload)).subscribe()```@@ -115,10 +110,8 @@ const channel = supabase{ event: '*', schema: 'public', table: 'messages', filter: 'body=eq.bye' },(payload) => console.log(payload))- .on(- 'postgres_changes',- { event: 'INSERT', schema: 'public', table: 'users' },- (payload) => console.log(payload)+ .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'users' }, (payload) =>+ console.log(payload)).subscribe()```diff --git a/apps/temp-docs/docs/guides/realtime/quickstart.mdx b/apps/temp-docs/docs/guides/realtime/quickstart.mdxindex 47a77610d94..5be89689639 100644--- a/apps/temp-docs/docs/guides/realtime/quickstart.mdx+++ b/apps/temp-docs/docs/guides/realtime/quickstart.mdx@@ -33,17 +33,13 @@ You need to get the public `anon` access token from your project's [API settings```jsconst { createClient } = require('@supabase/supabase-js')-const supabase = createClient(- 'https://your-project-ref.supabase.co',- 'anon-key',- {- realtime: {- params: {- eventsPerSecond: 10,- },+const supabase = createClient('https://your-project-ref.supabase.co', 'anon-key', {+ realtime: {+ params: {+ eventsPerSecond: 10,},- }-)+ },+})// Channel name can be any string.// Create channels with the same name for both the broadcasting and receiving clients.@@ -65,9 +61,11 @@ channel.subscribe((status) => {})```-:::info+<Admonition type="info">+JavaScript client has a default rate limit of 1 Realtime event every 100 milliseconds that's configured by `eventsPerSecond`.-:::++</Admonition>Another client can subscribe to channel `room1` and receive cursor positions:@@ -85,9 +83,11 @@ supabase})```-:::info+<Admonition type="info">+`type` must be `broadcast` and the `event` must match for clients subscribed to the channel.-:::++</Admonition>## Roundtrip Latency@@ -98,25 +98,25 @@ You can also configure the channel so that the server must return an acknowledgeconst channel = supabase.channel('calc-latency', {config: {- broadcast: { ack: true }- }+ broadcast: { ack: true },+ },})channel.subscribe(async (status) => {- if (status === 'SUBSCRIBED') {- const begin = performance.now()+ if (status === 'SUBSCRIBED') {+ const begin = performance.now()- await channel.send({- type: 'broadcast',- event: 'latency',- payload: {},- })+ await channel.send({+ type: 'broadcast',+ event: 'latency',+ payload: {},+ })- const end = performance.now()+ const end = performance.now()- console.log(`Latency is ${end - begin} milliseconds`)- }- })+ console.log(`Latency is ${end - begin} milliseconds`)+ }+})```## Track and display which users are onlinediff --git a/apps/temp-docs/docs/guides/realtime/rate-limits.mdx b/apps/temp-docs/docs/guides/realtime/rate-limits.mdxindex 5b88247652a..6b35583687f 100644--- a/apps/temp-docs/docs/guides/realtime/rate-limits.mdx+++ b/apps/temp-docs/docs/guides/realtime/rate-limits.mdx@@ -38,9 +38,11 @@ For example, the [multiplayer.dev demo](/docs/guides/realtime/quickstart#cursor-Rate limiting errors can appear in backend logs and messages in the WebSocket connection.-:::note+<Admonition type="note">+Use the [Realtime Inspector](https://realtime.supabase.com/inspector/new) to reproduce an error and share those connection details with Supabase support.-:::++</Admonition>### Backend Logs@@ -56,9 +58,11 @@ Some limits can cause a Channel join to be refused. Realtime will reply with one- `too_many_connections`: Too many total concurrent connections for a project.- `too_many_joins`: Too many Channel joins per second.-:::note+<Admonition type="note">+Use your browser's developer tools to find the WebSocket initiation request and view individual messages.-:::++</Admonition>## Payload Limitsdiff --git a/apps/temp-docs/docs/guides/storage.mdx b/apps/temp-docs/docs/guides/storage.mdxindex 2362d463d52..0611579a973 100644--- a/apps/temp-docs/docs/guides/storage.mdx+++ b/apps/temp-docs/docs/guides/storage.mdx@@ -43,9 +43,11 @@ 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)-:::note+<Admonition type="note">+File, Folder, and Bucket names **must follow** [AWS object key naming guidelines](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html) and avoid use of any other characters.-:::++</Admonition>### Create a bucket@@ -268,11 +270,11 @@ Supabase Storage is integrated with your [Postgres Database](/docs/guides/databaThis means that you can use the same [Row Level Security Policies](/docs/guides/auth#policies)for managing access to your files. Supabase Storage stores metadata in the `objects` and `buckets` table in the storage schema. To allow read access to files, the RLS policy must allow users to `SELECT` the `objects` table and for uploading a new object, the RLS policy must grant users access to `INSERT` into the `objects` table and so on. The mapping between the different API calls and the database permissions required is documented in the [Reference docs](/docs/reference/javascript/storage-createbucket).-:::note+<Admonition type="note">Access control for Storage is mapped to CRUD operations on the `buckets` and `objects` table via RLS policies.-:::+</Admonition>## Helpersdiff --git a/apps/temp-docs/docs/guides/with-redwoodjs.mdx b/apps/temp-docs/docs/guides/with-redwoodjs.mdxindex fb60980339f..4c8830df945 100644--- a/apps/temp-docs/docs/guides/with-redwoodjs.mdx+++ b/apps/temp-docs/docs/guides/with-redwoodjs.mdx@@ -17,9 +17,11 @@ Instead, we'll rely on the Supabase client to do some of the work on the **web**That means you will want to refrain from running any `yarn rw prisma migrate` commands and also double check your build commands on deployment to ensure Prisma won't reset your database.-:::note+<Admonition type="note">+TLDR; Prisma currently doesn't support cross-schema foreign keys, so introspecting the schema fails due to how your Supabase `public` schema references the `auth.users`.-:::++</Admonition>This example provides the steps to build a simple user management app (from scratch!) using Supabase and [RedwoodJS](https://redwoodjs.com/docs/introduction). It includes:@@ -33,9 +35,11 @@ By the end of this guide you'll have an app which allows users to login and upda-:::note+<Admonition type="note">+Note: For RedwoodJS apps, port will be 8910-:::++</Admonition>### GitHub@@ -69,9 +73,11 @@ A Redwood application is split into two parts: a frontend and a backend. This isThe frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides"**, i.e. the "web side" and the "api side".They are separate projects because code on the `web side` will end up running in the user's browser while code on the `api side` will run on a server somewhere.-:::note+<Admonition type="note">+Important: When this guide refers to "API", that means the Supabase API and when it refers to "api side", that means the RedwoodJS `api side`.-:::++</Admonition>The **`api side`** is an implementation of a GraphQL API. The business logic is organized into "services" that represent their own internal API and can be called both from external GraphQL requests and other internal services.@@ -79,21 +85,25 @@ The **`web side`** is built with React. Redwood's router makes it simple to mapPages may contain a "Layout" component to wrap content. They also contain "Cells" and regular React components.Cells allow you to declaratively manage the lifecycle of a component that fetches and displays data.-:::note+<Admonition type="note">+For the sake of consistency with the other framework Quickstart examples, we'll build a RedwoodJS a little differently than normal.We **_won't use_** Prisma to connect to the Supabase Postgres database or [Prisma migrations](https://redwoodjs.com/docs/cli-commands#prisma-migrate) as one typically might in a Redwood app.Instead, we'll rely on the Supabase client to do some of the work on the **`web`** side and use the client again on the **`api`** side to do data fetching as well.-:::++</Admonition>## Project set upBefore we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabaseand then creating a "schema" inside the database.-:::note+<Admonition type="note">+When setting up Supabase, you'll interact with your project dashboard. However, most of the RedwoodJS setup steps will interact with the [Redwood CLI](https://redwoodjs.com/docs/cli-commands) to generate routes, pages, components, and more.So be sure to have a terminal at the ready and in your project directory.-:::++</Admonition>### Create a project@@ -180,9 +190,11 @@ create policy "Anyone can upload an avatar."#### Important Note about Prisma and Migrations-:::note+<Admonition type="note">+Because this Quick Start does not use Prisma to manage the database schema, seed it, or run migrations, you **need** to take extra care when running some of the typical Redwood CLI commands.-:::++</Admonition>### Get the API Keys@@ -201,9 +213,11 @@ We just need to get the URL as well as the `anon`, `service_role` and `JWT_SECRELet's start building the RedwoodJS app from scratch.-:::note+<Admonition type="note">+RedwoodJS requires Node.js (>=14.x <=16.x) and Yarn (>=1.15).-:::++</Admonition>Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides".@@ -321,9 +335,11 @@ Let's test our setup at the moment by starting up the app:yarn rw dev```-:::note+<Admonition type="note">+Note: You can also use the alias `rw` for `redwood`, as in `yarn rw` to run Redwood CLI commands-:::++</Admonition>You should see a "Welcome to RedwoodJS" page and a message about not having any pages yet.@@ -340,9 +356,11 @@ yarn rw generate page home /✔ Generating types ...```-:::note+<Admonition type="note">+Note: the slash `/` is important here as it creates a root level route.-:::++</Admonition>You can stop the `dev` server if you want; to see your changes, just be sure to run `yarn rw dev` again.@@ -576,11 +594,13 @@ const Account = () => {export default Account```-:::note+<Admonition type="note">+Note: You'll see the use of `useAuth()` several times in the quickstart. Redwood's `useAuth` hook provides convenient ways to accesslogIn, logOut, currentUser, and access the `supabase` authenticate client. We'll use it to get an instanceof the supabase client to interact with your API.-:::++</Admonition>### Update Home Pagediff --git a/apps/temp-docs/docs/reference/dart/v0.mdx b/apps/temp-docs/docs/reference/dart/v0.mdxindex 9684d4b9fe5..f4f39408af8 100644--- a/apps/temp-docs/docs/reference/dart/v0.mdx+++ b/apps/temp-docs/docs/reference/dart/v0.mdx@@ -7,9 +7,11 @@ title: Supabase Dart Library# Supabase Dart Library-:::caution+<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`.diff --git a/apps/temp-docs/docs/reference/javascript/v1.mdx b/apps/temp-docs/docs/reference/javascript/v1.mdxindex 97230e84aea..d31fd568739 100644--- a/apps/temp-docs/docs/reference/javascript/v1.mdx+++ b/apps/temp-docs/docs/reference/javascript/v1.mdx@@ -5,9 +5,11 @@ slug: /sidebar_label: Supabase JavaScript Library----:::caution+<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`.diff --git a/apps/temp-docs/generator/legacy/components/Example.ts b/apps/temp-docs/generator/legacy/components/Example.tsindex fe0105915b6..efeb1d9f0e5 100644--- a/apps/temp-docs/generator/legacy/components/Example.ts+++ b/apps/temp-docs/generator/legacy/components/Example.ts@@ -5,9 +5,11 @@ const Example = ({ name, description = '', tabs = '', note = '' }: params) => {const [noteTitle, ...noteText] = note.split('\n')console.log(noteText)note = `-:::note ${noteTitle}- ${noteText.join('\n')}-:::+<Admonition type="${noteTitle}">++${noteText.join('\n')}++</Admonition>`}return `