diff --git a/apps/docs/content/_partials/api_settings.mdx b/apps/docs/content/_partials/api_settings.mdx new file mode 100644 index 0000000000000..090ae9ba089f0 --- /dev/null +++ b/apps/docs/content/_partials/api_settings.mdx @@ -0,0 +1,16 @@ +### Get API details + +Now that you've created some database tables, you are ready to insert data using the auto-generated API. + +To do this, you need to get the Project URL and key. Get the URL from [the API settings section](/dashboard/project/_/settings/api) of a project and the key from the [the API Keys section of a project's Settings page](/dashboard/project/_/settings/api-keys/). + + + +Supabase is changing the way keys work to improve project security and developer experience. You can [read the full announcement](https://github.com/orgs/supabase/discussions/29260), but in the transition period, you can use both the current `anon` and `service_role` keys and the new publishable key with the form `sb_publishable_xxx` which will replace the older keys. + +To get the key values, open [the API Keys section of a project's Settings page](/dashboard/project/_/settings/api-keys/) and do the following: + +- **For legacy keys**, copy the `anon` key for client-side operations and the `service_role` key for server-side operations from the **Legacy API Keys** tab. +- **For new keys**, open the **API Keys** tab, if you don't have a publishable key already, click **Create new API Keys**, and copy the value from the **Publishable key** section. + + diff --git a/apps/docs/content/_partials/api_settings_steps.mdx b/apps/docs/content/_partials/api_settings_steps.mdx new file mode 100644 index 0000000000000..dbd3d3cd7e6be --- /dev/null +++ b/apps/docs/content/_partials/api_settings_steps.mdx @@ -0,0 +1,12 @@ +{/* TODO: How to completely consolidate partials? */} + + + +Supabase is changing the way keys work to improve project security and developer experience. You can [read the full announcement](https://github.com/orgs/supabase/discussions/29260), but in the transition period, you can use both the current `anon` and `service_role` keys and the new publishable key with the form `sb_publishable_xxx` which will replace the older keys. + +To get the key values, open [the API Keys section of a project's Settings page](/dashboard/project/_/settings/api-keys/) and do the following: + +- **For legacy keys**, copy the `anon` key for client-side operations and the `service_role` key for server-side operations from the **Legacy API Keys** tab. +- **For new keys**, open the **API Keys** tab, if you don't have a publishable key already, click **Create new API Keys**, and copy the value from the **Publishable key** section. + + diff --git a/apps/docs/content/_partials/kotlin_project_setup.mdx b/apps/docs/content/_partials/kotlin_project_setup.mdx index a01629914df78..751559eaff0ce 100644 --- a/apps/docs/content/_partials/kotlin_project_setup.mdx +++ b/apps/docs/content/_partials/kotlin_project_setup.mdx @@ -33,13 +33,7 @@ Now we are going to set up the database schema. You can just copy/paste the SQL -### Get the API keys - -Now that you've created some database tables, you are ready to insert data using the auto-generated API. -We just need to get the Project URL and `anon` key from the API settings. - -1. Go to the [API Settings](https://app.supabase.com/project/_/settings/api) page in the Dashboard. -2. Find your Project `URL`, `anon`, and `service_role` keys on this page. +<$Partial path="api_settings.mdx" /> ### Set up Google authentication diff --git a/apps/docs/content/_partials/project_setup.mdx b/apps/docs/content/_partials/project_setup.mdx index fe3596ea124d6..3548980bcea2c 100644 --- a/apps/docs/content/_partials/project_setup.mdx +++ b/apps/docs/content/_partials/project_setup.mdx @@ -55,11 +55,4 @@ supabase migration new user_management_starter -### Get the API keys - -Now that you've created some database tables, you are ready to insert data using the auto-generated API. - -To do this, you need to get the Project URL and `anon` key from the API settings. - -1. Go to the [API Settings](/dashboard/project/_/settings/api) page in the Dashboard. -2. Find your Project `URL`, `anon`, and `service_role` keys on this page. +<$Partial path="api_settings.mdx" /> diff --git a/apps/docs/content/guides/auth/quickstarts/nextjs.mdx b/apps/docs/content/guides/auth/quickstarts/nextjs.mdx index 75851d7e9af8a..5c42213369253 100644 --- a/apps/docs/content/guides/auth/quickstarts/nextjs.mdx +++ b/apps/docs/content/guides/auth/quickstarts/nextjs.mdx @@ -52,15 +52,17 @@ hideToc: true - Rename `.env.example` to `.env.local` and populate with [your project's URL and Anon Key](/dashboard/project/_/settings/api). + Rename `.env.example` to `.env.local` and populate with [your project's URL and Key](/dashboard/project/_/settings/api). + + <$Partial path="api_settings_steps.mdx" /> ```text name=.env.local - NEXT_PUBLIC_SUPABASE_URL=your-project-url - NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_... or anon key + NEXT_PUBLIC_SUPABASE_URL=your-project-url + NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_... or anon key ``` diff --git a/apps/docs/content/guides/auth/quickstarts/react-native.mdx b/apps/docs/content/guides/auth/quickstarts/react-native.mdx index 6655a95eedec7..8e2eccc75b5d0 100644 --- a/apps/docs/content/guides/auth/quickstarts/react-native.mdx +++ b/apps/docs/content/guides/auth/quickstarts/react-native.mdx @@ -64,7 +64,9 @@ hideToc: true - Create a helper file `lib/supabase.ts` that exports a Supabase client using your [Project URL and public API (anon) key](/dashboard/project/_/settings/api). + Create a helper file `lib/supabase.ts` that exports a Supabase client using your Project URL and key. + + <$Partial path="api_settings_steps.mdx" /> diff --git a/apps/docs/content/guides/auth/quickstarts/react.mdx b/apps/docs/content/guides/auth/quickstarts/react.mdx index 90bae5b029e69..2f1b94c74fd5b 100644 --- a/apps/docs/content/guides/auth/quickstarts/react.mdx +++ b/apps/docs/content/guides/auth/quickstarts/react.mdx @@ -64,7 +64,9 @@ hideToc: true - In `App.jsx`, create a Supabase client using your [Project URL and public API (anon) key](/dashboard/project/_/settings/api). + In `App.jsx`, create a Supabase client using your Project URL and key. + + <$Partial path="api_settings_steps.mdx" /> You can configure the Auth component to display whenever there is no session inside `supabase.auth.getSession()` diff --git a/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx index 5524606a613ea..0da48358c7fc4 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx @@ -74,7 +74,7 @@ hideToc: true runtimeConfig: { public: { supabaseUrl: process.env.SUPABASE_URL, - supabaseAnonKey: process.env.SUPABASE_PUBLISHABLE_KEY, + supabasePublishableKey: process.env.SUPABASE_PUBLISHABLE_KEY, }, }, }); @@ -99,7 +99,7 @@ hideToc: true