Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update docs url to env var (#38772)

Alaister Young5f533247e1dd
diff --git a/apps/studio/components/grid/components/grid/Grid.utils.tsx b/apps/studio/components/grid/components/grid/Grid.utils.tsx
index e348b4defa2..025aeb71029 100644
--- a/apps/studio/components/grid/components/grid/Grid.utils.tsx
+++ b/apps/studio/components/grid/components/grid/Grid.utils.tsx
@@ -11,6 +11,7 @@ import { tableRowKeys } from 'data/table-rows/keys'
import { useTableRowUpdateMutation } from 'data/table-rows/table-row-update-mutation'
import type { TableRowsData } from 'data/table-rows/table-rows-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { useGetImpersonatedRoleState } from 'state/role-impersonation-state'
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
import { Dictionary } from 'types'
@@ -115,7 +116,7 @@ export function useOnRowsChange(rows: SupaRow[]) {
each row before updating or deleting the row.
</p>
<div className="mt-3">
- <DocsButton href="https://supabase.com/docs/guides/database/tables#primary-keys" />
+ <DocsButton href={`${DOCS_URL}/guides/database/tables#primary-keys`} />
</div>
</div>
),
diff --git a/apps/studio/components/grid/components/header/Header.tsx b/apps/studio/components/grid/components/header/Header.tsx
index 696524f4d20..d23850a1071 100644
--- a/apps/studio/components/grid/components/header/Header.tsx
+++ b/apps/studio/components/grid/components/header/Header.tsx
@@ -17,6 +17,7 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { RoleImpersonationState } from 'lib/role-impersonation'
import {
useRoleImpersonationStateSnapshot,
@@ -47,7 +48,7 @@ export const MAX_EXPORT_ROW_COUNT_MESSAGE = (
<>
Sorry! We're unable to support exporting row counts larger than $
{MAX_EXPORT_ROW_COUNT.toLocaleString()} at the moment. Alternatively, you may consider using
- <Link href="https://supabase.com/docs/reference/cli/supabase-db-dump" target="_blank">
+ <Link href={`${DOCS_URL}/reference/cli/supabase-db-dump`} target="_blank">
pg_dump
</Link>{' '}
via our CLI instead.
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/Branching2Preview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/Branching2Preview.tsx
index 9bf5f6d30c1..35f3c6c7f42 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/Branching2Preview.tsx
+++ b/apps/studio/components/interfaces/App/FeaturePreview/Branching2Preview.tsx
@@ -1,7 +1,7 @@
import Image from 'next/image'
import { InlineLink } from 'components/ui/InlineLink'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
export const Branching2Preview = () => {
return (
@@ -16,7 +16,7 @@ export const Branching2Preview = () => {
<p className="text-sm text-foreground-light mb-4">
Create branches, review changes, and merge back into production all through the dashboard.
Read the below limitations and our{' '}
- <InlineLink href="https://supabase.com/docs/guides/platform/branching">
+ <InlineLink href={`${DOCS_URL}/guides/platform/branching`}>
branching documentation
</InlineLink>{' '}
before opting in.
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
index 57f156148f8..ddf714506d9 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
+++ b/apps/studio/components/interfaces/App/FeaturePreview/CLSPreview.tsx
@@ -3,7 +3,7 @@ import Image from 'next/image'
import { useParams } from 'common'
import { Markdown } from 'components/interfaces/Markdown'
import { InlineLink } from 'components/ui/InlineLink'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, WarningIcon } from 'ui'
export const CLSPreview = () => {
@@ -14,11 +14,11 @@ export const CLSPreview = () => {
<div className="mb-4 flex flex-col gap-y-2">
<Markdown
className="text-foreground-light max-w-full"
- content={`[Postgres Column-Level Privileges](https://supabase.com/docs/guides/auth/column-level-security) is a feature of Postgres that allows you to grant or revoke privileges on tables and columns based on user roles.`}
+ content={`[Postgres Column-Level Privileges](${DOCS_URL}/guides/auth/column-level-security) is a feature of Postgres that allows you to grant or revoke privileges on tables and columns based on user roles.`}
/>
<Markdown
className="text-foreground-light max-w-full"
- content={`This is an advanced feature and should be used with caution. Unless you have a very specific use case, we recommend just using [Row-Level Security](https://supabase.com/docs/guides/auth/row-level-security).`}
+ content={`This is an advanced feature and should be used with caution. Unless you have a very specific use case, we recommend just using [Row-Level Security](${DOCS_URL}/guides/auth/row-level-security).`}
/>
<Alert_Shadcn_ variant="warning" className="mt-2">
<WarningIcon />
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx
index 3679b94fb56..5b8e74dd0cd 100644
--- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx
@@ -2,6 +2,7 @@ import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { useParams } from 'common'
+import { DOCS_URL } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
@@ -31,7 +32,7 @@ export const AuthAlert = ({
below. Developers using this provider should move over to the new provider. Please refer
to our{' '}
<a
- href="https://supabase.com/docs/guides/auth/social-login/auth-slack"
+ href={`${DOCS_URL}/guides/auth/social-login/auth-slack`}
className="underline"
target="_blank"
>
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthProvidersForm.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthProvidersForm.tsx
index 1b118c25af6..65adb7ac947 100644
--- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthProvidersForm.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthProvidersForm.tsx
@@ -10,6 +10,7 @@ import {
import { ResourceList } from 'components/ui/Resource/ResourceList'
import { HorizontalShimmerWithIcon } from 'components/ui/Shimmers/Shimmers'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
+import { DOCS_URL } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
@@ -53,7 +54,7 @@ export const AuthProvidersForm = () => {
to more than an hour. It is recommended to set this value to less than an hour.
</p>
<Button asChild type="default" className="w-min" icon={<ExternalLink />}>
- <Link href="https://supabase.com/docs/guides/platform/going-into-prod#security">
+ <Link href={`${DOCS_URL}/guides/platform/going-into-prod#security`}>
View security recommendations
</Link>
</Button>
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
index 5d0a3d42ea5..5e530c411ae 100644
--- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
@@ -1,5 +1,6 @@
import { NO_REQUIRED_CHARACTERS, urlRegex } from 'components/interfaces/Auth/Auth.constants'
import { ProjectAuthConfigData } from 'data/auth/auth-config-query'
+import { DOCS_URL } from 'lib/constants'
import { boolean, number, object, string } from 'yup'
const parseBase64URL = (b64url: string) => {
@@ -12,7 +13,7 @@ const PROVIDER_EMAIL = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Email',
- link: 'https://supabase.com/docs/guides/auth/passwords',
+ link: `${DOCS_URL}/guides/auth/passwords`,
properties: {
EXTERNAL_EMAIL_ENABLED: {
title: 'Enable Email provider',
@@ -95,7 +96,7 @@ const PROVIDER_EMAIL = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -217,7 +218,7 @@ export const PROVIDER_PHONE = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Phone',
- link: 'https://supabase.com/docs/guides/auth/phone-login',
+ link: `${DOCS_URL}/guides/auth/phone-login`,
properties: {
EXTERNAL_PHONE_ENABLED: {
title: 'Enable Phone provider',
@@ -418,7 +419,7 @@ export const PROVIDER_PHONE = {
misc: {
iconKey: 'phone-icon4',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -426,7 +427,7 @@ const EXTERNAL_PROVIDER_APPLE = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Apple',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-apple',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-apple`,
properties: {
EXTERNAL_APPLE_ENABLED: {
title: 'Enable Sign in with Apple',
@@ -441,7 +442,7 @@ const EXTERNAL_PROVIDER_APPLE = {
},
EXTERNAL_APPLE_SECRET: {
title: 'Secret Key (for OAuth)',
- description: `Secret key used in the OAuth flow. [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#generate-a-client_secret)`,
+ description: `Secret key used in the OAuth flow. [Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#generate-a-client_secret)`,
type: 'string',
isSecret: true,
},
@@ -527,7 +528,7 @@ const EXTERNAL_PROVIDER_APPLE = {
iconKey: 'apple-icon',
requiresRedirect: true,
helper: `Register this callback URL when using Sign in with Apple on the web in the Apple Developer Center.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
alert: {
title: `Apple OAuth secret keys expire every 6 months`,
description: `A new secret should be generated every 6 months, otherwise users on the web will not be able to sign in.`,
@@ -539,7 +540,7 @@ const EXTERNAL_PROVIDER_AZURE = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Azure',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-azure',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-azure`,
properties: {
EXTERNAL_AZURE_ENABLED: {
title: 'Azure enabled',
@@ -553,7 +554,7 @@ const EXTERNAL_PROVIDER_AZURE = {
EXTERNAL_AZURE_SECRET: {
// [TODO] Change docs
title: 'Secret Value',
- description: `Enter the data from Value, not the Secret ID. [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-azure#obtain-a-secret-id)`,
+ description: `Enter the data from Value, not the Secret ID. [Learn more](${DOCS_URL}/guides/auth/social-login/auth-azure#obtain-a-secret-id)`,
type: 'string',
isSecret: true,
},
@@ -588,7 +589,7 @@ const EXTERNAL_PROVIDER_BITBUCKET = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Bitbucket',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-bitbucket',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-bitbucket`,
properties: {
EXTERNAL_BITBUCKET_ENABLED: {
title: 'Bitbucket enabled',
@@ -627,7 +628,7 @@ const EXTERNAL_PROVIDER_DISCORD = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Discord',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-discord?',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-discord?`,
properties: {
EXTERNAL_DISCORD_ENABLED: {
title: 'Discord enabled',
@@ -666,7 +667,7 @@ const EXTERNAL_PROVIDER_FACEBOOK = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Facebook',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-facebook',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-facebook`,
properties: {
EXTERNAL_FACEBOOK_ENABLED: {
title: 'Facebook enabled',
@@ -705,7 +706,7 @@ const EXTERNAL_PROVIDER_FIGMA = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Figma',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-figma',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-figma`,
properties: {
EXTERNAL_FIGMA_ENABLED: {
title: 'Figma enabled',
@@ -744,7 +745,7 @@ const EXTERNAL_PROVIDER_GITHUB = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'GitHub',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-github',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-github`,
properties: {
EXTERNAL_GITHUB_ENABLED: {
title: 'GitHub enabled',
@@ -783,7 +784,7 @@ const EXTERNAL_PROVIDER_GITLAB = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'GitLab',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-gitlab',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-gitlab`,
properties: {
EXTERNAL_GITLAB_ENABLED: {
title: 'GitLab enabled',
@@ -830,7 +831,7 @@ const EXTERNAL_PROVIDER_GOOGLE = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Google',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-google',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-google`,
properties: {
EXTERNAL_GOOGLE_ENABLED: {
title: 'Enable Sign in with Google',
@@ -884,7 +885,7 @@ const EXTERNAL_PROVIDER_GOOGLE = {
iconKey: 'google-icon',
requiresRedirect: true,
helper: `Register this callback URL when using Sign-in with Google on the web using OAuth.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-google#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-google#configure-your-services-id)`,
},
}
@@ -892,7 +893,7 @@ const EXTERNAL_PROVIDER_KAKAO = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Kakao',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-kakao',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-kakao`,
properties: {
EXTERNAL_KAKAO_ENABLED: {
title: 'Kakao enabled',
@@ -934,7 +935,7 @@ const EXTERNAL_PROVIDER_KEYCLOAK = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'KeyCloak',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-keycloak',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-keycloak`,
properties: {
EXTERNAL_KEYCLOAK_ENABLED: {
title: 'Keycloak enabled',
@@ -985,7 +986,7 @@ const EXTERNAL_PROVIDER_LINKEDIN_OIDC = {
type: 'object',
key: 'linkedin_oidc',
title: 'LinkedIn (OIDC)',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-linkedin',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-linkedin`,
properties: {
EXTERNAL_LINKEDIN_OIDC_ENABLED: {
title: 'LinkedIn enabled',
@@ -1024,7 +1025,7 @@ const EXTERNAL_PROVIDER_NOTION = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Notion',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-notion',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-notion`,
properties: {
EXTERNAL_NOTION_ENABLED: {
title: 'Notion enabled',
@@ -1063,7 +1064,7 @@ const EXTERNAL_PROVIDER_TWITCH = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Twitch',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-twitch',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-twitch`,
properties: {
EXTERNAL_TWITCH_ENABLED: {
title: 'Twitch enabled',
@@ -1102,7 +1103,7 @@ const EXTERNAL_PROVIDER_TWITTER = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Twitter',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-twitter',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-twitter`,
properties: {
EXTERNAL_TWITTER_ENABLED: {
title: 'Twitter enabled',
@@ -1141,7 +1142,7 @@ const EXTERNAL_PROVIDER_SLACK = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Slack (Deprecated)',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-slack',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-slack`,
properties: {
EXTERNAL_SLACK_ENABLED: {
title: 'Slack enabled',
@@ -1181,7 +1182,7 @@ const EXTERNAL_PROVIDER_SLACK_OIDC = {
type: 'object',
title: 'Slack (OIDC)',
key: 'slack_oidc',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-slack',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-slack`,
properties: {
EXTERNAL_SLACK_OIDC_ENABLED: {
title: 'Slack enabled',
@@ -1220,7 +1221,7 @@ const EXTERNAL_PROVIDER_SPOTIFY = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Spotify',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-spotify',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-spotify`,
properties: {
EXTERNAL_SPOTIFY_ENABLED: {
title: 'Spotify enabled',
@@ -1259,7 +1260,7 @@ const EXTERNAL_PROVIDER_WORKOS = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'WorkOS',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-workos',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-workos`,
properties: {
EXTERNAL_WORKOS_ENABLED: {
title: 'WorkOS enabled',
@@ -1309,7 +1310,7 @@ const EXTERNAL_PROVIDER_ZOOM = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Zoom',
- link: 'https://supabase.com/docs/guides/auth/social-login/auth-zoom',
+ link: `${DOCS_URL}/guides/auth/social-login/auth-zoom`,
properties: {
EXTERNAL_ZOOM_ENABLED: {
title: 'Zoom enabled',
@@ -1348,12 +1349,11 @@ const PROVIDER_SAML = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'SAML 2.0',
- link: 'https://supabase.com/docs/guides/auth/enterprise-sso/auth-sso-saml',
+ link: `${DOCS_URL}/guides/auth/enterprise-sso/auth-sso-saml`,
properties: {
SAML_ENABLED: {
title: 'Enable SAML 2.0 Single Sign-on',
- description:
- 'You will need to use the [Supabase CLI](https://supabase.com/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to set up SAML after enabling it',
+ description: `You will need to use the [Supabase CLI](${DOCS_URL}/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to set up SAML after enabling it`,
type: 'boolean',
},
SAML_EXTERNAL_URL: {
@@ -1385,7 +1385,7 @@ const PROVIDER_WEB3 = {
$schema: JSON_SCHEMA_VERSION,
type: 'object',
title: 'Web3 Wallet',
- link: 'https://supabase.com/docs/guides/auth/auth-web3',
+ link: `${DOCS_URL}/guides/auth/auth-web3`,
properties: {
EXTERNAL_WEB3_ETHEREUM_ENABLED: {
title: 'Enable Sign in with Ethereum',
diff --git a/apps/studio/components/interfaces/Auth/AuthTemplatesValidation.tsx b/apps/studio/components/interfaces/Auth/AuthTemplatesValidation.tsx
index cfc574698ec..390ba87c0e7 100644
--- a/apps/studio/components/interfaces/Auth/AuthTemplatesValidation.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthTemplatesValidation.tsx
@@ -1,6 +1,8 @@
-import type { FormSchema } from 'types'
import { object, string } from 'yup'
+import { DOCS_URL } from 'lib/constants'
+import type { FormSchema } from 'types'
+
const JSON_SCHEMA_VERSION = 'http://json-schema.org/draft-07/schema#'
const CONFIRMATION: FormSchema = {
@@ -34,7 +36,7 @@ const CONFIRMATION: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -69,7 +71,7 @@ const INVITE: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -104,7 +106,7 @@ const MAGIC_LINK: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -140,7 +142,7 @@ const EMAIL_CHANGE: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
@@ -175,7 +177,7 @@ const RECOVERY: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
const REAUTHENTICATION: FormSchema = {
@@ -206,7 +208,7 @@ const REAUTHENTICATION: FormSchema = {
misc: {
iconKey: 'email-icon2',
helper: `To complete setup, add this authorisation callback URL to your app's configuration in the Apple Developer Console.
- [Learn more](https://supabase.com/docs/guides/auth/social-login/auth-apple#configure-your-services-id)`,
+[Learn more](${DOCS_URL}/guides/auth/social-login/auth-apple#configure-your-services-id)`,
},
}
diff --git a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx
index af36ff6689b..3717cad6b9e 100644
--- a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx
+++ b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx
@@ -15,6 +15,7 @@ import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -186,7 +187,7 @@ export const BasicAuthSettingsForm = () => {
Enable{' '}
<InlineLink
className="text-foreground-light hover:text-foreground"
- href="https://supabase.com/docs/guides/auth/auth-identity-linking#manual-linking-beta"
+ href={`${DOCS_URL}/guides/auth/auth-identity-linking#manual-linking-beta`}
>
manual linking APIs
</InlineLink>{' '}
@@ -219,7 +220,7 @@ export const BasicAuthSettingsForm = () => {
Enable{' '}
<InlineLink
className="text-foreground-light hover:text-foreground"
- href="https://supabase.com/docs/guides/auth/auth-anonymous"
+ href={`${DOCS_URL}/guides/auth/auth-anonymous`}
>
anonymous sign-ins
</InlineLink>{' '}
@@ -263,7 +264,7 @@ export const BasicAuthSettingsForm = () => {
to ensure that access to your data is restricted where required.
</p>
<Button asChild type="default" className="w-min" icon={<ExternalLink />}>
- <Link href="https://supabase.com/docs/guides/auth/auth-anonymous#access-control">
+ <Link href={`${DOCS_URL}/guides/auth/auth-anonymous#access-control`}>
View access control docs
</Link>
</Button>
diff --git a/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx b/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
index e5e4d39fdb7..86c6a517ba1 100644
--- a/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
+++ b/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
@@ -2,6 +2,7 @@ import Link from 'next/link'
import { useParams } from 'common'
import { InlineLink } from 'components/ui/InlineLink'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -20,7 +21,7 @@ export function EmailRateLimitsAlert() {
<AlertDescription_Shadcn_>
You're using the built-in email service. The service has rate limits and it's not meant to
be used for production apps. Check the{' '}
- <InlineLink href="https://supabase.com/docs/guides/platform/going-into-prod#auth-rate-limits">
+ <InlineLink href={`${DOCS_URL}/guides/platform/going-into-prod#auth-rate-limits`}>
documentation
</InlineLink>{' '}
for an up-to-date information on the current rate limits.
diff --git a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx
index 2e97de91220..ecc4de59e65 100644
--- a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx
+++ b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx
@@ -17,6 +17,7 @@ import { AuthConfigResponse } from 'data/auth/auth-config-query'
import { useAuthHooksUpdateMutation } from 'data/auth/auth-hooks-update-mutation'
import { executeSql } from 'data/sql/execute-sql-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
FormControl_Shadcn_,
@@ -290,7 +291,7 @@ export const CreateHookSheet = ({
{isCreating ? `Add ${title}` : `Update ${title}`}
</SheetTitle>
</div>
- <DocsButton href={'https://supabase.com/docs/guides/auth/auth-hooks/' + hook.docSlug} />
+ <DocsButton href={`${DOCS_URL}/guides/auth/auth-hooks/${hook.docSlug}`} />
</SheetHeader>
<Separator />
<SheetSection className="overflow-auto flex-grow px-0">
diff --git a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
index e09e75bf280..8ec5c5d9744 100644
--- a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
+++ b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
@@ -4,6 +4,7 @@ import { Check, Webhook } from 'lucide-react'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { DocsButton } from 'components/ui/DocsButton'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Input, copyToClipboard } from 'ui'
import { Hook } from './hooks.constants'
@@ -108,7 +109,7 @@ export const HookCard = ({ hook, onSelect }: HookCardProps) => {
>
Configure hook
</ButtonTooltip>
- <DocsButton href={'https://supabase.com/docs/guides/auth/auth-hooks/' + hook.docSlug} />
+ <DocsButton href={`${DOCS_URL}/guides/auth/auth-hooks/${hook.docSlug}`} />
</div>
</div>
<div className="flex-1">
diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsx
index dc196a4e6e7..cb6071b0db2 100644
--- a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsx
@@ -2,6 +2,7 @@ import { noop } from 'lodash'
import { ChevronLeft, FlaskConical } from 'lucide-react'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
import { POLICY_MODAL_VIEWS } from '../Policies.constants'
@@ -59,10 +60,7 @@ const PolicyEditorModalTitle = ({
Try Supabase Assistant
</Button>
)}
- <DocsButton
- className="mt-[-4px]"
- href="https://supabase.com/docs/learn/auth-deep-dive/auth-policies"
- />
+ <DocsButton className="mt-[-4px]" href={`${DOCS_URL}/learn/auth-deep-dive/auth-policies`} />
</div>
</div>
)
diff --git a/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx
index 791d1ccd6f1..748806817ca 100644
--- a/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx
+++ b/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx
@@ -13,6 +13,7 @@ import NoPermission from 'components/ui/NoPermission'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -214,9 +215,9 @@ export const ProtectionAuthSettingsForm = () => {
<InlineLink
href={
field.value === 'hcaptcha'
- ? 'https://supabase.com/docs/guides/auth/auth-captcha?queryGroups=captcha-method&captcha-method=hcaptcha-1'
+ ? `${DOCS_URL}/guides/auth/auth-captcha?queryGroups=captcha-method&captcha-method=hcaptcha-1`
: field.value === 'turnstile'
- ? 'https://supabase.com/docs/guides/auth/auth-captcha?queryGroups=captcha-method&captcha-method=turnstile-1'
+ ? `${DOCS_URL}/guides/auth/auth-captcha?queryGroups=captcha-method&captcha-method=turnstile-1`
: '/'
}
className="mt-2 text-xs text-foreground-light hover:text-foreground no-underline"
diff --git a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx
index 32094c4986b..9e4f573f421 100644
--- a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx
+++ b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx
@@ -11,6 +11,7 @@ import { DocsButton } from 'components/ui/DocsButton'
import { HorizontalShimmerWithIcon } from 'components/ui/Shimmers/Shimmers'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -82,7 +83,7 @@ export const RedirectUrls = () => {
allowed, for example, https://*.domain.com
</ScaffoldDescription>
</div>
- <DocsButton href="https://supabase.com/docs/guides/auth/concepts/redirect-urls" />
+ <DocsButton href={`${DOCS_URL}/guides/auth/concepts/redirect-urls`} />
</div>
{isLoading && (
diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/IntegrationCard.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/IntegrationCard.tsx
index 4737f81cf43..be336c3519e 100644
--- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/IntegrationCard.tsx
+++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/IntegrationCard.tsx
@@ -1,8 +1,8 @@
import { Check } from 'lucide-react'
import Image from 'next/image'
-import { useParams } from 'common'
import { ThirdPartyAuthIntegration } from 'data/third-party-auth/integrations-query'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Button } from 'ui'
import { AWS_IDP_REGIONS } from './AwsRegionSelector'
import {
@@ -29,7 +29,7 @@ export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
users. You can read more in the{' '}
<a
className="hover:decoration-brand underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/auth"
+ href={`${DOCS_URL}/guides/auth`}
>
documentation
</a>
@@ -44,7 +44,7 @@ export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
read more in the{' '}
<a
className="hover:decoration-brand underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/auth"
+ href={`${DOCS_URL}/guides/auth`}
>
documentation
</a>
@@ -58,7 +58,7 @@ export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
can read more in the{' '}
<a
className="hover:decoration-brand underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/auth/third-party/aws-cognito"
+ href={`${DOCS_URL}/guides/auth/third-party/aws-cognito`}
>
documentation
</a>
@@ -73,7 +73,7 @@ export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
more in the{' '}
<a
className="hover:decoration-brand underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/auth/third-party/clerk"
+ href={`${DOCS_URL}/guides/auth/third-party/clerk`}
>
documentation
</a>
@@ -88,7 +88,7 @@ export const getIntegrationTypeDescription = (type: INTEGRATION_TYPES) => {
more in the{' '}
<a
className="hover:decoration-brand underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/auth/third-party/workos"
+ href={`${DOCS_URL}/guides/auth/third-party/workos`}
>
documentation
</a>
diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx
index 3962304fe17..99890c35aaf 100644
--- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx
+++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx
@@ -18,6 +18,7 @@ import {
useThirdPartyAuthIntegrationsQuery,
} from 'data/third-party-auth/integrations-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import { cn } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { AddIntegrationDropdown } from './AddIntegrationDropdown'
@@ -73,14 +74,16 @@ export const ThirdPartyAuthForm = () => {
<br />
Billing is based on the number of monthly active users (MAUs) requesting your API
throughout the billing period. Refer to our{' '}
- <InlineLink href="https://supabase.com/docs/guides/platform/manage-your-usage/monthly-active-users-third-party">
+ <InlineLink
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/monthly-active-users-third-party`}
+ >
billing docs
</InlineLink>{' '}
for more information.
</ScaffoldSectionDescription>
</div>
<div className="flex items-center gap-2 ">
- <DocsButton href="https://supabase.com/docs/guides/auth/third-party/overview" />
+ <DocsButton href={`${DOCS_URL}/guides/auth/third-party/overview`} />
{integrations.length !== 0 && (
<AddIntegrationDropdown onSelectIntegrationType={setSelectedIntegration} />
)}
diff --git a/apps/studio/components/interfaces/Billing/SpendCapModal.tsx b/apps/studio/components/interfaces/Billing/SpendCapModal.tsx
index a119c087a63..e0c132c4a09 100644
--- a/apps/studio/components/interfaces/Billing/SpendCapModal.tsx
+++ b/apps/studio/components/interfaces/Billing/SpendCapModal.tsx
@@ -1,4 +1,5 @@
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { Button, Modal, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from 'ui'
interface SpendCapModalProps {
@@ -15,7 +16,7 @@ const SpendCapModal = ({ visible, onHide }: SpendCapModalProps) => {
header={
<div className="flex justify-between items-center">
<span>Spend Cap</span>
- <DocsButton href="https://supabase.com/docs/guides/platform/cost-control#spend-cap" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/cost-control#spend-cap`} />
</div>
}
showCloseButton={false}
diff --git a/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/CPUWarnings.tsx b/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/CPUWarnings.tsx
index fc254440a42..daf855d7baa 100644
--- a/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/CPUWarnings.tsx
+++ b/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/CPUWarnings.tsx
@@ -1,6 +1,8 @@
-import { AlertTitle } from '@ui/components/shadcn/ui/alert'
import { AlertCircle } from 'lucide-react'
import Link from 'next/link'
+
+import { AlertTitle } from '@ui/components/shadcn/ui/alert'
+import { DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, Alert_Shadcn_, Button } from 'ui'
interface CPUWarningsProps {
@@ -22,9 +24,7 @@ const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) =>
</AlertDescription_Shadcn_>
<div className="mt-3 flex items-center space-x-2">
<Button asChild type="default">
- <Link href="https://supabase.com/docs/guides/troubleshooting/high-cpu-usage">
- Learn more
- </Link>
+ <Link href={`${DOCS_URL}/guides/troubleshooting/high-cpu-usage`}>Learn more</Link>
</Button>
<Button asChild type="warning">
<Link href={upgradeUrl}>
@@ -48,9 +48,7 @@ const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) =>
</AlertDescription_Shadcn_>
<div className="mt-3 flex items-center space-x-2">
<Button asChild type="default">
- <Link href="https://supabase.com/docs/guides/troubleshooting/high-cpu-usage">
- Learn more
- </Link>
+ <Link href={`${DOCS_URL}/guides/troubleshooting/high-cpu-usage`}>Learn more</Link>
</Button>
<Button asChild type="danger">
<Link href={upgradeUrl}>
diff --git a/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/RAMWarnings.tsx b/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/RAMWarnings.tsx
index 6b7cc9396a1..56bab91fae1 100644
--- a/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/RAMWarnings.tsx
+++ b/apps/studio/components/interfaces/Billing/Usage/UsageWarningAlerts/RAMWarnings.tsx
@@ -1,6 +1,8 @@
-import { AlertTitle } from '@ui/components/shadcn/ui/alert'
import { AlertCircle } from 'lucide-react'
import Link from 'next/link'
+
+import { AlertTitle } from '@ui/components/shadcn/ui/alert'
+import { DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, Alert_Shadcn_, Button } from 'ui'
interface RAMWarningsProps {
@@ -22,9 +24,7 @@ const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) =>
</AlertDescription_Shadcn_>
<div className="mt-3 flex items-center space-x-2">
<Button asChild type="default">
- <Link href="https://supabase.com/docs/guides/troubleshooting/exhaust-ram">
- Learn more
- </Link>
+ <Link href={`${DOCS_URL}/guides/troubleshooting/exhaust-ram`}>Learn more</Link>
</Button>
<Button asChild type="warning">
<Link href={upgradeUrl}>
@@ -48,9 +48,7 @@ const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) =>
</AlertDescription_Shadcn_>
<div className="mt-3 flex items-center space-x-2">
<Button asChild type="default">
- <Link href="https://supabase.com/docs/guides/troubleshooting/high-cpu-usage">
- Learn more
- </Link>
+ <Link href={`${DOCS_URL}/guides/troubleshooting/high-cpu-usage`}>Learn more</Link>
</Button>
<Button asChild type="danger">
<Link href={upgradeUrl}>
diff --git a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
index 946a44e3bc4..7166def9ca2 100644
--- a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
@@ -4,6 +4,7 @@ import Link from 'next/link'
import { BranchSelector } from './BranchSelector'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
const EMPTY_STATE_CONTAINER = 'flex items-center flex-col justify-center w-full py-10 px-4'
@@ -69,7 +70,7 @@ export const PreviewBranchesEmptyState = ({
your database schema without affecting your main database.
</p>
<div className="flex items-center space-x-2">
- <DocsButton href="https://supabase.com/docs/guides/platform/branching" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/branching`} />
<Button type="primary" onClick={() => onSelectCreateBranch()}>
Create your first branch
</Button>
diff --git a/apps/studio/components/interfaces/Connect/Connect.constants.ts b/apps/studio/components/interfaces/Connect/Connect.constants.ts
index 80f82d9560a..33ff40fa88b 100644
--- a/apps/studio/components/interfaces/Connect/Connect.constants.ts
+++ b/apps/studio/components/interfaces/Connect/Connect.constants.ts
@@ -1,3 +1,4 @@
+import { DOCS_URL } from 'lib/constants'
import { CodeBlockLang } from 'ui'
export type DatabaseConnectionType =
@@ -75,7 +76,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'nextjs',
label: 'Next.js',
icon: 'nextjs',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/nextjs',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/nextjs`,
children: [
{
key: 'app',
@@ -109,8 +110,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'remix',
label: 'Remix',
icon: 'remix',
- guideLink:
- 'https://supabase.com/docs/guides/auth/server-side/creating-a-client?framework=remix&environment=remix-loader',
+ guideLink: `${DOCS_URL}/guides/auth/server-side/creating-a-client?framework=remix&environment=remix-loader`,
children: [
{
key: 'supabasejs',
@@ -124,7 +124,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'react',
label: 'React',
icon: 'react',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/reactjs',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/reactjs`,
children: [
{
key: 'create-react-app',
@@ -158,7 +158,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'nuxt',
label: 'Nuxt',
icon: 'nuxt',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/nuxtjs',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/nuxtjs`,
children: [
{
key: 'supabasejs',
@@ -172,7 +172,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'vuejs',
label: 'Vue.JS',
icon: 'vuejs',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/vue',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/vue`,
children: [
{
key: 'supabasejs',
@@ -187,7 +187,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'sveltekit',
label: 'SvelteKit',
icon: 'sveltekit',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/sveltekit',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/sveltekit`,
children: [
{
key: 'supabasejs',
@@ -201,7 +201,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'solidjs',
label: 'Solid.js',
icon: 'solidjs',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/solidjs',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/solidjs`,
children: [
{
key: 'supabasejs',
@@ -229,7 +229,7 @@ export const FRAMEWORKS: ConnectionType[] = [
key: 'refine',
label: 'refine',
icon: 'refine',
- guideLink: 'https://supabase.com/docs/guides/getting-started/quickstarts/refine',
+ guideLink: `${DOCS_URL}/guides/getting-started/quickstarts/refine`,
children: [
{
key: 'supabasejs',
@@ -246,7 +246,7 @@ export const MOBILES: ConnectionType[] = [
key: 'exporeactnative',
label: 'Expo React Native',
icon: 'expo',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-expo-react-native',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-expo-react-native`,
children: [
{
key: 'supabasejs',
@@ -260,7 +260,7 @@ export const MOBILES: ConnectionType[] = [
key: 'flutter',
label: 'Flutter',
icon: 'flutter',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-flutter',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-flutter`,
children: [
{
key: 'supabaseflutter',
@@ -274,7 +274,7 @@ export const MOBILES: ConnectionType[] = [
key: 'ionicreact',
label: 'Ionic React',
icon: 'react',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-ionic-react',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-ionic-react`,
children: [
{
key: 'supabasejs',
@@ -288,7 +288,7 @@ export const MOBILES: ConnectionType[] = [
key: 'swift',
label: 'Swift',
icon: 'swift',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-swift',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-swift`,
children: [
{
key: 'supabaseswift',
@@ -302,7 +302,7 @@ export const MOBILES: ConnectionType[] = [
key: 'androidkotlin',
label: 'Android Kotlin',
icon: 'kotlin',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-kotlin',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-kotlin`,
children: [
{
key: 'supabasekt',
@@ -316,7 +316,7 @@ export const MOBILES: ConnectionType[] = [
key: 'ionicangular',
label: 'Ionic Angular',
icon: 'ionic-angular',
- guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-ionic-angular',
+ guideLink: `${DOCS_URL}/guides/getting-started/tutorials/with-ionic-angular`,
children: [
{
key: 'supabasejs',
@@ -340,8 +340,7 @@ export const ORMS: ConnectionType[] = [
key: 'drizzle',
label: 'Drizzle',
icon: 'drizzle',
- guideLink:
- 'https://supabase.com/docs/guides/database/connecting-to-postgres#connecting-with-drizzle',
+ guideLink: `${DOCS_URL}/guides/database/connecting-to-postgres#connecting-with-drizzle`,
children: [],
},
]
diff --git a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx
index 85a69d5680e..f298ebd9142 100644
--- a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx
+++ b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx
@@ -7,6 +7,7 @@ import { InlineLink } from 'components/ui/InlineLink'
import { useBackupDownloadMutation } from 'data/database/backup-download-mutation'
import type { DatabaseBackup } from 'data/database/backups-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import { TimestampInfo } from 'ui-patterns'
@@ -75,7 +76,9 @@ export const BackupItem = ({ index, isHealthy, backup, onSelectBackup }: BackupI
<>
Physical backups cannot be downloaded through the dashboard. You can still
download it via pgdump by following our guide{' '}
- <InlineLink href="https://supabase.com/docs/guides/troubleshooting/download-logical-backups">
+ <InlineLink
+ href={`${DOCS_URL}/guides/troubleshooting/download-logical-backups`}
+ >
here
</InlineLink>
.
diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
index 91414881c7f..c6b58a9307a 100644
--- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
@@ -10,6 +10,7 @@ import { useSchemasQuery } from 'data/database/schemas-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { useIsOrioleDb, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useProtectedSchemas } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -146,7 +147,7 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
{extension.name} cannot be accelerated by indexes on tables that are using the
OrioleDB access method
</span>
- <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ <DocsButton abbrev={false} className="mt-2" href={`${DOCS_URL}`} />
</Admonition>
)}
diff --git a/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx b/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx
index 3139f8286e7..d418a6ce95c 100644
--- a/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx
@@ -9,6 +9,7 @@ import { useDatabaseExtensionDisableMutation } from 'data/database-extensions/da
import { DatabaseExtension } from 'data/database-extensions/database-extensions-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsOrioleDb, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { extensions } from 'shared-data'
import { Button, Switch, TableCell, TableRow, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import { Admonition } from 'ui-patterns'
@@ -37,7 +38,7 @@ export const ExtensionRow = ({ extension }: ExtensionRowProps) => {
const extensionMeta = extensions.find((item) => item.name === extension.name)
const docsUrl = extensionMeta?.link.startsWith('/guides')
- ? `https://supabase.com/docs${extensionMeta?.link}`
+ ? `${DOCS_URL}${extensionMeta?.link}`
: extensionMeta?.link ?? undefined
const { mutate: disableExtension, isLoading: isDisabling } = useDatabaseExtensionDisableMutation({
diff --git a/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx b/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
index 0885380baa2..08ec649e6d2 100644
--- a/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
@@ -11,6 +11,7 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Card,
Input,
@@ -72,7 +73,7 @@ export const Extensions = () => {
className="w-52"
icon={<Search size={14} />}
/>
- <DocsButton href="https://supabase.com/docs/guides/database/extensions" />
+ <DocsButton href={`${DOCS_URL}/guides/database/extensions`} />
</div>
</div>
diff --git a/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx b/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
index 7e43bf126ac..56dbdfbd013 100644
--- a/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
+++ b/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
@@ -12,6 +12,7 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useDatabaseHooksQuery } from 'data/database-triggers/database-triggers-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { noop } from 'lib/void'
import { Input } from 'ui'
import { HooksListEmpty } from './HooksListEmpty'
@@ -63,7 +64,7 @@ export const HooksList = ({
onChange={(e) => setFilterString(e.target.value)}
/>
<div className="flex items-center gap-x-2">
- <DocsButton href="https://supabase.com/docs/guides/database/webhooks" />
+ <DocsButton href={`${DOCS_URL}/guides/database/webhooks`} />
<ButtonTooltip
onClick={() => createHook()}
disabled={!isPermissionsLoaded || !canCreateWebhooks}
diff --git a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
index fbf2c949d63..a76f24f6ae7 100644
--- a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
+++ b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
@@ -11,6 +11,7 @@ import { useSchemasQuery } from 'data/database/schemas-query'
import { useTableColumnsQuery } from 'data/database/table-columns-query'
import { useEntityTypesQuery } from 'data/entity-types/entity-types-infinite-query'
import { useIsOrioleDb, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
CommandEmpty_Shadcn_,
@@ -379,7 +380,7 @@ CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexTyp
description="More index types may be supported when OrioleDB is no longer in preview"
>
{/* [Joshen Oriole] Hook up proper docs URL */}
- <DocsButton className="mt-2" abbrev={false} href="https://supabase.com/docs" />
+ <DocsButton className="mt-2" abbrev={false} href={`${DOCS_URL}`} />
</Admonition>
)}
</SidePanel.Content>
diff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
index 604b908c1d7..88a6a254588 100644
--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
@@ -11,6 +11,7 @@ import { replicationKeys } from 'data/replication/keys'
import { fetchReplicationPipelineVersion } from 'data/replication/pipeline-version-query'
import { useReplicationPipelinesQuery } from 'data/replication/pipelines-query'
import { useReplicationSourcesQuery } from 'data/replication/sources-query'
+import { DOCS_URL } from 'lib/constants'
import { Button, cn, Input_Shadcn_ } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
import { DestinationPanel } from './DestinationPanel'
@@ -136,7 +137,7 @@ export const Destinations = () => {
<div className="flex gap-x-2">
<EnableReplicationModal />
{/* [Joshen] Placeholder for when we have documentation */}
- <DocsButton href="https://supabase.com/docs" />
+ <DocsButton href={`${DOCS_URL}`} />
</div>
</div>
) : hasDestinations ? (
diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx
index cf0757aee79..a79cfa8db1e 100644
--- a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx
@@ -32,7 +32,7 @@ import {
useIsAwsK8sCloudProvider,
useSelectedProjectQuery,
} from 'hooks/misc/useSelectedProject'
-import { GB, PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, GB, PROJECT_STATUS } from 'lib/constants'
import { CloudProvider } from 'shared-data'
import {
Button,
@@ -372,7 +372,7 @@ export function DiskManagementForm() {
<DocsButton
abbrev={false}
className="mt-2"
- href="https://supabase.com/docs/guides/platform/database-size#read-only-mode"
+ href={`${DOCS_URL}/guides/platform/database-size#read-only-mode`}
/>
</Admonition>
)}
@@ -385,7 +385,7 @@ export function DiskManagementForm() {
<DocsButton
abbrev={false}
className="mt-2"
- href="https://supabase.com/docs/guides/platform/database-size#disabling-read-only-mode"
+ href={`${DOCS_URL}/guides/platform/database-size#disabling-read-only-mode`}
/>
</Admonition>
)}
diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx b/apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
index 7c6c56ef9ec..e9a580af50c 100644
--- a/apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
@@ -2,6 +2,7 @@ import Link from 'next/link'
import { useParams } from 'common'
import { FormHeader } from 'components/ui/Forms/FormHeader'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
import { NoticeBar } from './ui/NoticeBar'
@@ -13,7 +14,7 @@ export function DiskManagementPanelForm() {
<div id="disk-management">
<FormHeader
title="Disk Management"
- docsUrl="https://supabase.com/docs/guides/platform/database-size#disk-management"
+ docsUrl={`${DOCS_URL}/guides/platform/database-size#disk-management`}
/>
<NoticeBar
visible={true}
diff --git a/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx b/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
index 6f7245d9d5e..6cbe106ade3 100644
--- a/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
@@ -6,10 +6,11 @@ import { useParams } from 'common'
import { DocsButton } from 'components/ui/DocsButton'
import { InlineLink } from 'components/ui/InlineLink'
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
-import { InstanceSpecs } from 'lib/constants'
+import { DOCS_URL, InstanceSpecs } from 'lib/constants'
import Link from 'next/link'
import {
cn,
@@ -33,7 +34,6 @@ import {
import { BillingChangeBadge } from '../ui/BillingChangeBadge'
import FormMessage from '../ui/FormMessage'
import { NoticeBar } from '../ui/NoticeBar'
-import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
/**
* to do: this could be a type from api-types
@@ -139,7 +139,7 @@ export function ComputeSizeField({ form, disabled }: ComputeSizeFieldProps) {
<div className="mt-3">
<DocsButton
abbrev={false}
- href="https://supabase.com/docs/guides/platform/compute-and-disk"
+ href={`${DOCS_URL}/guides/platform/compute-and-disk`}
/>
</div>
diff --git a/apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx b/apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx
index ce2105adb22..9b6057676a2 100644
--- a/apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx
@@ -8,7 +8,7 @@ import { useDiskUtilizationQuery } from 'data/config/disk-utilization-query'
import dayjs from 'dayjs'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { GB } from 'lib/constants'
+import { DOCS_URL, GB } from 'lib/constants'
import { Button, FormControl_Shadcn_, FormField_Shadcn_, Input_Shadcn_, Skeleton, cn } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { DiskStorageSchemaType } from '../DiskManagement.schema'
@@ -156,10 +156,7 @@ export function DiskSizeField({
`Your plan includes ${includedDiskGB} GB of disk size for ${watchedStorageType}.`}
<div className="mt-3">
- <DocsButton
- abbrev={false}
- href="https://supabase.com/docs/guides/platform/database-size"
- />
+ <DocsButton abbrev={false} href={`${DOCS_URL}/guides/platform/database-size`} />
</div>
</span>
<DiskTypeRecommendationSection
diff --git a/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx b/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
index 3854b9ac829..6605631c78e 100644
--- a/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
+++ b/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
@@ -8,6 +8,7 @@ import CodeSnippet from 'components/interfaces/Docs/CodeSnippet'
import { DocsButton } from 'components/ui/DocsButton'
import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'
import { generateTypes } from 'data/projects/project-type-generation-query'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
interface Props {
@@ -43,7 +44,7 @@ export default function GeneratingTypes({ selectedLang }: Props) {
<>
<h2 className="doc-heading flex items-center justify-between">
<span>Generating types</span>
- <DocsButton href="https://supabase.com/docs/guides/database/api/generating-types" />
+ <DocsButton href={`${DOCS_URL}/guides/database/api/generating-types`} />
</h2>
<div className="doc-section">
<article className="code-column text-foreground">
@@ -53,10 +54,8 @@ export default function GeneratingTypes({ selectedLang }: Props) {
</p>
<p>
You can generate types from your database either through the{' '}
- <Link href="https://supabase.com/docs/guides/database/api/generating-types">
- Supabase CLI
- </Link>
- , or by downloading the types file via the button on the right and importing it in your
+ <Link href={`${DOCS_URL}/guides/database/api/generating-types`}>Supabase CLI</Link>, or
+ by downloading the types file via the button on the right and importing it in your
application within <code>src/index.ts</code>.
</p>
</article>
diff --git a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
index ff4ef5661eb..35a056b4a02 100644
--- a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
+++ b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router'
import { useParams } from 'common'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import { makeRandomString } from 'lib/helpers'
import CodeSnippet from '../CodeSnippet'
import Snippets from '../Snippets'
@@ -179,11 +180,7 @@ export const UserManagement = ({ selectedLang, showApiKey }: UserManagementProps
</p>
<p>
View all the available{' '}
- <a
- href="https://supabase.com/docs/guides/auth#providers"
- target="_blank"
- rel="noreferrer"
- >
+ <a href={`${DOCS_URL}/guides/auth#providers`} target="_blank" rel="noreferrer">
Third Party OAuth providers
</a>
</p>
diff --git a/apps/studio/components/interfaces/Docs/ResourceContent.tsx b/apps/studio/components/interfaces/Docs/ResourceContent.tsx
index cefe96e153c..610eb85c4dd 100644
--- a/apps/studio/components/interfaces/Docs/ResourceContent.tsx
+++ b/apps/studio/components/interfaces/Docs/ResourceContent.tsx
@@ -8,6 +8,7 @@ import Snippets from 'components/interfaces/Docs/Snippets'
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
import { useProjectJsonSchemaQuery } from 'data/docs/project-json-schema-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
interface ResourceContentProps {
apiEndpoint: string
@@ -120,7 +121,7 @@ const ResourceContent = ({
</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/select"
+ href={`${DOCS_URL}/reference/javascript/select`}
target="_blank"
rel="noreferrer"
>
@@ -157,7 +158,7 @@ const ResourceContent = ({
<p>Supabase provides a wide range of filters.</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/using-filters"
+ href={`${DOCS_URL}/reference/javascript/using-filters`}
target="_blank"
rel="noreferrer"
>
@@ -188,7 +189,7 @@ const ResourceContent = ({
</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/insert"
+ href={`${DOCS_URL}/reference/javascript/insert`}
target="_blank"
rel="noreferrer"
>
@@ -228,7 +229,7 @@ const ResourceContent = ({
</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/update"
+ href={`${DOCS_URL}/reference/javascript/update`}
target="_blank"
rel="noreferrer"
>
@@ -256,7 +257,7 @@ const ResourceContent = ({
</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/delete"
+ href={`${DOCS_URL}/reference/javascript/delete`}
target="_blank"
rel="noreferrer"
>
@@ -285,7 +286,7 @@ const ResourceContent = ({
</p>
<p>
<a
- href="https://supabase.com/docs/reference/javascript/subscribe"
+ href={`${DOCS_URL}/reference/javascript/subscribe`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
index d4b163cfee4..74aab28e1c1 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
@@ -19,6 +19,7 @@ import { useEdgeFunctionQuery } from 'data/edge-functions/edge-function-query'
import { useEdgeFunctionDeleteMutation } from 'data/edge-functions/edge-functions-delete-mutation'
import { useEdgeFunctionUpdateMutation } from 'data/edge-functions/edge-functions-update-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
@@ -378,7 +379,7 @@ export const EdgeFunctionDetails = () => {
icon={<ExternalLink strokeWidth={1.5} />}
>
<Link
- href="https://supabase.com/docs/guides/functions/dependencies"
+ href={`${DOCS_URL}/guides/functions/dependencies`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
index f2ac461b69a..a89cd1c85a0 100644
--- a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
+++ b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
@@ -11,6 +11,7 @@ import { ResourceList } from 'components/ui/Resource/ResourceList'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import {
AiIconAnimation,
@@ -236,7 +237,9 @@ export const FunctionsEmptyStateLocal = () => {
value="supabase functions new hello-world"
/>
</div>
- <DocsButton href="https://supabase.com/docs/guides/functions/local-quickstart#create-an-edge-function" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/functions/local-quickstart#create-an-edge-function`}
+ />
</div>
<div className="p-8">
@@ -259,7 +262,9 @@ supabase start # start the supabase stack
supabase functions serve # start the Functions watcher`.trim()}
/>
</div>
- <DocsButton href="https://supabase.com/docs/guides/functions/local-quickstart#running-edge-functions-locally" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/functions/local-quickstart#running-edge-functions-locally`}
+ />
</div>
<div className="p-8">
@@ -285,7 +290,9 @@ curl --request POST 'http://localhost:54321/functions/v1/hello-world' \\
--data '{ "name":"Functions" }'`.trim()}
/>
</div>
- <DocsButton href="https://supabase.com/docs/guides/functions/local-quickstart#invoking-edge-functions-locally" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/functions/local-quickstart#invoking-edge-functions-locally`}
+ />
</div>
</CardContent>
</Card>
@@ -306,7 +313,7 @@ curl --request POST 'http://localhost:54321/functions/v1/hello-world' \\
on providers like Fly.io, Digital Ocean, or AWS.
</p>
<div className="flex items-center gap-x-2">
- <DocsButton href="https://supabase.com/docs/reference/self-hosting-functions/introduction" />
+ <DocsButton href={`${DOCS_URL}/reference/self-hosting-functions/introduction`} />
<Button asChild type="default" icon={<Github />}>
<a href="https://github.com/supabase/edge-runtime/">GitHub</a>
</Button>
@@ -383,7 +390,7 @@ export const FunctionsSecretsEmptyStateLocal = () => {
</li>
</ul>
</div>
- <DocsButton href="https://supabase.com/docs/guides/functions/secrets#using-the-cli" />
+ <DocsButton href={`${DOCS_URL}/guides/functions/secrets#using-the-cli`} />
</div>
</CardContent>
</Card>
diff --git a/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx b/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx
index 363fd7c1056..edcd5584372 100644
--- a/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx
+++ b/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx
@@ -9,6 +9,7 @@ import { useAccessTokensQuery } from 'data/access-tokens/access-tokens-query'
import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
CollapsibleContent_Shadcn_,
@@ -140,7 +141,7 @@ export const TerminalInstructions = forwardRef<
</p>
</div>
<div className="flex gap-2">
- <DocsButton href="https://supabase.com/docs/guides/functions" />
+ <DocsButton href={`${DOCS_URL}/guides/functions`} />
<Button asChild type="default" icon={<ExternalLink />}>
<a
target="_blank"
diff --git a/apps/studio/components/interfaces/Home/Home.tsx b/apps/studio/components/interfaces/Home/Home.tsx
index eb61861c7b5..555019324c8 100644
--- a/apps/studio/components/interfaces/Home/Home.tsx
+++ b/apps/studio/components/interfaces/Home/Home.tsx
@@ -26,7 +26,7 @@ import {
useProjectByRefQuery,
useSelectedProjectQuery,
} from 'hooks/misc/useSelectedProject'
-import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
import { useAppStateSnapshot } from 'state/app-state'
import {
Badge,
@@ -127,7 +127,7 @@ export const Home = () => {
<TooltipContent side="bottom" align="start" className="max-w-80 text-center">
This project is using Postgres with OrioleDB which is currently in preview and
not suitable for production workloads. View our{' '}
- <InlineLink href="https://supabase.com/docs/guides/database/orioledb">
+ <InlineLink href={`${DOCS_URL}/guides/database/orioledb`}>
documentation
</InlineLink>{' '}
for all limitations.
diff --git a/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx b/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
index 9dff47b68a1..1cee26d7121 100644
--- a/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
+++ b/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
@@ -6,6 +6,7 @@ import Panel from 'components/ui/Panel'
import { EditorIndexPageLink } from 'data/prefetchers/project.$ref.editor'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { Auth, EdgeFunctions, Realtime, SqlEditor, Storage, TableEditor } from 'icons'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
import { APIKeys } from './APIKeys'
import { GetStartedHero } from './GetStartedHero'
@@ -51,11 +52,7 @@ export const NewProjectPanel = () => {
<Link href={`/project/${ref}/sql/new`}>SQL Editor</Link>
</Button>
<Button asChild type="default" icon={<ExternalLink />}>
- <Link
- href="https://supabase.com/docs/guides/database"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href={`${DOCS_URL}/guides/database`} target="_blank" rel="noreferrer">
About Database
</Link>
</Button>
@@ -100,11 +97,7 @@ export const NewProjectPanel = () => {
type="default"
asChild
>
- <Link
- href="https://supabase.com/docs/guides/auth"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href={`${DOCS_URL}/guides/auth`} target="_blank" rel="noreferrer">
About Auth
</Link>
</Button>
@@ -136,11 +129,7 @@ export const NewProjectPanel = () => {
type="default"
asChild
>
- <Link
- href="https://supabase.com/docs/guides/storage"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href={`${DOCS_URL}/guides/storage`} target="_blank" rel="noreferrer">
About Storage
</Link>
</Button>
@@ -173,7 +162,7 @@ export const NewProjectPanel = () => {
asChild
>
<Link
- href="https://supabase.com/docs/guides/functions"
+ href={`${DOCS_URL}/guides/functions`}
target="_blank"
rel="noreferrer"
>
@@ -206,11 +195,7 @@ export const NewProjectPanel = () => {
type="default"
asChild
>
- <Link
- href="https://supabase.com/docs/guides/realtime"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href={`${DOCS_URL}/guides/realtime`} target="_blank" rel="noreferrer">
About Realtime
</Link>
</Button>
@@ -229,7 +214,7 @@ export const NewProjectPanel = () => {
<h2>Connecting to your new project</h2>
<p className="text-base text-foreground-light lg:max-w-sm">
Interact with your database through the{' '}
- <Link href="https://supabase.com/docs/reference" className="text-brand">
+ <Link href={`${DOCS_URL}/reference`} className="text-brand">
Supabase client libraries
</Link>{' '}
with your API keys.
@@ -244,11 +229,7 @@ export const NewProjectPanel = () => {
<Link href={`/project/${ref}/settings/api`}>View API settings</Link>
</Button>
<Button asChild className="translate-y-[1px]" type="default" icon={<ExternalLink />}>
- <Link
- href="https://supabase.com/docs/guides/database/api"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href={`${DOCS_URL}/guides/database/api`} target="_blank" rel="noreferrer">
About APIs
</Link>
</Button>
diff --git a/apps/studio/components/interfaces/Home/ServiceStatus.tsx b/apps/studio/components/interfaces/Home/ServiceStatus.tsx
index 1481e45a357..a0c6dc343e4 100644
--- a/apps/studio/components/interfaces/Home/ServiceStatus.tsx
+++ b/apps/studio/components/interfaces/Home/ServiceStatus.tsx
@@ -13,6 +13,7 @@ import {
} from 'data/service-status/service-status-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
InfoIcon,
@@ -213,7 +214,7 @@ export const ServiceStatus = () => {
{
name: 'Edge Functions',
error: undefined,
- docsUrl: 'https://supabase.com/docs/guides/functions/troubleshooting',
+ docsUrl: `${DOCS_URL}/guides/functions/troubleshooting`,
isLoading,
isHealthy: !!edgeFunctionsStatus?.healthy,
status: edgeFunctionsStatus?.healthy
diff --git a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStartedSection.tsx b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStartedSection.tsx
index c567f0d3714..4771b751fb6 100644
--- a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStartedSection.tsx
+++ b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStartedSection.tsx
@@ -20,7 +20,7 @@ import { useTablesQuery } from 'data/tables/tables-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import {
AiIconAnimation,
@@ -167,7 +167,7 @@ export function GettingStartedSection({
actions: [
{
label: 'Create schema file',
- href: 'https://supabase.com/docs/guides/local-development/declarative-database-schemas',
+ href: `${DOCS_URL}/guides/local-development/declarative-database-schemas`,
variant: 'default',
},
{
@@ -192,7 +192,7 @@ export function GettingStartedSection({
actions: [
{
label: 'Create a seed file',
- href: 'https://supabase.com/docs/guides/local-development/seeding-your-database',
+ href: `${DOCS_URL}/guides/local-development/seeding-your-database`,
variant: 'default',
},
{
@@ -262,7 +262,7 @@ export function GettingStartedSection({
actions: [
{
label: 'Read docs',
- href: 'https://supabase.com/docs/guides/auth',
+ href: `${DOCS_URL}/guides/auth`,
variant: 'default',
},
],
@@ -426,7 +426,7 @@ export function GettingStartedSection({
actions: [
{
label: 'Read docs',
- href: 'https://supabase.com/docs/guides/auth',
+ href: `${DOCS_URL}/guides/auth`,
variant: 'default',
},
],
diff --git a/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx b/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
index 48cad4cd278..294aecd09b8 100644
--- a/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
+++ b/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
@@ -12,6 +12,7 @@ import {
} from 'data/service-status/service-status-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { InfoIcon, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, cn } from 'ui'
/**
@@ -200,7 +201,7 @@ export const ServiceStatus = () => {
{
name: 'Edge Functions',
error: undefined,
- docsUrl: 'https://supabase.com/docs/guides/functions/troubleshooting',
+ docsUrl: `${DOCS_URL}/guides/functions/troubleshooting`,
isLoading,
isHealthy: !!edgeFunctionsStatus?.healthy,
status: edgeFunctionsStatus?.healthy
diff --git a/apps/studio/components/interfaces/HomeNew/TopSection.tsx b/apps/studio/components/interfaces/HomeNew/TopSection.tsx
index 0d44224947a..ecdc0167b66 100644
--- a/apps/studio/components/interfaces/HomeNew/TopSection.tsx
+++ b/apps/studio/components/interfaces/HomeNew/TopSection.tsx
@@ -5,6 +5,7 @@ import { ProjectPausedState } from 'components/layouts/ProjectLayout/PausedState
import { ComputeBadgeWrapper } from 'components/ui/ComputeBadgeWrapper'
import { InlineLink } from 'components/ui/InlineLink'
import { ProjectUpgradeFailedBanner } from 'components/ui/ProjectUpgradeFailedBanner'
+import { DOCS_URL } from 'lib/constants'
import { ReactFlowProvider } from 'reactflow'
import { Badge, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import { InstanceConfiguration } from '../Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration'
@@ -54,7 +55,7 @@ export const TopSection = ({
<TooltipContent side="bottom" align="start" className="max-w-80 text-center">
This project is using Postgres with OrioleDB which is currently in preview and
not suitable for production workloads. View our{' '}
- <InlineLink href="https://supabase.com/docs/guides/database/orioledb">
+ <InlineLink href={`${DOCS_URL}/guides/database/orioledb`}>
documentation
</InlineLink>{' '}
for all limitations.
diff --git a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
index 2e10655b7f4..e95efa48267 100644
--- a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
+++ b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
@@ -4,7 +4,7 @@ import Image from 'next/image'
import { ComponentType, ReactNode } from 'react'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { cn } from 'ui'
import { UpgradeDatabaseAlert } from '../Queues/UpgradeDatabaseAlert'
import { WRAPPERS } from '../Wrappers/Wrappers.constants'
@@ -177,7 +177,7 @@ const supabaseIntegrations: IntegrationDefinition[] = [
<Vault className={cn('inset-0 p-2 text-black w-full h-full', className)} {...props} />
),
description: 'Application level encryption for your project',
- docsUrl: 'https://supabase.com/docs',
+ docsUrl: DOCS_URL,
author: authorSupabase,
navigation: [
{
@@ -221,7 +221,7 @@ const supabaseIntegrations: IntegrationDefinition[] = [
),
description:
'Send real-time data from your database to another system when a table event occurs',
- docsUrl: 'https://supabase.com/docs',
+ docsUrl: DOCS_URL,
author: authorSupabase,
requiredExtensions: [],
navigation: [
@@ -275,7 +275,7 @@ const supabaseIntegrations: IntegrationDefinition[] = [
/>
),
description: 'Run GraphQL queries through our interactive in-browser IDE',
- docsUrl: 'https://supabase.com/docs',
+ docsUrl: DOCS_URL,
author: authorSupabase,
navigation: [
{
diff --git a/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx b/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
index 7a0575c6da2..7c90a3ac264 100644
--- a/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
+++ b/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
@@ -10,6 +10,7 @@ import { DocsButton } from 'components/ui/DocsButton'
import { useVaultSecretsQuery } from 'data/vault/vault-secrets-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { VaultSecret } from 'types'
import {
Button,
@@ -127,7 +128,7 @@ export const SecretsManagement = () => {
>
Refresh
</Button>
- <DocsButton href="https://supabase.com/docs/guides/database/vault" />
+ <DocsButton href={`${DOCS_URL}/guides/database/vault`} />
<ButtonTooltip
type="primary"
disabled={!canManageSecrets}
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
index dad85cda513..e81d02e5069 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
@@ -1,4 +1,4 @@
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { CreateIcebergWrapperSheet } from './CreateIcebergWrapperSheet'
import type { ServerOption, WrapperMeta } from './Wrappers.types'
@@ -46,7 +46,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Payment processing and subscription management',
extensionName: 'StripeFdw',
label: 'Stripe',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/stripe',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/stripe`,
server: {
options: [
{
@@ -1213,7 +1213,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Backend-as-a-Service with real-time database',
extensionName: 'FirebaseFdw',
label: 'Firebase',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/firebase',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/firebase`,
server: {
options: [
{
@@ -1340,7 +1340,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Cloud object storage service',
extensionName: 'S3Fdw',
label: 'S3',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/s3',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/s3`,
server: {
options: [
{
@@ -1424,7 +1424,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Column-oriented analytics database',
extensionName: 'ClickHouseFdw',
label: 'ClickHouse',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/clickhouse',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/clickhouse`,
server: {
options: [
{
@@ -1469,7 +1469,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Serverless data warehouse and analytics',
extensionName: 'BigQueryFdw',
label: 'BigQuery',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/bigquery',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/bigquery`,
server: {
options: [
{
@@ -1544,7 +1544,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'No-code database and spreadsheet platform',
extensionName: 'airtableFdw',
label: 'Airtable',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/airtable',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/airtable`,
server: {
options: [
{
@@ -1587,7 +1587,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Log management and analytics service',
extensionName: 'logflareFdw',
label: 'Logflare',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/logflare',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/logflare`,
server: {
options: [
{
@@ -1623,7 +1623,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Identity and access management platform',
extensionName: 'Auth0Fdw',
label: 'Auth0',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/auth0',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/auth0`,
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1754,7 +1754,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'AWS user authentication and authorization',
extensionName: 'CognitoFdw',
label: 'Cognito',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/cognito',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/cognito`,
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1849,7 +1849,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Microsoft SQL Server database',
extensionName: 'mssqlFdw',
label: 'Microsoft SQL Server',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/mssql',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/mssql`,
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1886,7 +1886,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'In-memory data structure store',
extensionName: 'redisFdw',
label: 'Redis',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/redis',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/redis`,
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1969,7 +1969,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Subscription billing and payments platform',
extensionName: 'paddleFdw',
label: 'Paddle',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/paddle',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/paddle`,
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2070,7 +2070,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Cloud data warehouse platform',
extensionName: 'snowflakeFdw',
label: 'Snowflake',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/snowflake',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/snowflake`,
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2173,7 +2173,7 @@ export const WRAPPERS: WrapperMeta[] = [
description: 'Iceberg is a data warehouse',
extensionName: 'icebergFdw',
label: 'Iceberg',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/iceberg',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/iceberg`,
minimumExtensionVersion: '0.5.3',
createComponent: CreateIcebergWrapperSheet,
server: {
@@ -2259,7 +2259,7 @@ export const WRAPPERS: WrapperMeta[] = [
icon: `${BASE_PATH}/img/icons/cal-com-icon.svg`,
extensionName: 'calFdw',
label: 'Cal.com',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/cal',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/cal`,
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2466,7 +2466,7 @@ export const WRAPPERS: WrapperMeta[] = [
icon: `${BASE_PATH}/img/icons/calendly-icon.svg`,
extensionName: 'calendlyFdw',
label: 'Calendly',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/calendly',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/calendly`,
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2703,7 +2703,7 @@ export const WRAPPERS: WrapperMeta[] = [
icon: `${BASE_PATH}/img/icons/clerk-icon.svg`,
extensionName: 'clerkFdw',
label: 'Clerk',
- docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/clerk',
+ docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/clerk`,
minimumExtensionVersion: '0.4.0',
server: {
options: [
diff --git a/apps/studio/components/interfaces/Linter/LintDetail.tsx b/apps/studio/components/interfaces/Linter/LintDetail.tsx
index d499ac91e0f..d27463cf257 100644
--- a/apps/studio/components/interfaces/Linter/LintDetail.tsx
+++ b/apps/studio/components/interfaces/Linter/LintDetail.tsx
@@ -2,11 +2,12 @@ import Link from 'next/link'
import ReactMarkdown from 'react-markdown'
import { createLintSummaryPrompt, lintInfoMap } from 'components/interfaces/Linter/Linter.utils'
-import { EntityTypeIcon, LintCTA, LintCategoryBadge, LintEntity } from './Linter.utils'
import { Lint } from 'data/lint/lint-query'
+import { DOCS_URL } from 'lib/constants'
+import { ExternalLink } from 'lucide-react'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { AiIconAnimation, Button } from 'ui'
-import { ExternalLink } from 'lucide-react'
+import { EntityTypeIcon, LintCTA, LintEntity } from './Linter.utils'
interface LintDetailProps {
lint: Lint
@@ -54,7 +55,7 @@ const LintDetail = ({ lint, projectRef, onAskAssistant }: LintDetailProps) => {
<Link
href={
lintInfoMap.find((item) => item.name === lint.name)?.docsLink ||
- 'https://supabase.com/docs/guides/database/database-linter'
+ `${DOCS_URL}/guides/database/database-linter`
}
target="_blank"
rel="noreferrer"
diff --git a/apps/studio/components/interfaces/Linter/Linter.utils.tsx b/apps/studio/components/interfaces/Linter/Linter.utils.tsx
index 0b114eb79fc..84d512d441e 100644
--- a/apps/studio/components/interfaces/Linter/Linter.utils.tsx
+++ b/apps/studio/components/interfaces/Linter/Linter.utils.tsx
@@ -14,6 +14,7 @@ import Link from 'next/link'
import { LINTER_LEVELS, LintInfo } from 'components/interfaces/Linter/Linter.constants'
import { LINT_TYPES, Lint } from 'data/lint/lint-query'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Button } from 'ui'
export const lintInfoMap: LintInfo[] = [
@@ -24,8 +25,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/database/indexes?schema=${metadata?.schema}`,
linkText: 'Create an index',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0001_unindexed_foreign_keys',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0001_unindexed_foreign_keys`,
category: 'performance',
},
{
@@ -34,8 +34,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Lock className="text-foreground-muted" size={15} strokeWidth={1.5} />,
link: ({ projectRef }) => `/project/${projectRef}/editor`,
linkText: 'View table',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0002_auth_users_exposed',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0002_auth_users_exposed`,
category: 'security',
},
{
@@ -44,8 +43,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Table2 className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/policies`,
linkText: 'View policies',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0003_auth_rls_initplan',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0003_auth_rls_initplan`,
category: 'performance',
},
{
@@ -54,8 +52,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Table2 className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/editor`,
linkText: 'View table',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0004_no_primary_key',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0004_no_primary_key`,
category: 'performance',
},
{
@@ -65,8 +62,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/database/indexes?schema=${metadata?.schema}&table=${metadata?.name}`,
linkText: 'View index',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0005_unused_index',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0005_unused_index`,
category: 'performance',
},
{
@@ -76,8 +72,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/auth/policies?schema=${metadata?.schema}&search=${metadata?.name}`,
linkText: 'View policies',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0006_multiple_permissive_policies',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0006_multiple_permissive_policies`,
category: 'performance',
},
{
@@ -87,8 +82,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/auth/policies?schema=${metadata?.schema}&search=${metadata?.name}`,
linkText: 'View policies',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0007_policy_exists_rls_disabled',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0007_policy_exists_rls_disabled`,
category: 'security',
},
{
@@ -98,8 +92,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/auth/policies?schema=${metadata?.schema}&search=${metadata?.name}`,
linkText: 'View table',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0008_rls_enabled_no_policy',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0008_rls_enabled_no_policy`,
category: 'security',
},
{
@@ -109,8 +102,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/database/indexes?schema=${metadata?.schema}&table=${metadata?.name}`,
linkText: 'View index',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0009_duplicate_index',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0009_duplicate_index`,
category: 'performance',
},
{
@@ -118,10 +110,9 @@ export const lintInfoMap: LintInfo[] = [
title: 'Security Definer View',
icon: <Eye className="text-foreground-muted" size={15} strokeWidth={1.5} />,
link: () =>
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0010_security_definer_view',
+ `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0010_security_definer_view`,
linkText: 'View docs',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0010_security_definer_view',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0010_security_definer_view`,
category: 'security',
},
{
@@ -131,8 +122,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/database/functions?schema=${metadata?.schema}&search=${metadata?.name}`,
linkText: 'View functions',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0011_function_search_path_mutable',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0011_function_search_path_mutable`,
category: 'security',
},
{
@@ -142,8 +132,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/auth/policies?schema=${metadata?.schema}&search=${metadata?.name}`,
linkText: 'View policies',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0013_rls_disabled_in_public',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0013_rls_disabled_in_public`,
category: 'security',
},
{
@@ -153,8 +142,7 @@ export const lintInfoMap: LintInfo[] = [
link: ({ projectRef, metadata }) =>
`/project/${projectRef}/database/extensions?filter=${metadata?.name}`,
linkText: 'View extension',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0014_extension_in_public',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0014_extension_in_public`,
category: 'security',
},
{
@@ -163,7 +151,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Clock className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/providers`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/going-into-prod#security',
+ docsLink: `${DOCS_URL}/guides/platform/going-into-prod#security`,
category: 'security',
},
{
@@ -172,7 +160,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Ruler className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/providers`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/going-into-prod#security',
+ docsLink: `${DOCS_URL}/guides/platform/going-into-prod#security`,
category: 'security',
},
{
@@ -181,30 +169,25 @@ export const lintInfoMap: LintInfo[] = [
icon: <User className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/policies`,
linkText: 'View policies',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?queryGroups=lint&lint=0015_rls_references_user_metadata',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?queryGroups=lint&lint=0015_rls_references_user_metadata`,
category: 'security',
},
{
name: 'materialized_view_in_api',
title: 'Materialized View in API',
icon: <Eye className="text-foreground-muted" size={15} strokeWidth={1.5} />,
- link: () =>
- `https://supabase.com/docs/guides/database/database-advisors?lint=0016_materialized_view_in_api`,
+ link: () => `${DOCS_URL}/guides/database/database-advisors?lint=0016_materialized_view_in_api`,
linkText: 'View docs',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-advisors?lint=0016_materialized_view_in_api',
+ docsLink: `${DOCS_URL}/guides/database/database-advisors?lint=0016_materialized_view_in_api`,
category: 'security',
},
{
name: 'foreign_table_in_api',
title: 'Foreign Table in API',
icon: <Table2 className="text-foreground-muted" size={15} strokeWidth={1.5} />,
- link: () =>
- `https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api`,
+ link: () => `${DOCS_URL}/guides/database/database-linter?lint=0017_foreign_table_in_api`,
linkText: 'View docs',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api',
+ docsLink: `${DOCS_URL}/guides/database/database-linter?lint=0017_foreign_table_in_api`,
category: 'security',
},
{
@@ -212,10 +195,9 @@ export const lintInfoMap: LintInfo[] = [
title: 'Unsupported reg types',
icon: <Table2 className="text-foreground-muted" size={15} strokeWidth={1.5} />,
link: () =>
- `https://supabase.com/docs/guides/database/database-advisors?lint=0018_unsupported_reg_types&queryGroups=lint`,
+ `${DOCS_URL}/guides/database/database-advisors?lint=0018_unsupported_reg_types&queryGroups=lint`,
linkText: 'View docs',
- docsLink:
- 'https://supabase.com/docs/guides/database/database-advisors?lint=0018_unsupported_reg_types&queryGroups=lint',
+ docsLink: `${DOCS_URL}/guides/database/database-advisors?lint=0018_unsupported_reg_types&queryGroups=lint`,
category: 'security',
},
{
@@ -224,7 +206,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Ruler className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/database/settings`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/ssl-enforcement',
+ docsLink: `${DOCS_URL}/guides/platform/ssl-enforcement`,
category: 'security',
},
{
@@ -233,7 +215,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Ruler className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/database/settings`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/network-restrictions',
+ docsLink: `${DOCS_URL}/guides/platform/network-restrictions`,
category: 'security',
},
{
@@ -242,7 +224,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Ruler className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/providers?provider=Email`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/going-into-prod#security',
+ docsLink: `${DOCS_URL}/guides/platform/going-into-prod#security`,
category: 'security',
},
{
@@ -251,7 +233,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <Ruler className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/database/backups/pitr`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/backups#point-in-time-recovery',
+ docsLink: `${DOCS_URL}/guides/platform/backups#point-in-time-recovery`,
category: 'security',
},
{
@@ -260,8 +242,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/providers?provider=Email`,
linkText: 'View settings',
- docsLink:
- 'https://supabase.com/docs/guides/auth/password-security#password-strength-and-leaked-password-protection',
+ docsLink: `${DOCS_URL}/guides/auth/password-security#password-strength-and-leaked-password-protection`,
category: 'security',
},
{
@@ -270,7 +251,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/mfa`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/auth/auth-mfa',
+ docsLink: `${DOCS_URL}/guides/auth/auth-mfa`,
category: 'security',
},
{
@@ -279,7 +260,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/providers?provider=Email`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/auth/password-security',
+ docsLink: `${DOCS_URL}/guides/auth/password-security`,
category: 'security',
},
{
@@ -288,7 +269,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/settings/api`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/api/api-keys#the-servicerole-key',
+ docsLink: `${DOCS_URL}/guides/api/api-keys#the-servicerole-key`,
category: 'security',
},
{
@@ -297,7 +278,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/auth/mfa`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/auth/auth-mfa',
+ docsLink: `${DOCS_URL}/guides/auth/auth-mfa`,
category: 'security',
},
{
@@ -306,7 +287,7 @@ export const lintInfoMap: LintInfo[] = [
icon: <LockIcon className="text-foreground-muted" size={15} strokeWidth={1} />,
link: ({ projectRef }) => `/project/${projectRef}/settings/infrastructure`,
linkText: 'View settings',
- docsLink: 'https://supabase.com/docs/guides/platform/upgrading',
+ docsLink: `${DOCS_URL}/guides/platform/upgrading`,
category: 'security',
},
]
diff --git a/apps/studio/components/interfaces/Linter/LinterPageFooter.tsx b/apps/studio/components/interfaces/Linter/LinterPageFooter.tsx
index 76bb8b6a3d1..8601f60fafc 100644
--- a/apps/studio/components/interfaces/Linter/LinterPageFooter.tsx
+++ b/apps/studio/components/interfaces/Linter/LinterPageFooter.tsx
@@ -1,6 +1,7 @@
-import { X } from 'lucide-react'
import { LOCAL_STORAGE_KEYS } from 'common'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
+import { DOCS_URL } from 'lib/constants'
+import { X } from 'lucide-react'
import { Button, cn } from 'ui'
import { Markdown } from '../Markdown'
@@ -75,8 +76,8 @@ const LinterPageFooter = ({
<p>Inspect your database for potential issues</p>
<Markdown
className="text-xs"
- content="The Supabase CLI comes with a range of tools to help inspect your Postgres instances for
- potential issues. [Learn more here](https://supabase.com/docs/guides/database/inspect)."
+ content={`The Supabase CLI comes with a range of tools to help inspect your Postgres instances for
+ potential issues. [Learn more here](${DOCS_URL}/guides/database/inspect).`}
/>
</div>
)}
diff --git a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
index 5bffac5f3cd..6596c861070 100644
--- a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
+++ b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
@@ -6,9 +6,9 @@ import { toast } from 'sonner'
import { z } from 'zod'
import { useParams } from 'common'
-import { LogDrainData, useLogDrainsQuery } from 'data/log-drains/log-drains-query'
-
import { DocsButton } from 'components/ui/DocsButton'
+import { LogDrainData, useLogDrainsQuery } from 'data/log-drains/log-drains-query'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
Form_Shadcn_,
@@ -533,7 +533,7 @@ export function LogDrainDestinationSheetForm({
<DocsButton
abbrev={false}
className="w-min"
- href="https://supabase.com/docs/guides/platform/log-drains"
+ href={`${DOCS_URL}/guides/platform/log-drains`}
/>
</div>
}
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
index 2b1150e1ace..95b8b36bf29 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
@@ -1,4 +1,5 @@
import { PricingMetric } from 'data/analytics/org-daily-stats-query'
+import { DOCS_URL } from 'lib/constants'
export const USAGE_APPROACHING_THRESHOLD = 0.8
@@ -111,7 +112,7 @@ export const BILLING_BREAKDOWN_METRICS: Metric[] = [
tip: 'Each project gets provisioned with 8 GB of GP3 disk for free. When you get close to the disk size limit, we autoscale your disk by 1.5x. Each GB of provisioned disk size beyond 8 GB incurs a GB-Hr every hour. Each extra GB is billed at $0.125/month ($0.000171/GB-Hr), prorated down to the hour.',
docLink: {
title: 'Read more',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-size',
+ url: `${DOCS_URL}/guides/platform/manage-your-usage/disk-size`,
},
},
{
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
index df14738bfd7..a57b997751d 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx
@@ -2,6 +2,7 @@ import Link from 'next/link'
import { ComputeUsageMetric, PricingMetric } from 'data/analytics/org-daily-stats-query'
import type { OrgUsageResponse } from 'data/usage/org-usage-query'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { ChevronRight } from 'lucide-react'
import { useMemo } from 'react'
@@ -74,7 +75,7 @@ export const ComputeMetric = ({
Each Preview branch is a separate environment with all Supabase services (Database,
Auth, Storage, etc.).{' '}
<Link
- href="https://supabase.com/docs/guides/platform/manage-your-usage/branching"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/branching`}
target="_blank"
className="transition text-brand hover:text-brand-600 underline"
>
@@ -87,7 +88,7 @@ export const ComputeMetric = ({
active, it incurs compute costs based on the compute size of your project. Paused
projects do not incur compute costs.{' '}
<Link
- href="https://supabase.com/docs/guides/platform/manage-your-usage/compute"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
className="transition text-brand hover:text-brand-600 underline"
>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/UpcomingInvoice.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/UpcomingInvoice.tsx
index e9b43d2dc65..b11a717a703 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/UpcomingInvoice.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/UpcomingInvoice.tsx
@@ -2,70 +2,50 @@ import Link from 'next/link'
import AlertError from 'components/ui/AlertError'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
+import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import {
UpcomingInvoiceResponse,
useOrgUpcomingInvoiceQuery,
} from 'data/invoices/org-invoice-upcoming-query'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
+import React from 'react'
import { Table, TableBody, TableCell, TableFooter, TableRow } from 'ui'
-import { billingMetricUnit, formatUsage } from '../helpers'
import { InfoTooltip } from 'ui-patterns/info-tooltip'
-import { PricingMetric } from 'data/analytics/org-daily-stats-query'
-import _ from 'lodash'
-import React from 'react'
+import { billingMetricUnit, formatUsage } from '../helpers'
export interface UpcomingInvoiceProps {
slug?: string
}
const usageBillingDocsLink: { [K in PricingMetric]?: string } = {
- [PricingMetric.MONTHLY_ACTIVE_USERS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/monthly-active-users',
- [PricingMetric.MONTHLY_ACTIVE_SSO_USERS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/monthly-active-users-sso',
- [PricingMetric.MONTHLY_ACTIVE_THIRD_PARTY_USERS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/monthly-active-users-third-party',
- [PricingMetric.AUTH_MFA_PHONE]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/advanced-mfa-phone',
-
- [PricingMetric.EGRESS]: 'https://supabase.com/docs/guides/platform/manage-your-usage/egress',
- [PricingMetric.CACHED_EGRESS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/egress',
-
- [PricingMetric.FUNCTION_INVOCATIONS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/edge-function-invocations',
-
- [PricingMetric.STORAGE_SIZE]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/storage-size',
- [PricingMetric.STORAGE_IMAGES_TRANSFORMED]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/storage-image-transformations',
-
- [PricingMetric.REALTIME_MESSAGE_COUNT]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/realtime-messages',
- [PricingMetric.REALTIME_PEAK_CONNECTIONS]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/realtime-peak-connections',
-
- [PricingMetric.CUSTOM_DOMAIN]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/custom-domains',
- [PricingMetric.IPV4]: 'https://supabase.com/docs/guides/platform/manage-your-usage/ipv4',
- [PricingMetric.PITR_7]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/point-in-time-recovery',
- [PricingMetric.PITR_14]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/point-in-time-recovery',
- [PricingMetric.PITR_28]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/point-in-time-recovery',
- [PricingMetric.DISK_SIZE_GB_HOURS_GP3]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-size',
- [PricingMetric.DISK_SIZE_GB_HOURS_IO2]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-size',
- [PricingMetric.DISK_IOPS_GP3]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-iops',
- [PricingMetric.DISK_IOPS_IO2]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-iops',
- [PricingMetric.DISK_THROUGHPUT_GP3]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-throughput',
- [PricingMetric.LOG_DRAIN]:
- 'https://supabase.com/docs/guides/platform/manage-your-usage/log-drains',
+ [PricingMetric.MONTHLY_ACTIVE_USERS]: `${DOCS_URL}/guides/platform/manage-your-usage/monthly-active-users`,
+ [PricingMetric.MONTHLY_ACTIVE_SSO_USERS]: `${DOCS_URL}/guides/platform/manage-your-usage/monthly-active-users-sso`,
+ [PricingMetric.MONTHLY_ACTIVE_THIRD_PARTY_USERS]: `${DOCS_URL}/guides/platform/manage-your-usage/monthly-active-users-third-party`,
+ [PricingMetric.AUTH_MFA_PHONE]: `${DOCS_URL}/guides/platform/manage-your-usage/advanced-mfa-phone`,
+
+ [PricingMetric.EGRESS]: `${DOCS_URL}/guides/platform/manage-your-usage/egress`,
+ [PricingMetric.CACHED_EGRESS]: `${DOCS_URL}/guides/platform/manage-your-usage/egress`,
+
+ [PricingMetric.FUNCTION_INVOCATIONS]: `${DOCS_URL}/guides/platform/manage-your-usage/edge-function-invocations`,
+
+ [PricingMetric.STORAGE_SIZE]: `${DOCS_URL}/guides/platform/manage-your-usage/storage-size`,
+ [PricingMetric.STORAGE_IMAGES_TRANSFORMED]: `${DOCS_URL}/guides/platform/manage-your-usage/storage-image-transformations`,
+
+ [PricingMetric.REALTIME_MESSAGE_COUNT]: `${DOCS_URL}/guides/platform/manage-your-usage/realtime-messages`,
+ [PricingMetric.REALTIME_PEAK_CONNECTIONS]: `${DOCS_URL}/guides/platform/manage-your-usage/realtime-peak-connections`,
+
+ [PricingMetric.CUSTOM_DOMAIN]: `${DOCS_URL}/guides/platform/manage-your-usage/custom-domains`,
+ [PricingMetric.IPV4]: `${DOCS_URL}/guides/platform/manage-your-usage/ipv4`,
+ [PricingMetric.PITR_7]: `${DOCS_URL}/guides/platform/manage-your-usage/point-in-time-recovery`,
+ [PricingMetric.PITR_14]: `${DOCS_URL}/guides/platform/manage-your-usage/point-in-time-recovery`,
+ [PricingMetric.PITR_28]: `${DOCS_URL}/guides/platform/manage-your-usage/point-in-time-recovery`,
+ [PricingMetric.DISK_SIZE_GB_HOURS_GP3]: `${DOCS_URL}/guides/platform/manage-your-usage/disk-size`,
+ [PricingMetric.DISK_SIZE_GB_HOURS_IO2]: `${DOCS_URL}/guides/platform/manage-your-usage/disk-size`,
+ [PricingMetric.DISK_IOPS_GP3]: `${DOCS_URL}/guides/platform/manage-your-usage/disk-iops`,
+ [PricingMetric.DISK_IOPS_IO2]: `${DOCS_URL}/guides/platform/manage-your-usage/disk-iops`,
+ [PricingMetric.DISK_THROUGHPUT_GP3]: `${DOCS_URL}/guides/platform/manage-your-usage/disk-throughput`,
+ [PricingMetric.LOG_DRAIN]: `${DOCS_URL}/guides/platform/manage-your-usage/log-drains`,
}
const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
@@ -147,7 +127,7 @@ const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
compute costs starting at <span translate="no">$10</span>/month, independent
of activity. See{' '}
<Link
- href={'https://supabase.com/docs/guides/platform/manage-your-usage/compute'}
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
>
docs
@@ -167,9 +147,7 @@ const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
Compute, Disk Size, provisioned Disk IOPS, provisioned Disk Throughput, and
IPv4. See{' '}
<Link
- href={
- 'https://supabase.com/docs/guides/platform/manage-your-usage/read-replicas'
- }
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/read-replicas`}
target="_blank"
>
docs
@@ -200,9 +178,7 @@ const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
See{' '}
<Link
className="underline"
- href={
- 'https://supabase.com/docs/guides/platform/manage-your-usage/branching'
- }
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/branching`}
target="_blank"
>
docs
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
index 652d7960555..edf665e233e 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/CostControl.tsx
@@ -12,17 +12,16 @@ import {
} from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
import NoPermission from 'components/ui/NoPermission'
+import PartnerIcon from 'components/ui/PartnerIcon'
import { PARTNER_TO_NAME } from 'components/ui/PartnerManagedResource'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { MANAGED_BY } from 'lib/constants/infrastructure'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
import { Alert, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
-
-import PartnerIcon from 'components/ui/PartnerIcon'
import ProjectUpdateDisabledTooltip from '../ProjectUpdateDisabledTooltip'
import SpendCapSidePanel from './SpendCapSidePanel'
@@ -78,7 +77,7 @@ const CostControl = ({}: CostControlProps) => {
<p className="text-sm text-foreground-light m-0">More information</p>
<div>
<Link
- href="https://supabase.com/docs/guides/platform/cost-control#spend-cap"
+ href={`${DOCS_URL}/guides/platform/cost-control#spend-cap`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/SpendCapSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/SpendCapSidePanel.tsx
index 367a5480ec6..6051d14608b 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/SpendCapSidePanel.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/CostControl/SpendCapSidePanel.tsx
@@ -10,7 +10,7 @@ import Table from 'components/to-be-cleaned/Table'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscription-update-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import { BASE_PATH, PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
+import { BASE_PATH, DOCS_URL, PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
import { ChevronRight, ExternalLink } from 'lucide-react'
import { pricing } from 'shared-data/pricing'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
@@ -108,7 +108,7 @@ const SpendCapSidePanel = () => {
<h4>Spend cap</h4>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/platform/cost-control#spend-cap"
+ href={`${DOCS_URL}/guides/platform/cost-control#spend-cap`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
index a072b253996..0fdb42bc948 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
@@ -6,6 +6,7 @@ import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import { VIOLATION_TYPE_LABELS } from 'data/usage/constants'
import { useOrgUsageQuery } from 'data/usage/org-usage-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { usePathname } from 'next/navigation'
import {
AlertDescription_Shadcn_,
@@ -94,9 +95,7 @@ export const Restriction = () => {
</Button>
)}
<Button asChild type="default" icon={<ExternalLink />}>
- <a href="https://supabase.com/docs/guides/platform/cost-control#spend-cap">
- About spend cap
- </a>
+ <a href={`${DOCS_URL}/guides/platform/cost-control#spend-cap`}>About spend cap</a>
</Button>
</div>
</AlertDescription_Shadcn_>
@@ -139,7 +138,7 @@ export const Restriction = () => {
)}
<Button asChild type="default" icon={<ExternalLink />}>
- <a href="https://supabase.com/docs/guides/platform/billing-faq#fair-use-policy">
+ <a href={`${DOCS_URL}/guides/platform/billing-faq#fair-use-policy`}>
About Fair Use Policy
</a>
</Button>
@@ -179,7 +178,7 @@ export const Restriction = () => {
</Button>
)}
<Button asChild type="default" icon={<ExternalLink />}>
- <a href="https://supabase.com/docs/guides/platform/billing-faq#fair-use-policy">
+ <a href={`${DOCS_URL}/guides/platform/billing-faq#fair-use-policy`}>
About Fair Use Policy
</a>
</Button>
@@ -217,7 +216,7 @@ export const Restriction = () => {
</Button>
)}
<Button asChild type="default" icon={<ExternalLink />}>
- <a href="https://supabase.com/docs/guides/platform/billing-faq#fair-use-policy">
+ <a href={`${DOCS_URL}/guides/platform/billing-faq#fair-use-policy`}>
About Fair Use Policy
</a>
</Button>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx
index 279e1240dcf..ebce8bcb1be 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx
@@ -19,7 +19,12 @@ import { useConfirmPendingSubscriptionChangeMutation } from 'data/subscriptions/
import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscription-update-mutation'
import { SubscriptionTier } from 'data/subscriptions/types'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
-import { PRICING_TIER_PRODUCT_IDS, PROJECT_STATUS, STRIPE_PUBLIC_KEY } from 'lib/constants'
+import {
+ DOCS_URL,
+ PRICING_TIER_PRODUCT_IDS,
+ PROJECT_STATUS,
+ STRIPE_PUBLIC_KEY,
+} from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useTheme } from 'next-themes'
import { plans as subscriptionsPlans } from 'shared-data/plans'
@@ -351,9 +356,7 @@ export const SubscriptionPlanUpdateDialog = ({
Credits; additional projects start at <span translate="no">$10</span>
/month regardless of usage.{' '}
<Link
- href={
- 'https://supabase.com/docs/guides/platform/manage-your-usage/compute'
- }
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
>
Learn more
@@ -589,7 +592,7 @@ export const SubscriptionPlanUpdateDialog = ({
/month regardless of usage.{' '}
</div>
<Link
- href={'https://supabase.com/docs/guides/platform/manage-your-usage/compute'}
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
className="underline"
>
diff --git a/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceCreateNewOrg.tsx b/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceCreateNewOrg.tsx
index e9c9a2b7a9f..d07d7a2db4b 100644
--- a/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceCreateNewOrg.tsx
+++ b/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceCreateNewOrg.tsx
@@ -1,20 +1,22 @@
-import { useAwsManagedOrganizationCreateMutation } from '../../../../data/organizations/organization-create-mutation'
-import { toast } from 'sonner'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
import { SubmitHandler } from 'react-hook-form'
-import NewAwsMarketplaceOrgForm, {
- CREATE_AWS_MANAGED_ORG_FORM_ID,
- NewMarketplaceOrgForm,
-} from './NewAwsMarketplaceOrgForm'
+import { toast } from 'sonner'
+
+import { useAwsManagedOrganizationCreateMutation } from 'data/organizations/organization-create-mutation'
+import { DOCS_URL } from 'lib/constants'
+import { Button } from 'ui'
import {
ScaffoldSection,
ScaffoldSectionContent,
ScaffoldSectionDetail,
} from '../../../layouts/Scaffold'
-import Link from 'next/link'
-import { Button } from 'ui'
-import { useRouter } from 'next/router'
import AwsMarketplaceAutoRenewalWarning from './AwsMarketplaceAutoRenewalWarning'
import { CloudMarketplaceOnboardingInfo } from './cloud-marketplace-query'
+import NewAwsMarketplaceOrgForm, {
+ CREATE_AWS_MANAGED_ORG_FORM_ID,
+ NewMarketplaceOrgForm,
+} from './NewAwsMarketplaceOrgForm'
interface Props {
onboardingInfo?: CloudMarketplaceOnboardingInfo | undefined
@@ -61,11 +63,7 @@ const AwsMarketplaceCreateNewOrg = ({ onboardingInfo }: Props) => {
<p>
You can read more on billing through AWS in our {''}
{/*TODO(thomas): Update docs link once the new docs exist*/}
- <Link
- href="https://supabase.com/docs/guides/platform"
- target="_blank"
- className="underline"
- >
+ <Link href={`${DOCS_URL}/guides/platform`} target="_blank" className="underline">
Billing Docs.
</Link>
</p>
diff --git a/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceLinkExistingOrg.tsx b/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceLinkExistingOrg.tsx
index 7b25463cd94..8baf88672b2 100644
--- a/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceLinkExistingOrg.tsx
+++ b/apps/studio/components/interfaces/Organization/CloudMarketplace/AwsMarketplaceLinkExistingOrg.tsx
@@ -1,5 +1,4 @@
import { zodResolver } from '@hookform/resolvers/zod'
-import { RadioGroupCard, RadioGroupCardItem } from '@ui/components/radio-group-card'
import { cn } from '@ui/lib/utils'
import { Boxes, ChevronRight } from 'lucide-react'
import Link from 'next/link'
@@ -7,6 +6,13 @@ import { useRouter } from 'next/router'
import { useMemo, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
import { toast } from 'sonner'
+import { z } from 'zod'
+
+import { RadioGroupCard, RadioGroupCardItem } from '@ui/components/radio-group-card'
+import { useOrganizationLinkAwsMarketplaceMutation } from 'data/organizations/organization-link-aws-marketplace-mutation'
+import { useProjectsQuery } from 'data/projects/projects-query'
+import { DOCS_URL } from 'lib/constants'
+import { Organization } from 'types'
import {
Button,
Collapsible_Shadcn_,
@@ -17,10 +23,6 @@ import {
Skeleton,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
-import { z } from 'zod'
-import { useOrganizationLinkAwsMarketplaceMutation } from '../../../../data/organizations/organization-link-aws-marketplace-mutation'
-import { useProjectsQuery } from '../../../../data/projects/projects-query'
-import { Organization } from '../../../../types'
import {
ScaffoldSection,
ScaffoldSectionContent,
@@ -139,11 +141,7 @@ const AwsMarketplaceLinkExistingOrg = ({
<p>
You can read more on billing through AWS in our {''}
{/*TODO(thomas): Update docs link once the new docs exist*/}
- <Link
- href="https://supabase.com/docs/guides/platform"
- target="_blank"
- className="underline"
- >
+ <Link href={`${DOCS_URL}/guides/platform`} target="_blank" className="underline">
Billing Docs.
</Link>
</p>
diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthSecrets/OAuthSecrets.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthSecrets/OAuthSecrets.tsx
index 5cc983beeb9..2a770aa08ff 100644
--- a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthSecrets/OAuthSecrets.tsx
+++ b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthSecrets/OAuthSecrets.tsx
@@ -8,6 +8,7 @@ import { useClientSecretCreateMutation } from 'data/oauth-secrets/client-secret-
import { CreatedSecret, useClientSecretsQuery } from 'data/oauth-secrets/client-secrets-query'
import { OAuthApp } from 'data/oauth/oauth-apps-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import { Alert_Shadcn_, AlertTitle_Shadcn_, InfoIcon } from 'ui'
import { SecretRow } from './SecretRow'
@@ -42,7 +43,9 @@ export const OAuthSecrets = ({ selectedApp }: Props) => {
<span className="text-sm text-foreground">Client secrets</span>
<span className="text-sm text-foreground-light">
For handling callbacks in the OAuth 2.0 flow. Learn more{' '}
- <InlineLink href="https://supabase.com/docs/guides/integrations/build-a-supabase-integration#handling-the-callback">
+ <InlineLink
+ href={`${DOCS_URL}/guides/integrations/build-a-supabase-integration#handling-the-callback`}
+ >
here
</InlineLink>
.
diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx
index 3da24607846..287f8ec0b94 100644
--- a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx
+++ b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx
@@ -11,6 +11,7 @@ import {
} from 'data/oauth/oauth-app-create-mutation'
import { useOAuthAppUpdateMutation } from 'data/oauth/oauth-app-update-mutation'
import type { OAuthApp } from 'data/oauth/oauth-apps-query'
+import { DOCS_URL } from 'lib/constants'
import { isValidHttpUrl, uuidv4 } from 'lib/helpers'
import { uploadAttachment } from 'lib/upload'
import {
@@ -349,7 +350,7 @@ export const PublishAppSidePanel = ({
projects.
</span>
</div>
- <DocsButton href="https://supabase.com/docs/guides/platform/oauth-apps/oauth-scopes" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/oauth-apps/oauth-scopes`} />
</div>
<ScopesPanel scopes={scopes} setScopes={setScopes} />
diff --git a/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx b/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
index 66d036610fe..3d8359288c8 100644
--- a/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
+++ b/apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx
@@ -12,6 +12,7 @@ import { useSSOConfigCreateMutation } from 'data/sso/sso-config-create-mutation'
import { useOrgSSOConfigQuery } from 'data/sso/sso-config-query'
import { useSSOConfigUpdateMutation } from 'data/sso/sso-config-update-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -219,7 +220,7 @@ export const SSOConfig = () => {
Enable and configure SSO for your organization. Learn more about SSO{' '}
<InlineLink
className="text-foreground-lighter hover:text-foreground"
- href="https://supabase.com/docs/guides/platform/sso"
+ href={`${DOCS_URL}/guides/platform/sso`}
>
here
</InlineLink>
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
index a1c756df52d..8c420f75008 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx
@@ -17,6 +17,7 @@ import { useHasAccessToProjectLevelPermissions } from 'data/subscriptions/org-su
import { doPermissionsCheck, useGetPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { useProfile } from 'lib/profile'
import {
Button,
@@ -300,7 +301,7 @@ export const InviteMemberButton = () => {
<div className="flex items-center space-x-2">
<Button asChild type="default">
<Link
- href="https://supabase.com/docs/guides/platform/sso"
+ href={`${DOCS_URL}/guides/platform/sso`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
index 22b3d069982..379997d2a07 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
@@ -5,22 +5,23 @@ import AlertError from 'components/ui/AlertError'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useOrganizationRolesV2Query } from 'data/organization-members/organization-roles-query'
import { useOrganizationMembersQuery } from 'data/organizations/organization-members-query'
+import { DOCS_URL } from 'lib/constants'
import { useProfile } from 'lib/profile'
import { partition } from 'lodash'
import { useMemo } from 'react'
import {
Button,
+ Card,
Loading,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
Table,
- TableHeader,
- TableHead,
TableBody,
TableCell,
+ TableHead,
+ TableHeader,
TableRow,
- Card,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
} from 'ui'
import { Admonition } from 'ui-patterns'
import { MemberRow } from './MemberRow'
@@ -108,7 +109,7 @@ const MembersView = ({ searchString }: MembersViewProps) => {
<a
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/platform/access-control"
+ href={`${DOCS_URL}/guides/platform/access-control`}
>
<HelpCircle size={14} className="text-foreground-light" />
</a>
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
index 7df15972893..a14897c219c 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
@@ -10,6 +10,7 @@ import {
ScaffoldTitle,
} from 'components/layouts/Scaffold'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { Input } from 'ui-patterns/DataInputs/Input'
import { InviteMemberButton } from './InviteMemberButton'
import MembersView from './MembersView'
@@ -33,7 +34,7 @@ export const TeamSettings = () => {
placeholder="Filter members"
/>
<ScaffoldActionsGroup className="w-full md:w-auto">
- <DocsButton href="https://supabase.com/docs/guides/platform/access-control" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/access-control`} />
<InviteMemberButton />
</ScaffoldActionsGroup>
</ScaffoldActionsContainer>
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesPanel.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesPanel.tsx
index 0ba9e50848d..26aae79d3bf 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesPanel.tsx
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesPanel.tsx
@@ -11,6 +11,7 @@ import { usePermissionsQuery } from 'data/permissions/permissions-query'
import { useProjectsQuery } from 'data/projects/projects-query'
import { useHasAccessToProjectLevelPermissions } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -186,7 +187,7 @@ export const UpdateRolesPanel = ({ visible, member, onClose }: UpdateRolesPanelP
<p className="truncate" title={`Manage access for ${member.username}`}>
Manage access for {member.username}
</p>
- <DocsButton href="https://supabase.com/docs/guides/platform/access-control" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/access-control`} />
</SheetHeader>
<SheetSection className="h-full overflow-auto flex flex-col gap-y-4">
diff --git a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
index 581f0ed11dd..778c3d117d8 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx
@@ -9,6 +9,7 @@ import { useOrgDailyComputeStatsQuery } from 'data/analytics/org-daily-compute-s
import { ComputeUsageMetric, computeUsageMetricLabel } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import { SectionContent } from './SectionContent'
import { Attribute, AttributeColor } from './Usage.constants'
import UsageBarChart from './UsageBarChart'
@@ -86,11 +87,11 @@ const Compute = ({ orgSlug, projectRef, startDate, endDate }: ComputeProps) => {
? [
{
name: 'Compute Add-ons',
- url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
+ url: `${DOCS_URL}/guides/platform/compute-add-ons`,
},
{
name: 'Usage-billing for Compute',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/compute',
+ url: `${DOCS_URL}/guides/platform/manage-your-usage/compute`,
},
]
: [],
diff --git a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
index aa0e359d484..733b78daf40 100644
--- a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx
@@ -11,6 +11,7 @@ import {
import type { OrgSubscription } from 'data/subscriptions/types'
import { useOrgUsageQuery } from 'data/usage/org-usage-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import { cn } from 'ui'
import { BILLING_BREAKDOWN_METRICS } from '../BillingSettings/BillingBreakdown/BillingBreakdown.constants'
import { BillingMetric } from '../BillingSettings/BillingBreakdown/BillingMetric'
@@ -125,7 +126,7 @@ export const TotalUsage = ({
? [
{
name: 'How billing works',
- url: 'https://supabase.com/docs/guides/platform/billing-on-supabase',
+ url: `${DOCS_URL}/guides/platform/billing-on-supabase`,
},
{
name: 'Supabase Plans',
diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
index cb8b9c370e6..d80405ead4c 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
@@ -2,6 +2,7 @@ import { USAGE_APPROACHING_THRESHOLD } from 'components/interfaces/Billing/Billi
import { EgressType, PricingMetric } from 'data/analytics/org-daily-stats-query'
import type { OrgSubscription } from 'data/subscriptions/types'
import type { OrgUsageResponse } from 'data/usage/org-usage-query'
+import { DOCS_URL } from 'lib/constants'
import { Admonition } from 'ui-patterns'
export const COLOR_MAP = {
@@ -97,7 +98,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Documentation',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/egress',
+ url: `${DOCS_URL}/guides/platform/manage-your-usage/egress`,
},
],
},
@@ -116,7 +117,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Documentation',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/egress',
+ url: `${DOCS_URL}/guides/platform/manage-your-usage/egress`,
},
],
})
@@ -147,7 +148,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Documentation',
- url: 'https://supabase.com/docs/guides/platform/database-size',
+ url: `${DOCS_URL}/guides/platform/database-size`,
},
],
chartDescription: 'The data refreshes every 24 hours.',
@@ -205,11 +206,11 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Documentation',
- url: 'https://supabase.com/docs/guides/platform/manage-your-usage/disk-size',
+ url: `${DOCS_URL}/guides/platform/manage-your-usage/disk-size`,
},
{
name: 'Disk Management',
- url: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
+ url: `${DOCS_URL}/guides/platform/database-size#disk-management`,
},
],
chartDescription: '',
@@ -227,7 +228,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Storage',
- url: 'https://supabase.com/docs/guides/storage',
+ url: `${DOCS_URL}/guides/storage`,
},
],
},
@@ -253,7 +254,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Auth',
- url: 'https://supabase.com/docs/guides/auth',
+ url: `${DOCS_URL}/guides/auth`,
},
],
},
@@ -274,7 +275,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'SSO with SAML 2.0',
- url: 'https://supabase.com/docs/guides/auth/sso/auth-sso-saml',
+ url: `${DOCS_URL}/guides/auth/sso/auth-sso-saml`,
},
],
},
@@ -295,7 +296,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Documentation',
- url: 'https://supabase.com/docs/guides/storage/image-transformations',
+ url: `${DOCS_URL}/guides/storage/image-transformations`,
},
],
},
@@ -311,7 +312,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Edge Functions',
- url: 'https://supabase.com/docs/guides/functions',
+ url: `${DOCS_URL}/guides/functions`,
},
],
},
@@ -327,7 +328,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Realtime Quotas',
- url: 'https://supabase.com/docs/guides/realtime/quotas',
+ url: `${DOCS_URL}/guides/realtime/quotas`,
},
],
},
@@ -346,7 +347,7 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
links: [
{
name: 'Realtime Quotas',
- url: 'https://supabase.com/docs/guides/realtime/quotas',
+ url: `${DOCS_URL}/guides/realtime/quotas`,
},
],
},
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
index d5456a73d51..3fc51570a93 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
@@ -1,3 +1,4 @@
+import { Download } from 'lucide-react'
import { useState } from 'react'
import { toast } from 'sonner'
@@ -5,7 +6,7 @@ import { useParams } from 'common'
import { DocsButton } from 'components/ui/DocsButton'
import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'
import { generateTypes } from 'data/projects/project-type-generation-query'
-import { Download } from 'lucide-react'
+import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
@@ -42,7 +43,7 @@ const Entities = ({ language }: ContentProps) => {
<div>
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.generatingTypes} />
<div className="flex items-center gap-x-2 px-4 mt-3">
- <DocsButton href="https://supabase.com/docs/guides/database/api/generating-types" />
+ <DocsButton href={`${DOCS_URL}/guides/database/api/generating-types`} />
<Button
type="default"
disabled={isGeneratingTypes}
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/FirstLevelNav.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/FirstLevelNav.tsx
index cd9c326c80d..b915dcc99e5 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/FirstLevelNav.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/FirstLevelNav.tsx
@@ -7,7 +7,7 @@ import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
import { useOpenAPISpecQuery } from 'data/open-api/api-spec-query'
import { useBucketsQuery } from 'data/storage/buckets-query'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { Book, BookOpen } from 'lucide-react'
import { useAppStateSnapshot } from 'state/app-state'
import { Button } from 'ui'
@@ -171,7 +171,7 @@ const FirstLevelNav = () => {
</Button>
<Button block asChild type="text" size="small" icon={<BookOpen />}>
<Link
- href="https://supabase.com/docs/guides/graphql"
+ href={`${DOCS_URL}/guides/graphql`}
target="_blank"
rel="noreferrer"
className="!justify-start"
@@ -183,18 +183,13 @@ const FirstLevelNav = () => {
<div className="px-2 py-4">
<Button block asChild type="text" size="small" icon={<Book />}>
- <Link
- href="https://supabase.com/docs"
- target="_blank"
- rel="noreferrer"
- className="!justify-start"
- >
+ <Link href={`${DOCS_URL}`} target="_blank" rel="noreferrer" className="!justify-start">
Documentation
</Link>
</Button>
<Button block asChild type="text" size="small" icon={<BookOpen />}>
<Link
- href="https://supabase.com/docs/guides/api"
+ href={`${DOCS_URL}/guides/api`}
target="_blank"
rel="noreferrer"
className="!justify-start"
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.constants.ts b/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.constants.ts
index ab8c0f564d2..93b1d3b7dfa 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.constants.ts
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.constants.ts
@@ -1,3 +1,5 @@
+import { DOCS_URL } from 'lib/constants'
+
export const DOCS_MENU = [
{ name: 'Connect', key: 'introduction' },
{ name: 'User Management', key: 'user-management' },
@@ -345,11 +347,11 @@ Edge Functions are server-side TypeScript functions, distributed globally at the
description: `
Follow the steps to prepare your Supabase project on your local machine.
-- Install the Supabase [CLI](https://supabase.com/docs/guides/cli).
-- [Login to the CLI](https://supabase.com/docs/reference/cli/usage#supabase-login) using the command: \`supabase login\`..
-- [Initialize Supabase](https://supabase.com/docs/guides/getting-started/local-development#getting-started) inside your project using the command: \`supabase init\`..
-- [Link to your Remote Project](https://supabase.com/docs/reference/cli/usage#supabase-link) using the command \`supabase link --project-ref [ref]\`..
-- Setup your environment: Follow the steps [here](https://supabase.com/docs/guides/functions/quickstart#setting-up-your-environment).
+- Install the Supabase [CLI](${DOCS_URL}/guides/cli).
+- [Login to the CLI](${DOCS_URL}/reference/cli/usage#supabase-login) using the command: \`supabase login\`..
+- [Initialize Supabase](${DOCS_URL}/guides/getting-started/local-development#getting-started) inside your project using the command: \`supabase init\`..
+- [Link to your Remote Project](${DOCS_URL}/reference/cli/usage#supabase-link) using the command \`supabase link --project-ref [ref]\`..
+- Setup your environment: Follow the steps [here](${DOCS_URL}/guides/functions/quickstart#setting-up-your-environment).
`,
js: undefined,
bash: undefined,
@@ -397,7 +399,7 @@ If you don't want to expose tables in your API, simply add them to a different s
description: `
Supabase APIs are generated from your database, which means that we can use database introspection to generate type-safe API definitions.
-You can generate types from your database either through the [Supabase CLI](https://supabase.com/docs/guides/database/api/generating-types), or by downloading the types file via the button on the right and importing it in your application within \`src/index.ts\`.
+You can generate types from your database either through the [Supabase CLI](${DOCS_URL}/guides/database/api/generating-types), or by downloading the types file via the button on the right and importing it in your application within \`src/index.ts\`.
`,
js: undefined,
bash: undefined,
@@ -480,9 +482,9 @@ The API endpoint supports POST (and in some cases GET) to execute the function.
description: `
Supabase provides a globally distributed cluster of Realtime servers that enable the following functionality:
-- [Broadcast](https://supabase.com/docs/guides/realtime/broadcast): Send ephemeral messages from client to clients with low latency.
-- [Presence](https://supabase.com/docs/guides/realtime/presence): Track and synchronize shared state between clients.
-- [Postgres Changes](https://supabase.com/docs/guides/realtime/postgres-changes): Listen to Postgres database changes and send them to authorized clients.
+- [Broadcast](${DOCS_URL}/guides/realtime/broadcast): Send ephemeral messages from client to clients with low latency.
+- [Presence](${DOCS_URL}/guides/realtime/presence): Track and synchronize shared state between clients.
+- [Postgres Changes](${DOCS_URL}/guides/realtime/postgres-changes): Listen to Postgres database changes and send them to authorized clients.
`,
js: undefined,
bash: undefined,
@@ -495,7 +497,7 @@ Supabase provides a globally distributed cluster of Realtime servers that enable
Creates an event handler that listens to changes.
- By default, Broadcast and Presence are enabled for all projects.
-- By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](https://supabase.com/docs/guides/api#realtime-api-overview).
+- By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](${DOCS_URL}/guides/api#realtime-api-overview).
- You can receive the "previous" data for updates and deletes by setting the table's \`REPLICA IDENTITY\` to \`FULL\` (e.g., \`ALTER TABLE your_table REPLICA IDENTITY FULL;\`).
- Row level security is not applied to delete statements. When RLS is enabled and replica identity is set to full, only the primary key is sent to clients.
`,
@@ -568,7 +570,7 @@ export const DOCS_RESOURCE_CONTENT: {
title: 'Invoke function',
category: 'stored-procedures',
description: undefined,
- docsUrl: 'https://supabase.com/docs/reference/javascript/rpc',
+ docsUrl: `${DOCS_URL}/reference/javascript/rpc`,
code: ({
rpcName,
rpcParams,
@@ -624,7 +626,7 @@ else console.log(data)
key: 'read-rows',
title: `Read rows`,
category: 'entities',
- docsUrl: 'https://supabase.com/docs/reference/javascript/select',
+ docsUrl: `${DOCS_URL}/reference/javascript/select`,
description: `To read rows in this table, use the \`select\` method.`,
code: ({
resourceId,
@@ -707,7 +709,7 @@ let { data: ${resourceId}, error } = await supabase
category: 'entities',
title: 'Filtering',
description: `Supabase provides a wide range of filters`,
- docsUrl: 'https://supabase.com/docs/reference/javascript/using-filters',
+ docsUrl: `${DOCS_URL}/reference/javascript/using-filters`,
code: ({
resourceId,
endpoint,
@@ -786,7 +788,7 @@ let { data: ${resourceId}, error } = await supabase
\`insert\` will also return the replaced values for UPSERT.
`,
- docsUrl: 'https://supabase.com/docs/reference/javascript/insert',
+ docsUrl: `${DOCS_URL}/reference/javascript/insert`,
code: ({
resourceId,
endpoint,
@@ -867,7 +869,7 @@ const { data, error } = await supabase
\`update\` will also return the replaced values for UPDATE.
`,
- docsUrl: 'https://supabase.com/docs/reference/javascript/update',
+ docsUrl: `${DOCS_URL}/reference/javascript/update`,
code: ({
resourceId,
endpoint,
@@ -907,7 +909,7 @@ const { data, error } = await supabase
description: `
\`delete\` lets you delete rows. \`delete\` will match all rows by default, so remember to specify your filters!
`,
- docsUrl: 'https://supabase.com/docs/reference/javascript/delete',
+ docsUrl: `${DOCS_URL}/reference/javascript/delete`,
code: ({
resourceId,
endpoint,
@@ -943,7 +945,7 @@ const { error } = await supabase
description: `
Supabase provides realtime functionality and broadcasts database changes to authorized users depending on Row Level Security (RLS) policies.
`,
- docsUrl: 'https://supabase.com/docs/reference/javascript/subscribe',
+ docsUrl: `${DOCS_URL}/reference/javascript/subscribe`,
code: ({ resourceId }: { resourceId: string }) => {
return [
{
@@ -1028,7 +1030,7 @@ const channels = supabase.channel('custom-filter-channel')
key: 'upload-file',
category: 'storage',
title: 'Upload a file',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-upload',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-upload`,
description: `
Upload a file to an existing bucket. RLS policy permissions required:
- \`buckets\` table permissions: none
@@ -1064,7 +1066,7 @@ const { data, error } = await supabase
key: 'delete-files',
category: 'storage',
title: 'Delete files',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-remove',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-remove`,
description: `
Delete files within the bucket. RLS policy permissions required:
- \`buckets\` table permissions: none
@@ -1093,7 +1095,7 @@ const { data, error } = await supabase
key: 'list-files',
category: 'storage',
title: 'List all files',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-list',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-list`,
description: `
List all files within the bucket. RLS policy permissions required:
- \`buckets\` table permissions: none
@@ -1125,7 +1127,7 @@ const { data, error } = await supabase
key: 'download-file',
category: 'storage',
title: 'Download a file',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-download',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-download`,
description: `
Downloads a file from a private bucket. For public buckets, make a request to the URL returned from getPublicUrl instead. RLS policy permissions required:
- \`buckets\` table permissions: none
@@ -1154,7 +1156,7 @@ const { data, error } = await supabase
key: 'create-signed-url',
category: 'storage',
title: 'Create a signed URL',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-createsignedurl',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-createsignedurl`,
description: `
Create a signed URL which can be used to share a file for a fixed amount of time. RLS policy permissions required:
- \`buckets\` table permissions: none
@@ -1183,7 +1185,7 @@ const { data, error } = await supabase
key: 'retrieve-public-url',
category: 'storage',
title: 'Retrieve public URL',
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-from-getpublicurl',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-from-getpublicurl`,
description: `
A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.
@@ -1216,7 +1218,7 @@ const { data } = supabase
key: 'invoke-edge-function',
category: 'edge-functions',
title: 'Invoke an edge function',
- docsUrl: 'https://supabase.com/docs/reference/javascript/functions-invoke',
+ docsUrl: `${DOCS_URL}/reference/javascript/functions-invoke`,
description: `
Invokes a Supabase Edge Function. Requires an Authorization header, and invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/SecondLevelNav.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/SecondLevelNav.tsx
index dbf51229290..c4a321db4eb 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/SecondLevelNav.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/SecondLevelNav.tsx
@@ -1,6 +1,13 @@
import { useParams } from 'common'
-import Link from 'next/link'
import { useState } from 'react'
+
+import { DocsButton } from 'components/ui/DocsButton'
+import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
+import { useOpenAPISpecQuery } from 'data/open-api/api-spec-query'
+import { useBucketsQuery } from 'data/storage/buckets-query'
+import { DOCS_URL } from 'lib/constants'
+import { ChevronLeft, Code } from 'lucide-react'
+import { useAppStateSnapshot } from 'state/app-state'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -14,16 +21,9 @@ import {
PopoverTrigger_Shadcn_,
Popover_Shadcn_,
} from 'ui'
-
-import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
-import { useOpenAPISpecQuery } from 'data/open-api/api-spec-query'
-import { useBucketsQuery } from 'data/storage/buckets-query'
-import { useAppStateSnapshot } from 'state/app-state'
import { useIsAPIDocsSidePanelEnabled } from '../App/FeaturePreview/FeaturePreviewContext'
import { navigateToSection } from './Content/Content.utils'
import { DOCS_RESOURCE_CONTENT } from './ProjectAPIDocs.constants'
-import { ChevronLeft, Code, ExternalLink } from 'lucide-react'
-import { DocsButton } from 'components/ui/DocsButton'
const SecondLevelNav = () => {
const { ref } = useParams()
@@ -44,22 +44,22 @@ const SecondLevelNav = () => {
entities: {
title: 'Tables & Views',
options: tables,
- docsUrl: 'https://supabase.com/docs/reference/javascript/select',
+ docsUrl: `${DOCS_URL}/reference/javascript/select`,
},
'stored-procedures': {
title: 'Stored Procedures',
options: functions,
- docsUrl: 'https://supabase.com/docs/reference/javascript/rpc',
+ docsUrl: `${DOCS_URL}/reference/javascript/rpc`,
},
storage: {
title: 'Storage',
options: buckets ?? [],
- docsUrl: 'https://supabase.com/docs/reference/javascript/storage-createbucket',
+ docsUrl: `${DOCS_URL}/reference/javascript/storage-createbucket`,
},
'edge-functions': {
title: 'Edge Functions',
options: edgeFunctions ?? [],
- docsUrl: 'https://supabase.com/docs/reference/javascript/functions-invoke',
+ docsUrl: `${DOCS_URL}/reference/javascript/functions-invoke`,
},
}
diff --git a/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx
index 070aec49dcd..9ed6663b7c9 100644
--- a/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx
+++ b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx
@@ -1,7 +1,9 @@
import { ChevronRight } from 'lucide-react'
import { UseFormReturn } from 'react-hook-form'
+import { DocsButton } from 'components/ui/DocsButton'
import Panel from 'components/ui/Panel'
+import { DOCS_URL } from 'lib/constants'
import { CreateProjectForm } from 'pages/new/[slug]'
import {
Badge,
@@ -17,7 +19,6 @@ import {
} from 'ui'
import { Admonition } from 'ui-patterns'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
-import { DocsButton } from 'components/ui/DocsButton'
interface AdvancedConfigurationProps {
form: UseFormReturn<CreateProjectForm>
@@ -97,10 +98,7 @@ export const AdvancedConfiguration = ({
title="OrioleDB is not production ready"
description="Postgres with OrioleDB extension is currently in Public Alpha and not recommended for production usage yet."
>
- <DocsButton
- className="mt-2"
- href="https://supabase.com/docs/guides/database/orioledb"
- />
+ <DocsButton className="mt-2" href={`${DOCS_URL}/guides/database/orioledb`} />
</Admonition>
)}
</FormItemLayout>
diff --git a/apps/studio/components/interfaces/ProjectCreation/SpecialSymbolsCallout.tsx b/apps/studio/components/interfaces/ProjectCreation/SpecialSymbolsCallout.tsx
index eb75fb4fe87..92943b84cd2 100644
--- a/apps/studio/components/interfaces/ProjectCreation/SpecialSymbolsCallout.tsx
+++ b/apps/studio/components/interfaces/ProjectCreation/SpecialSymbolsCallout.tsx
@@ -1,10 +1,11 @@
import { InlineLink } from 'components/ui/InlineLink'
+import { DOCS_URL } from 'lib/constants'
export const SpecialSymbolsCallout = () => {
return (
<p className="mb-2">
Note: If using the Postgres connection string, you will need to{' '}
- <InlineLink href="https://supabase.com/docs/guides/database/postgres/roles#special-symbols-in-passwords">
+ <InlineLink href={`${DOCS_URL}/guides/database/postgres/roles#special-symbols-in-passwords`}>
percent-encode
</InlineLink>{' '}
the password
diff --git a/apps/studio/components/interfaces/QueryPerformance/IndexAdvisorDisabledState.tsx b/apps/studio/components/interfaces/QueryPerformance/IndexAdvisorDisabledState.tsx
index 0a567b1c96d..18e8be8ae94 100644
--- a/apps/studio/components/interfaces/QueryPerformance/IndexAdvisorDisabledState.tsx
+++ b/apps/studio/components/interfaces/QueryPerformance/IndexAdvisorDisabledState.tsx
@@ -6,6 +6,7 @@ import { DocsButton } from 'components/ui/DocsButton'
import { useDatabaseExtensionEnableMutation } from 'data/database-extensions/database-extension-enable-mutation'
import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
import { Markdown } from '../Markdown'
import { getIndexAdvisorExtensions } from './index-advisor.utils'
@@ -88,7 +89,7 @@ export const IndexAdvisorDisabledState = () => {
Enable extensions
</Button>
)}
- <DocsButton href="https://supabase.com/docs/guides/database/extensions/index_advisor" />
+ <DocsButton href={`${DOCS_URL}/guides/database/extensions/index_advisor`} />
</div>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.tsx
index c65e22d85a9..d57961890d5 100644
--- a/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.tsx
+++ b/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.tsx
@@ -9,15 +9,15 @@ import { executeSql } from 'data/sql/execute-sql-query'
import { DbQueryHook } from 'hooks/analytics/useDbQuery'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { IS_PLATFORM } from 'lib/constants'
+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { Button, LoadingLine, cn } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { Markdown } from '../Markdown'
import { PresetHookResult } from '../Reports/Reports.utils'
-import { QueryPerformanceMetrics } from './QueryPerformanceMetrics'
import { QueryPerformanceFilterBar } from './QueryPerformanceFilterBar'
import { QueryPerformanceGrid } from './QueryPerformanceGrid'
+import { QueryPerformanceMetrics } from './QueryPerformanceMetrics'
interface QueryPerformanceProps {
queryHitRate: PresetHookResult
@@ -100,7 +100,7 @@ export const QueryPerformance = ({
<p>How is this report generated?</p>
<Markdown
className="text-xs"
- content="This report uses the pg_stat_statements table, and pg_stat_statements extension. [Learn more here](https://supabase.com/docs/guides/platform/performance#examining-query-performance)."
+ content={`This report uses the pg_stat_statements table, and pg_stat_statements extension. [Learn more here](${DOCS_URL}/guides/platform/performance#examining-query-performance).`}
/>
</div>
@@ -108,8 +108,8 @@ export const QueryPerformance = ({
<p>Inspect your database for potential issues</p>
<Markdown
className="text-xs"
- content="The Supabase CLI comes with a range of tools to help inspect your Postgres instances for
- potential issues. [Learn more here](https://supabase.com/docs/guides/database/inspect)."
+ content={`The Supabase CLI comes with a range of tools to help inspect your Postgres instances for
+ potential issues. [Learn more here](${DOCS_URL}/guides/database/inspect).`}
/>
</div>
</div>
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
index 4851d41d6ea..3d16108accc 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/ChooseChannelPopover/index.tsx
@@ -9,6 +9,7 @@ import { DocsButton } from 'components/ui/DocsButton'
import { getTemporaryAPIKey } from 'data/api-keys/temp-api-keys-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
FormControl_Shadcn_,
@@ -135,7 +136,7 @@ export const ChooseChannelPopover = ({ config, onChangeConfig }: ChooseChannelPo
target="_blank"
rel="noreferrer"
className="underline hover:text-foreground transition"
- href="https://supabase.com/docs/guides/realtime/concepts#channels"
+ href={`${DOCS_URL}/guides/realtime/concepts#channels`}
>
our docs
</a>
@@ -173,7 +174,7 @@ export const ChooseChannelPopover = ({ config, onChangeConfig }: ChooseChannelPo
<DocsButton
abbrev={false}
className="w-min"
- href="https://supabase.com/docs/guides/realtime/authorization"
+ href={`${DOCS_URL}/guides/realtime/authorization`}
/>
</form>
</Form_Shadcn_>
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
index 7fc0eb6271e..f104df260ae 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx
@@ -12,6 +12,7 @@ import ShimmerLine from 'components/ui/ShimmerLine'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { Button, IconBroadcast, IconDatabaseChanges, IconPresence, cn } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
import MessageSelection from './MessageSelection'
@@ -98,7 +99,7 @@ const NoResultAlert = ({
<p className="text-foreground">Not sure what to do?</p>
<p className="text-foreground-lighter text-xs">Browse our documentation</p>
</div>
- <DocsButton href="https://supabase.com/docs/guides/realtime" />
+ <DocsButton href={`${DOCS_URL}/guides/realtime`} />
</div>
</div>
</>
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx b/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
index 342aca9b110..74ee5a9eec1 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
@@ -1,4 +1,5 @@
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { cn } from 'ui'
const NoChannelEmptyState = () => {
@@ -18,7 +19,7 @@ const NoChannelEmptyState = () => {
<p className="text-foreground">Not sure what to do?</p>
<p className="text-foreground-lighter text-xs">Browse our documentation</p>
</div>
- <DocsButton href="https://supabase.com/docs/guides/realtime" />
+ <DocsButton href={`${DOCS_URL}/guides/realtime`} />
</div>
</div>
)
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
index 55f0fd2a566..1e5ac85c025 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
@@ -5,6 +5,7 @@ import { Dispatch, SetStateAction, useState } from 'react'
import { useParams } from 'common'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
Badge,
Button,
@@ -180,7 +181,7 @@ export const RealtimeFilterPopover = ({ config, onChangeConfig }: RealtimeFilter
className="underline"
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/realtime/postgres-changes#available-filters"
+ href={`${DOCS_URL}/guides/realtime/postgres-changes#available-filters`}
>
our docs
</Link>
diff --git a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
index befa9621cfb..139998920ee 100644
--- a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
+++ b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
@@ -10,6 +10,7 @@ import { User, useUsersInfiniteQuery } from 'data/auth/users-infinite-query'
import { useCustomAccessTokenHookDetails } from 'hooks/misc/useCustomAccessTokenHookDetails'
import { useLocalStorage } from 'hooks/misc/useLocalStorage'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state'
import { ResponseError } from 'types'
import {
@@ -393,10 +394,7 @@ const UserImpersonationSelector = () => {
AAL1 verifies users via standard login methods, while AAL2 adds a second
authentication factor. If you're not using MFA, you can leave this on AAL1.
Learn more about MFA{' '}
- <InlineLink href="https://supabase.com/docs/guides/auth/auth-mfa">
- here
- </InlineLink>
- .
+ <InlineLink href={`${DOCS_URL}/guides/auth/auth-mfa`}>here</InlineLink>.
</InfoTooltip>
</div>
diff --git a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
index 935e6d6c9c7..c531a7df6e6 100644
--- a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx
@@ -5,6 +5,7 @@ import { useState } from 'react'
import type { ModalProps } from '@ui/components/Modal/Modal'
import TwoOptionToggle from 'components/ui/TwoOptionToggle'
+import { DOCS_URL } from 'lib/constants'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { Button, CodeBlock, Modal, Tabs } from 'ui'
import { Markdown } from '../Markdown'
@@ -104,7 +105,7 @@ const DownloadSnippetModal = ({ id, ...props }: DownloadSnippetModalProps) => {
<div className="flex justify-between items-center gap-x-2">
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/deployment/database-migrations"
+ href={`${DOCS_URL}/guides/deployment/database-migrations`}
target="_blank"
rel="noreferrer"
>
@@ -114,7 +115,7 @@ const DownloadSnippetModal = ({ id, ...props }: DownloadSnippetModalProps) => {
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/cli/local-development"
+ href={`${DOCS_URL}/guides/cli/local-development`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
index 2913b1a5cda..7c7c1895797 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
+++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts
@@ -1,3 +1,4 @@
+import { DOCS_URL } from 'lib/constants'
import type { SQLTemplate } from './SQLEditor.types'
export const SQL_TEMPLATES: SQLTemplate[] = [
@@ -901,7 +902,7 @@ create table profiles (
constraint username_length check (char_length(username) >= 3)
);
-- Set up Row Level Security (RLS)
--- See https://supabase.com/docs/guides/auth/row-level-security for more details.
+-- See ${DOCS_URL}/guides/auth/row-level-security for more details.
alter table profiles
enable row level security;
@@ -915,7 +916,7 @@ create policy "Users can update own profile." on profiles
for update using ((select auth.uid()) = id);
-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.
--- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.
+-- See ${DOCS_URL}/guides/auth/managing-user-data#using-triggers for more details.
create function public.handle_new_user()
returns trigger
set search_path = ''
@@ -935,7 +936,7 @@ insert into storage.buckets (id, name)
values ('avatars', 'avatars');
-- Set up access controls for storage.
--- See https://supabase.com/docs/guides/storage#policy-examples for more details.
+-- See ${DOCS_URL}/guides/storage#policy-examples for more details.
create policy "Avatar images are publicly accessible." on storage.objects
for select using (bucket_id = 'avatars');
diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
index 12fc1bc9c63..7b52fd47632 100644
--- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
@@ -9,6 +9,7 @@ import { InlineLink, InlineLinkClassName } from 'components/ui/InlineLink'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { AiIconAnimation, Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
@@ -72,11 +73,13 @@ const UtilityTabResults = forwardRef<HTMLDivElement, UtilityTabResultsProps>(
</p>
<p className="text-sm text-foreground-light">
You can either{' '}
- <InlineLink href="https://supabase.com/docs/guides/platform/performance#examining-query-performance">
+ <InlineLink
+ href={`${DOCS_URL}/guides/platform/performance#examining-query-performance`}
+ >
optimize your query
</InlineLink>
, or{' '}
- <InlineLink href="https://supabase.com/docs/guides/database/timeouts">
+ <InlineLink href={`${DOCS_URL}/guides/database/timeouts`}>
increase the statement timeout
</InlineLink>
{' or '}
diff --git a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
index dee54c4380b..07c06f3da2a 100644
--- a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
+++ b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
@@ -9,6 +9,7 @@ import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-co
import { useProjectPostgrestConfigUpdateMutation } from 'data/config/project-postgrest-config-update-mutation'
import { useSchemasQuery } from 'data/database/schemas-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -122,7 +123,7 @@ export const HardenAPIModal = ({ visible, onClose }: HardenAPIModalProps) => {
<DocsButton
abbrev={false}
className="w-min mt-4"
- href="https://supabase.com/docs/guides/database/hardening-data-api"
+ href={`${DOCS_URL}/guides/database/hardening-data-api`}
/>
</DialogSection>
diff --git a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
index 5f2e97cc07e..33fddb3c71e 100644
--- a/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
+++ b/apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx
@@ -17,6 +17,7 @@ import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-ex
import { useSchemasQuery } from 'data/database/schemas-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -170,7 +171,7 @@ export const PostgrestConfig = () => {
<CardHeader className="flex-row items-center justify-between">
Data API Settings
<div className="flex items-center gap-x-2">
- <DocsButton href="https://supabase.com/docs/guides/database/connecting-to-postgres#data-apis" />
+ <DocsButton href={`${DOCS_URL}/guides/database/connecting-to-postgres#data-apis`} />
<Button type="default" icon={<Lock />} onClick={() => setShowModal(true)}>
Harden Data API
</Button>
diff --git a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
index 10bdd198f74..bb72a78db3b 100644
--- a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
@@ -36,7 +36,7 @@ import {
useSelectedProjectQuery,
} from 'hooks/misc/useSelectedProject'
import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
-import { BASE_PATH, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
+import { BASE_PATH, DOCS_URL, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
import { getDatabaseMajorVersion, getSemanticVersion } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import { Alert, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
@@ -180,7 +180,7 @@ export const Addons = () => {
<p className="text-sm text-foreground-light m-0">More information</p>
<div>
<Link
- href="https://supabase.com/docs/guides/platform/compute-add-ons"
+ href={`${DOCS_URL}/guides/platform/compute-add-ons`}
target="_blank"
rel="noreferrer"
>
@@ -192,7 +192,7 @@ export const Addons = () => {
</div>
<div>
<Link
- href="https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler"
+ href={`${DOCS_URL}/guides/database/connecting-to-postgres#connection-pooler`}
target="_blank"
rel="noreferrer"
>
@@ -347,7 +347,7 @@ export const Addons = () => {
<p className="text-sm text-foreground-light m-0">More information</p>
<div>
<Link
- href="https://supabase.com/docs/guides/platform/ipv4-address"
+ href={`${DOCS_URL}/guides/platform/ipv4-address`}
target="_blank"
rel="noreferrer"
>
@@ -424,7 +424,7 @@ export const Addons = () => {
<p className="text-sm text-foreground-light m-0">More information</p>
<div>
<Link
- href="https://supabase.com/docs/guides/platform/backups#point-in-time-recovery"
+ href={`${DOCS_URL}/guides/platform/backups#point-in-time-recovery`}
target="_blank"
rel="noreferrer"
>
@@ -548,7 +548,7 @@ export const Addons = () => {
<p className="text-sm text-foreground-light m-0">More information</p>
<div>
<Link
- href="https://supabase.com/docs/guides/platform/custom-domains"
+ href={`${DOCS_URL}/guides/platform/custom-domains`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
index 7e035c727bc..e400dd79e83 100644
--- a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx
@@ -11,6 +11,7 @@ import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import {
@@ -119,7 +120,7 @@ const CustomDomainSidePanel = () => {
<h4>Custom domains</h4>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/platform/custom-domains"
+ href={`${DOCS_URL}/guides/platform/custom-domains`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
index 01e54ff3308..36d985268d6 100644
--- a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx
@@ -13,6 +13,7 @@ import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useIsAwsCloudProvider } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import { Button, Radio, SidePanel, cn } from 'ui'
@@ -104,7 +105,7 @@ const IPv4SidePanel = () => {
<h4>Dedicated IPv4 address</h4>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/platform/ipv4-address"
+ href={`${DOCS_URL}/guides/platform/ipv4-address`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
index cfd5deb17d6..c172b266acf 100644
--- a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx
@@ -16,7 +16,7 @@ import type { AddonVariantId } from 'data/subscriptions/types'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { useAddonsPagePanel } from 'state/addons-page'
import {
@@ -167,7 +167,7 @@ const PITRSidePanel = () => {
<h4>Point in Time Recovery</h4>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href="https://supabase.com/docs/guides/platform/backups#point-in-time-recovery"
+ href={`${DOCS_URL}/guides/platform/backups#point-in-time-recovery`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
index 952288603b5..a230c390e2f 100644
--- a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
@@ -14,6 +14,7 @@ import { useBannedIPsQuery } from 'data/banned-ips/banned-ips-query'
import { useUserIPAddressQuery } from 'data/misc/user-ip-address-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Badge, Skeleton } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
@@ -78,7 +79,7 @@ const BannedIPs = () => {
title="Network Bans"
description="List of IP addresses that are temporarily blocked if their traffic pattern looks abusive"
/>
- <DocsButton href="https://supabase.com/docs/reference/cli/supabase-network-bans" />
+ <DocsButton href={`${DOCS_URL}/reference/cli/supabase-network-bans`} />
</div>
<FormPanel>
{ipListLoading ? (
diff --git a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
index 47e7700820f..cbd149e19ef 100644
--- a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
@@ -20,6 +20,7 @@ import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -150,7 +151,9 @@ export const ConnectionPooling = () => {
<Badge>Shared/Dedicated Pooler</Badge>
)}
</div>
- <DocsButton href="https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/database/connecting-to-postgres#connection-pooler`}
+ />
</div>
}
footer={
@@ -277,7 +280,9 @@ export const ConnectionPooling = () => {
</p>
<p className="mt-2">
Please refer to our{' '}
- <InlineLink href="https://supabase.com/docs/guides/database/connection-management#configuring-supavisors-pool-size">
+ <InlineLink
+ href={`${DOCS_URL}/guides/database/connection-management#configuring-supavisors-pool-size`}
+ >
documentation
</InlineLink>{' '}
to find out more.
diff --git a/apps/studio/components/interfaces/Settings/Database/DatabaseReadOnlyAlert.tsx b/apps/studio/components/interfaces/Settings/Database/DatabaseReadOnlyAlert.tsx
index a5e4a9e7beb..79beef58d7c 100644
--- a/apps/studio/components/interfaces/Settings/Database/DatabaseReadOnlyAlert.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/DatabaseReadOnlyAlert.tsx
@@ -5,6 +5,7 @@ import { useState } from 'react'
import { useResourceWarningsQuery } from 'data/usage/resource-warnings-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
import ConfirmDisableReadOnlyModeModal from './DatabaseSettings/ConfirmDisableReadOnlyModal'
@@ -62,7 +63,7 @@ export const DatabaseReadOnlyAlert = () => {
</Button>
<Button asChild type="default" icon={<ExternalLink />}>
<a
- href="https://supabase.com/docs/guides/platform/database-size#disabling-read-only-mode"
+ href={`${DOCS_URL}/guides/platform/database-size#disabling-read-only-mode`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx b/apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
index 140b110d380..70c99668544 100644
--- a/apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
@@ -16,6 +16,7 @@ import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useUrlState } from 'hooks/ui/useUrlState'
+import { DOCS_URL } from 'lib/constants'
import { formatBytes } from 'lib/helpers'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, InfoIcon } from 'ui'
@@ -135,7 +136,7 @@ If you upload more than 1.5x the current size of your storage, your database wil
into read-only mode. If you know how big your database is going to be, you can
manually increase the size here.
-Read more about [disk management](https://supabase.com/docs/guides/platform/database-size#disk-management) and how to [free up storage space](https://supabase.com/docs/guides/platform/database-size#vacuum-operations).
+Read more about [disk management](${DOCS_URL}/guides/platform/database-size#disk-management) and how to [free up storage space](${DOCS_URL}/guides/platform/database-size#vacuum-operations).
`}
/>
</AlertDescription_Shadcn_>
diff --git a/apps/studio/components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx b/apps/studio/components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx
index 5e315cfa809..58e6fd8d413 100644
--- a/apps/studio/components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx
@@ -11,6 +11,7 @@ import { useProjectDiskResizeMutation } from 'data/config/project-disk-resize-mu
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -144,7 +145,7 @@ const DiskSizeConfigurationModal = ({
)}. You can resize your database again in approximately ${formattedTimeTillNextAvailableResize}`}
</div>
<Button asChild type="default" iconRight={<ExternalLink size={14} />}>
- <Link href="https://supabase.com/docs/guides/platform/database-size#disk-management">
+ <Link href={`${DOCS_URL}/guides/platform/database-size#disk-management`}>
Read more about disk management
</Link>
</Button>
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
index a57804265de..4ec7c60267d 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/AddRestrictionModal.tsx
@@ -5,6 +5,7 @@ import { Button, Form, Input, Modal, Tooltip, TooltipContent, TooltipTrigger } f
import InformationBox from 'components/ui/InformationBox'
import { useNetworkRestrictionsQuery } from 'data/network-restrictions/network-restrictions-query'
import { useNetworkRestrictionsApplyMutation } from 'data/network-restrictions/network-retrictions-apply-mutation'
+import { DOCS_URL } from 'lib/constants'
import { HelpCircle } from 'lucide-react'
import {
checkIfPrivate,
@@ -165,7 +166,7 @@ const AddRestrictionModal = ({
title="Note: Restrictions only apply to direct connections to your database and connection pooler"
description="They do not currently apply to APIs offered over HTTPS, such as PostgREST, Storage, or Authentication."
urlLabel="Learn more"
- url="https://supabase.com/docs/guides/platform/network-restrictions#limitations"
+ url={`${DOCS_URL}/guides/platform/network-restrictions#limitations`}
/>
<div className="flex space-x-4">
<div className="w-[55%]">
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
index 65455dd2ef4..070aa1788e4 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
@@ -12,6 +12,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useNetworkRestrictionsQuery } from 'data/network-restrictions/network-restrictions-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Badge,
Button,
@@ -109,7 +110,7 @@ const NetworkRestrictions = () => {
description="Allow specific IP ranges to have access to your database."
/>
<div className="flex items-center gap-x-2">
- <DocsButton href="https://supabase.com/docs/guides/platform/network-restrictions" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/network-restrictions`} />
{!canUpdateNetworkRestrictions ? (
<ButtonTooltip
disabled
diff --git a/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx b/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx
index 6e639e19f2c..1449fcf80a9 100644
--- a/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx
@@ -4,6 +4,7 @@ import { useParams } from 'common'
import { Markdown } from 'components/interfaces/Markdown'
import { DocsButton } from 'components/ui/DocsButton'
import { useSupavisorConfigurationQuery } from 'data/database/supavisor-configuration-query'
+import { DOCS_URL } from 'lib/constants'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { useDatabaseSettingsStateSnapshot } from 'state/database-settings'
import {
@@ -42,7 +43,9 @@ export const PoolingModesModal = () => {
<DialogTitle>
<div className="w-full flex items-center justify-between">
<p className="max-w-2xl">Which pooling mode should I use?</p>
- <DocsButton href="https://supabase.com/docs/guides/database/connecting-to-postgres#how-connection-pooling-works" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/database/connecting-to-postgres#how-connection-pooling-works`}
+ />
</div>
</DialogTitle>
<DialogDescription className="max-w-2xl">
diff --git a/apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx b/apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
index 70092a729d4..570e054c8cf 100644
--- a/apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
@@ -17,6 +17,7 @@ import { useSSLEnforcementUpdateMutation } from 'data/ssl-enforcement/ssl-enforc
import { useCustomContent } from 'hooks/custom-content/useCustomContent'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Alert, Button, Switch, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
const SSLConfiguration = () => {
@@ -89,7 +90,7 @@ const SSLConfiguration = () => {
<div id="ssl-configuration">
<div className="flex items-center justify-between mb-6">
<FormHeader className="mb-0" title="SSL Configuration" description="" />
- <DocsButton href="https://supabase.com/docs/guides/platform/ssl-enforcement" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/ssl-enforcement`} />
</div>
<FormPanel>
<FormSection
diff --git a/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx b/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
index d59a176634c..6adb08bc153 100644
--- a/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
+++ b/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
@@ -14,6 +14,7 @@ import { useComplianceConfigUpdateMutation } from 'data/config/project-complianc
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Switch, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
const ComplianceConfig = () => {
@@ -67,7 +68,7 @@ const ComplianceConfig = () => {
title="High Compliance Configuration"
description="For projects storing and processing sensitive data (HIPAA)"
/>
- <DocsButton href="https://supabase.com/docs/guides/platform/hipaa-projects" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/hipaa-projects`} />
</div>
<FormPanel>
<FormSection
diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx
index ef87d4d509d..fb5b75d4f5c 100644
--- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx
+++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx
@@ -9,6 +9,7 @@ import { useCheckCNAMERecordMutation } from 'data/custom-domains/check-cname-mut
import { useCustomDomainActivateMutation } from 'data/custom-domains/custom-domains-activate-mutation'
import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation'
import type { CustomDomainResponse } from 'data/custom-domains/custom-domains-query'
+import { DOCS_URL } from 'lib/constants'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
@@ -95,7 +96,7 @@ const CustomDomainActivate = ({ projectRef, customDomain }: CustomDomainActivate
<Panel.Content className="w-full">
<div className="flex items-center justify-between">
- <DocsButton href="https://supabase.com/docs/guides/platform/custom-domains" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/custom-domains`} />
<div className="flex items-center space-x-2">
<Button
type="default"
diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx
index 4ec3c264442..f2382753584 100644
--- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx
+++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx
@@ -5,6 +5,7 @@ import { DocsButton } from 'components/ui/DocsButton'
import Panel from 'components/ui/Panel'
import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation'
import type { CustomDomainResponse } from 'data/custom-domains/custom-domains-query'
+import { DOCS_URL } from 'lib/constants'
import { Trash } from 'lucide-react'
import { Button } from 'ui'
import ConfirmModal from 'ui-patterns/Dialogs/ConfirmDialog'
@@ -51,7 +52,7 @@ const CustomDomainDelete = ({ projectRef, customDomain }: CustomDomainDeleteProp
<Panel.Content className="w-full">
<div className="flex items-center justify-between">
- <DocsButton href="https://supabase.com/docs/guides/platform/custom-domains" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/custom-domains`} />
<Button
type="danger"
icon={<Trash />}
diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx
index 2e83375d731..6e0784ffd40 100644
--- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx
+++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx
@@ -11,6 +11,7 @@ import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domain
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
import { useCustomDomainReverifyMutation } from 'data/custom-domains/custom-domains-reverify-mutation'
import { useInterval } from 'hooks/misc/useInterval'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -191,7 +192,7 @@ const CustomDomainVerify = () => {
<Panel.Content>
<div className="flex items-center justify-between">
- <DocsButton href="https://supabase.com/docs/guides/platform/custom-domains" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/custom-domains`} />
<div className="flex items-center space-x-2">
<Button
type="default"
diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
index de8a2d0541b..963968cb27a 100644
--- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
+++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
@@ -11,6 +11,7 @@ import { useCheckCNAMERecordMutation } from 'data/custom-domains/check-cname-mut
import { useCustomDomainCreateMutation } from 'data/custom-domains/custom-domains-create-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Form, Input } from 'ui'
const schema = yup.object({
@@ -77,7 +78,7 @@ const CustomDomainsConfigureHostname = () => {
!canConfigureCustomDomain ? (
"You need additional permissions to update your project's custom domain settings"
) : (
- <DocsButton href="https://supabase.com/docs/guides/platform/custom-domains" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/custom-domains`} />
)
}
/>
diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx
index ac5ed945ab9..c656e577309 100644
--- a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx
+++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx
@@ -20,7 +20,7 @@ import { ReleaseChannel } from 'data/projects/new-project.constants'
import { useProjectUpgradeMutation } from 'data/projects/project-upgrade-mutation'
import { setProjectStatus } from 'data/projects/projects-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -183,7 +183,7 @@ const ProjectUpgradeAlert = () => {
extLinks
className="text-foreground"
content={`Your current disk size of ${diskAttributes?.attributes.size_gb}GB will also be
- [right-sized](https://supabase.com/docs/guides/platform/upgrading#disk-sizing) with the upgrade.`}
+ [right-sized](${DOCS_URL}/guides/platform/upgrading#disk-sizing) with the upgrade.`}
/>
)}
{/* @ts-ignore */}
@@ -200,7 +200,7 @@ const ProjectUpgradeAlert = () => {
<div>
<Button size="tiny" type="default" asChild>
<Link
- href="https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#caveats"
+ href={`${DOCS_URL}/guides/platform/migrating-and-upgrading-projects#caveats`}
target="_blank"
rel="noreferrer"
>
@@ -242,7 +242,7 @@ const ProjectUpgradeAlert = () => {
<div>
<Button size="tiny" type="default" asChild>
<Link
- href="https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#caveats"
+ href={`${DOCS_URL}/guides/platform/migrating-and-upgrading-projects#caveats`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
index 68d3413aab0..e683228a12b 100644
--- a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
+++ b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
@@ -11,6 +11,7 @@ import { useProjectTransferMutation } from 'data/projects/project-transfer-mutat
import { useProjectTransferPreviewQuery } from 'data/projects/project-transfer-preview-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { Button, InfoIcon, Listbox, Loading, Modal, WarningIcon } from 'ui'
import { Admonition } from 'ui-patterns'
@@ -165,7 +166,7 @@ const TransferProjectButton = () => {
<DocsButton
abbrev={false}
className="mt-6"
- href="https://supabase.com/docs/guides/platform/project-transfer"
+ href={`${DOCS_URL}/guides/platform/project-transfer`}
/>
</Modal.Content>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/Infrastructure.constants.ts b/apps/studio/components/interfaces/Settings/Infrastructure/Infrastructure.constants.ts
index 43c7e404947..3959d388d51 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/Infrastructure.constants.ts
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/Infrastructure.constants.ts
@@ -1,3 +1,5 @@
+import { DOCS_URL } from 'lib/constants'
+
export interface Attribute {
key: string
name?: string
@@ -42,15 +44,15 @@ export const INFRA_ACTIVITY_METRICS: CategoryMeta[] = [
links: [
{
name: 'Compute Add-Ons',
- url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
+ url: `${DOCS_URL}/guides/platform/compute-add-ons`,
},
{
name: 'High CPU Usage',
- url: 'https://supabase.com/docs/guides/troubleshooting/high-cpu-usage',
+ url: `${DOCS_URL}/guides/troubleshooting/high-cpu-usage`,
},
{
name: 'Metrics',
- url: 'https://supabase.com/docs/guides/platform/metrics',
+ url: `${DOCS_URL}/guides/platform/metrics`,
},
],
},
@@ -66,15 +68,15 @@ export const INFRA_ACTIVITY_METRICS: CategoryMeta[] = [
links: [
{
name: 'Compute Add-Ons',
- url: 'https://supabase.com/docs/guides/platform/compute-add-ons',
+ url: `${DOCS_URL}/guides/platform/compute-add-ons`,
},
{
name: 'High RAM Usage',
- url: 'https://supabase.com/docs/guides/troubleshooting/exhaust-ram',
+ url: `${DOCS_URL}/guides/troubleshooting/exhaust-ram`,
},
{
name: 'Metrics',
- url: 'https://supabase.com/docs/guides/platform/metrics',
+ url: `${DOCS_URL}/guides/platform/metrics`,
},
],
},
@@ -87,15 +89,15 @@ export const INFRA_ACTIVITY_METRICS: CategoryMeta[] = [
links: [
{
name: 'Disk Throughput and IOPS',
- url: 'https://supabase.com/docs/guides/platform/compute-add-ons#disk-throughput-and-iops',
+ url: `${DOCS_URL}/guides/platform/compute-add-ons#disk-throughput-and-iops`,
},
{
name: 'High Disk I/O',
- url: 'https://supabase.com/docs/guides/troubleshooting/exhaust-disk-io',
+ url: `${DOCS_URL}/guides/troubleshooting/exhaust-disk-io`,
},
{
name: 'Metrics',
- url: 'https://supabase.com/docs/guides/platform/metrics',
+ url: `${DOCS_URL}/guides/platform/metrics`,
},
],
description:
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
index 04645c9dff2..582c7b2f823 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
@@ -31,7 +31,7 @@ import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { useResourceWarningsQuery } from 'data/usage/resource-warnings-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS, InstanceSpecs } from 'lib/constants'
+import { DOCS_URL, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS, InstanceSpecs } from 'lib/constants'
import { TIME_PERIODS_BILLING, TIME_PERIODS_REPORTS } from 'lib/constants/metrics'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { Admonition } from 'ui-patterns/admonition'
@@ -404,7 +404,7 @@ export const InfrastructureActivity = () => {
>
<DocsButton
abbrev={false}
- href="https://supabase.com/docs/guides/platform/compute-add-ons#disk-throughput-and-iops"
+ href={`${DOCS_URL}/guides/platform/compute-add-ons#disk-throughput-and-iops`}
/>
</Admonition>
</>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
index e70873dab20..d43bd7b0c20 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
@@ -26,7 +26,7 @@ import {
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useIsAwsK8sCloudProvider, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { AWS_REGIONS_DEFAULT, BASE_PATH } from 'lib/constants'
+import { AWS_REGIONS_DEFAULT, BASE_PATH, DOCS_URL } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import type { AWS_REGIONS_KEYS } from 'shared-data'
import { AWS_REGIONS } from 'shared-data'
@@ -259,7 +259,7 @@ const DeployNewReplicaPanel = ({
<DocsButton
abbrev={false}
className="mt-3"
- href="https://supabase.com/docs/guides/platform/read-replicas#prerequisites"
+ href={`${DOCS_URL}/guides/platform/read-replicas#prerequisites`}
/>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
@@ -322,7 +322,7 @@ const DeployNewReplicaPanel = ({
</Button>
<DocsButton
abbrev={false}
- href="https://supabase.com/docs/guides/platform/read-replicas#prerequisites"
+ href={`${DOCS_URL}/guides/platform/read-replicas#prerequisites`}
/>
</div>
</AlertDescription_Shadcn_>
@@ -363,7 +363,7 @@ const DeployNewReplicaPanel = ({
</Button>
<DocsButton
abbrev={false}
- href="https://supabase.com/docs/guides/platform/read-replicas#how-are-read-replicas-made"
+ href={`${DOCS_URL}/guides/platform/read-replicas#how-are-read-replicas-made`}
/>
</AlertDescription_Shadcn_>
)}
@@ -541,7 +541,7 @@ const DeployNewReplicaPanel = ({
<p className="text-foreground-light text-sm">
Read more about{' '}
<Link
- href="https://supabase.com/docs/guides/platform/manage-your-usage/read-replicas"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/read-replicas`}
target="_blank"
rel="noreferrer"
className="underline hover:text-foreground transition"
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx
index 96763ea4dd9..1e147771370 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx
@@ -1,6 +1,8 @@
-import { useParams } from 'common'
import Link from 'next/link'
+
+import { useParams } from 'common'
import { InlineLink } from 'components/ui/InlineLink'
+import { DOCS_URL } from 'lib/constants'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Badge, Button } from 'ui'
export const ReadReplicasWarning = ({ latestPgVersion }: { latestPgVersion: string }) => {
@@ -44,7 +46,7 @@ export const ObjectsToBeDroppedWarning = ({
<div>
<Button size="tiny" type="default" asChild>
<a
- href="https://supabase.com/docs/guides/platform/upgrading#extensions"
+ href={`${DOCS_URL}/guides/platform/upgrading#extensions`}
target="_blank"
rel="noreferrer"
>
@@ -73,7 +75,7 @@ export const UnsupportedExtensionsWarning = ({
The following extensions are not supported in newer versions of Postgres and must be
removed before you can upgrade.{' '}
<InlineLink
- href="https://supabase.com/docs/guides/platform/upgrading#upgrading-to-postgres-17"
+ href={`${DOCS_URL}/guides/platform/upgrading#upgrading-to-postgres-17`}
target="_blank"
rel="noopener noreferrer"
>
diff --git a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx
index 594cc58012f..d0c0eb04bad 100644
--- a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx
+++ b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx
@@ -11,6 +11,7 @@ import type {
} from 'data/integrations/integrations.types'
import { useVercelConnectionUpdateMutation } from 'data/integrations/vercel-connection-update-mutate'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import Link from 'next/link'
import {
AlertDescription_Shadcn_,
@@ -110,7 +111,7 @@ const VercelIntegrationConnectionForm = ({
<Link
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/platform/branching"
+ href={`${DOCS_URL}/guides/platform/branching`}
className="underline"
>
Branching
diff --git a/apps/studio/components/interfaces/Settings/Logs/Logs.constants.ts b/apps/studio/components/interfaces/Settings/Logs/Logs.constants.ts
index bc0eaaa21c0..b07b68e0c1d 100644
--- a/apps/studio/components/interfaces/Settings/Logs/Logs.constants.ts
+++ b/apps/studio/components/interfaces/Settings/Logs/Logs.constants.ts
@@ -1,9 +1,9 @@
import dayjs from 'dayjs'
+import { DOCS_URL } from 'lib/constants'
import type { DatetimeHelper, FilterTableSet, LogTemplate } from './Logs.types'
-export const LOGS_EXPLORER_DOCS_URL =
- 'https://supabase.com/docs/guides/platform/logs#querying-with-the-logs-explorer'
+export const LOGS_EXPLORER_DOCS_URL = `${DOCS_URL}/guides/platform/logs#querying-with-the-logs-explorer`
export const LOGS_LARGE_DATE_RANGE_DAYS_THRESHOLD = 2 // IN DAYS
diff --git a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
index 8e1151139b1..d3a4e205940 100644
--- a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
@@ -6,6 +6,7 @@ import { ReactNode, useState } from 'react'
import { IS_PLATFORM } from 'common'
import Table from 'components/to-be-cleaned/Table'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import { logConstants } from 'shared-data'
import {
Badge,
@@ -222,7 +223,7 @@ const LogsQueryPanel = ({
respective source. Do note that to access nested keys, you would need to perform
the necessary{' '}
<Link
- href="https://supabase.com/docs/guides/platform/logs#unnesting-arrays"
+ href={`${DOCS_URL}/guides/platform/logs#unnesting-arrays`}
target="_blank"
rel="noreferrer"
className="text-brand"
diff --git a/apps/studio/components/interfaces/Storage/AnalyticBucketDetails/index.tsx b/apps/studio/components/interfaces/Storage/AnalyticBucketDetails/index.tsx
index ca44692c2ef..06557305f6d 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticBucketDetails/index.tsx
+++ b/apps/studio/components/interfaces/Storage/AnalyticBucketDetails/index.tsx
@@ -28,6 +28,7 @@ import { useIcebergNamespacesQuery } from 'data/storage/iceberg-namespaces-query
import { useIcebergWrapperCreateMutation } from 'data/storage/iceberg-wrapper-create-mutation'
import { useVaultSecretDecryptedValueQuery } from 'data/vault/vault-secret-decrypted-value-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
@@ -149,7 +150,7 @@ export const AnalyticBucketDetails = ({ bucket }: { bucket: Bucket }) => {
Namespaces and tables connected to this bucket.
</ScaffoldSectionDescription>
</ScaffoldHeader>
- <DocsButton href="https://supabase.com/docs/guides/storage/analytics/introduction" />
+ <DocsButton href={`${DOCS_URL}/guides/storage/analytics/introduction`} />
</ScaffoldContainer>
<ScaffoldContainer className="flex flex-col gap-4" bottomPadding>
{state === 'loading' && <GenericSkeletonLoader />}
@@ -183,7 +184,7 @@ export const AnalyticBucketDetails = ({ bucket }: { bucket: Bucket }) => {
target="_blank"
rel="noreferrer"
className="text-brand underline"
- href="https://supabase.com/docs/guides/storage/analytics/connecting-to-analytics-bucket"
+ href={`${DOCS_URL}/guides/storage/analytics/connecting-to-analytics-bucket`}
>
{' '}
to get started
@@ -237,7 +238,9 @@ export const AnalyticBucketDetails = ({ bucket }: { bucket: Bucket }) => {
)}
values={wrapperValues}
/>
- <DocsButton href="https://supabase.com/docs/guides/storage/analytics/connecting-to-analytics-bucket" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/storage/analytics/connecting-to-analytics-bucket`}
+ />
</div>
</div>
<Card className="flex flex-col gap-8 p-6">
diff --git a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
index 8f8cad5bede..47e7f318a09 100644
--- a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
+++ b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx
@@ -14,7 +14,7 @@ import { InlineLink } from 'components/ui/InlineLink'
import { useProjectStorageConfigQuery } from 'data/config/project-storage-config-query'
import { useBucketUpdateMutation } from 'data/storage/bucket-update-mutation'
import { Bucket } from 'data/storage/buckets-query'
-import { IS_PLATFORM } from 'lib/constants'
+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'
import {
Button,
Dialog,
@@ -267,7 +267,9 @@ export const EditBucketModal = ({ visible, bucket, onClose }: EditBucketModalPro
<p className="!leading-normal">
Assets cached in the CDN may still be publicly accessible. You can
consider{' '}
- <InlineLink href="https://supabase.com/docs/guides/storage/cdn/smart-cdn#cache-eviction">
+ <InlineLink
+ href={`${DOCS_URL}/guides/storage/cdn/smart-cdn#cache-eviction`}
+ >
purging the cache
</InlineLink>{' '}
or moving your assets to a new bucket.
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
index 3259f2cd36c..4b013668ce2 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
@@ -6,6 +6,7 @@ import { POLICY_MODAL_VIEWS } from 'components/interfaces/Auth/Policies/Policies
import PolicySelection from 'components/interfaces/Auth/Policies/PolicySelection'
import PolicyTemplates from 'components/interfaces/Auth/Policies/PolicyTemplates'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { ChevronLeft } from 'lucide-react'
import { Modal } from 'ui'
import {
@@ -184,7 +185,7 @@ const StoragePoliciesEditPolicyModal = ({
return (
<div className="w-full flex items-center justify-between gap-x-2 pr-6">
<h4 className="m-0 truncate">{getTitle()}</h4>
- <DocsButton href="https://supabase.com/docs/learn/auth-deep-dive/auth-policies" />
+ <DocsButton href={`${DOCS_URL}/learn/auth-deep-dive/auth-policies`} />
</div>
)
}
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
index b695460ab50..6b200e675f9 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
@@ -3,6 +3,7 @@ import { Badge, Button, Checkbox, Modal } from 'ui'
import { PolicyName, PolicyRoles } from 'components/interfaces/Auth/Policies/PolicyEditor'
import SqlEditor from 'components/ui/SqlEditor'
+import { DOCS_URL } from 'lib/constants'
import { STORAGE_CLIENT_LIBRARY_MAPPINGS } from '../Storage.constants'
import { deriveAllowedClientLibraryMethods } from '../Storage.utils'
@@ -35,7 +36,7 @@ const PolicyAllowedOperations = ({ allowedOperations = [], onToggleOperation = (
<p className="text-sm text-foreground-lighter">
Based on the operations you have selected, you can use the highlighted functions in the{' '}
<a
- href="https://supabase.com/docs/reference/javascript/storage-from-list"
+ href={`${DOCS_URL}/reference/javascript/storage-from-list`}
target="_blank"
rel="noreferrer"
className="underline"
diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
index a4301b64d40..1c3d302beea 100644
--- a/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageSettings/S3Connection.tsx
@@ -24,6 +24,7 @@ import { useProjectStorageConfigUpdateUpdateMutation } from 'data/config/project
import { useStorageCredentialsQuery } from 'data/storage/s3-access-key-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
Alert_Shadcn_,
@@ -122,7 +123,7 @@ export const S3Connection = () => {
Connect to your bucket using any S3-compatible service via the S3 protocol
</ScaffoldSectionDescription>
</div>
- <DocsButton href="https://supabase.com/docs/guides/storage/s3/authentication" />
+ <DocsButton href={`${DOCS_URL}/guides/storage/s3/authentication`} />
</div>
<Form_Shadcn_ {...form}>
<form id="s3-connection-form" onSubmit={form.handleSubmit(onSubmit)}>
diff --git a/apps/studio/components/interfaces/Storage/StorageSettings/StorageSettings.tsx b/apps/studio/components/interfaces/Storage/StorageSettings/StorageSettings.tsx
index bd0cfb22d80..9e0f0836b57 100644
--- a/apps/studio/components/interfaces/Storage/StorageSettings/StorageSettings.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageSettings/StorageSettings.tsx
@@ -18,6 +18,7 @@ import { useProjectStorageConfigUpdateUpdateMutation } from 'data/config/project
import { useBucketsQuery } from 'data/storage/buckets-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { formatBytes } from 'lib/helpers'
import {
Button,
@@ -236,7 +237,9 @@ export const StorageSettings = () => {
description={
<>
Optimize and resize images on the fly.{' '}
- <InlineLink href="https://supabase.com/docs/guides/storage/serving/image-transformations">
+ <InlineLink
+ href={`${DOCS_URL}/guides/storage/serving/image-transformations`}
+ >
Learn more
</InlineLink>
.
@@ -274,7 +277,7 @@ export const StorageSettings = () => {
Loading bucket information...
</span>
)}{' '}
- <InlineLink href="https://supabase.com/docs/guides/storage/uploads/file-limits">
+ <InlineLink href={`${DOCS_URL}/guides/storage/uploads/file-limits`}>
Learn more
</InlineLink>
.
diff --git a/apps/studio/components/interfaces/Support/SupportForm.utils.tsx b/apps/studio/components/interfaces/Support/SupportForm.utils.tsx
index 08737d01312..0a8c7682d59 100644
--- a/apps/studio/components/interfaces/Support/SupportForm.utils.tsx
+++ b/apps/studio/components/interfaces/Support/SupportForm.utils.tsx
@@ -7,6 +7,7 @@ import {
type DocsSearchResult as Page,
type DocsSearchResultSection as PageSection,
} from 'common'
+import { DOCS_URL } from 'lib/constants'
import { uuidv4 } from 'lib/helpers'
const SUPPORT_API_URL = process.env.NEXT_PUBLIC_SUPPORT_API_URL || ''
@@ -96,7 +97,7 @@ export function generateLink(pageType: PageType, link: string): string {
switch (pageType) {
case PageType.Markdown:
case PageType.Reference:
- return `https://supabase.com/docs${link}`
+ return `${DOCS_URL}${link}`
case PageType.Integration:
return `https://supabase.com${link}`
case PageType.GithubDiscussion:
diff --git a/apps/studio/components/interfaces/Support/SupportFormV2.tsx b/apps/studio/components/interfaces/Support/SupportFormV2.tsx
index b94e23d8e8a..23f571d3a55 100644
--- a/apps/studio/components/interfaces/Support/SupportFormV2.tsx
+++ b/apps/studio/components/interfaces/Support/SupportFormV2.tsx
@@ -29,6 +29,7 @@ import { useSendSupportTicketMutation } from 'data/feedback/support-ticket-send'
import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { getProjectDetail } from 'data/projects/project-detail-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
+import { DOCS_URL } from 'lib/constants'
import { detectBrowser } from 'lib/helpers'
import { useProfile } from 'lib/profile'
import { useQueryState } from 'nuqs'
@@ -648,9 +649,7 @@ export const SupportFormV2 = ({
)}
<a
href={
- page.type === 'github-discussions'
- ? page.path
- : `https://supabase.com/docs${page.path}`
+ page.type === 'github-discussions' ? page.path : `${DOCS_URL}${page.path}`
}
target="_blank"
rel="noreferrer"
diff --git a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
index 2a11307f97c..7e694daefec 100644
--- a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
@@ -27,6 +27,7 @@ import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useIsProtectedSchema } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import { parseAsBoolean, useQueryState } from 'nuqs'
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
import {
@@ -432,7 +433,7 @@ export const GridHeaderActions = ({ table, isRefetching }: GridHeaderActionsProp
<Button type="default" asChild>
<Link
target="_blank"
- href="https://supabase.com/docs/guides/database/extensions/wrappers/overview#security"
+ href={`${DOCS_URL}/guides/database/extensions/wrappers/overview#security`}
>
Learn more
</Link>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx
index 41fa34c9966..06a6c3f27d8 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx
@@ -18,6 +18,7 @@ import {
import { useEnumeratedTypesQuery } from 'data/enumerated-types/enumerated-types-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useProtectedSchemas } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import type { Dictionary } from 'types'
import { Button, Checkbox, Input, SidePanel, Toggle } from 'ui'
import ActionBar from '../ActionBar'
@@ -247,7 +248,7 @@ const ColumnEditor = ({
icon={<ExternalLink size={14} strokeWidth={2} />}
>
<Link
- href="https://supabase.com/docs/guides/database/tables#data-types"
+ href={`${DOCS_URL}/guides/database/tables#data-types`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
index 91496959b01..810f962e953 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
@@ -18,6 +18,7 @@ import { useSchemasQuery } from 'data/database/schemas-query'
import { useTablesQuery } from 'data/tables/tables-query'
import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { uuidv4 } from 'lib/helpers'
import ActionBar from '../ActionBar'
import { NUMERICAL_TYPES, TEXT_TYPES } from '../SidePanelEditor.constants'
@@ -494,7 +495,7 @@ export const ForeignKeySelector = ({
label="Action if referenced row is removed"
// @ts-ignore
labelOptional={
- <DocsButton href="https://supabase.com/docs/guides/database/postgres/cascade-deletes" />
+ <DocsButton href={`${DOCS_URL}/guides/database/postgres/cascade-deletes`} />
}
descriptionText={
<>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.utils.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.utils.tsx
index 8ffd77b6b2c..d601a0b490c 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.utils.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.utils.tsx
@@ -5,6 +5,7 @@ import Link from 'next/link'
import Papa from 'papaparse'
import { toast } from 'sonner'
+import { DOCS_URL } from 'lib/constants'
import { tryParseJson } from 'lib/helpers'
import { Button } from 'ui'
import {
@@ -182,7 +183,7 @@ export function flagInvalidFileImport(file: File): boolean {
<p>For bulk data loading, we recommend doing so directly through the database.</p>
<Button asChild type="default" icon={<ExternalLink />} className="!mt-2">
<Link
- href="https://supabase.com/docs/guides/database/tables#bulk-data-loading"
+ href={`${DOCS_URL}/guides/database/tables#bulk-data-loading`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx
index a333fe9ac86..3c2dbeeb24d 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx
@@ -14,6 +14,7 @@ import InformationBox from 'components/ui/InformationBox'
import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -144,7 +145,7 @@ const ColumnManagement = ({
<div className="flex items-center gap-x-2">
<Button asChild type="default" icon={<ExternalLink size={12} strokeWidth={2} />}>
<a
- href="https://supabase.com/docs/guides/database/tables#data-types"
+ href={`${DOCS_URL}/guides/database/tables#data-types`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/RLSDisableModal.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/RLSDisableModal.tsx
index ca590e3d15e..114d5df7c3d 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/RLSDisableModal.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/RLSDisableModal.tsx
@@ -1,6 +1,7 @@
import { AlertOctagon, Lock, ShieldOff } from 'lucide-react'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
import { Alert } from 'ui'
export default function RLSDisableModalContent() {
@@ -46,7 +47,7 @@ export default function RLSDisableModalContent() {
<DocsButton
abbrev={false}
className="w-min mt-3"
- href="https://supabase.com/docs/guides/auth/row-level-security"
+ href={`${DOCS_URL}/guides/auth/row-level-security`}
/>
</div>
)
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
index 1d60e546fc7..8c9dbacc7e5 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
@@ -22,6 +22,7 @@ import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useUrlState } from 'hooks/ui/useUrlState'
import { useProtectedSchemas } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import { useTableEditorStateSnapshot } from 'state/table-editor'
import { Badge, Checkbox, Input, SidePanel } from 'ui'
import { Admonition } from 'ui-patterns'
@@ -334,7 +335,7 @@ export const TableEditor = ({
<DocsButton
abbrev={false}
className="mt-2"
- href="https://supabase.com/docs/guides/auth/row-level-security"
+ href={`${DOCS_URL}/guides/auth/row-level-security`}
/>
</Admonition>
) : (
@@ -352,7 +353,7 @@ export const TableEditor = ({
<DocsButton
abbrev={false}
className="mt-2"
- href="https://supabase.com/docs/guides/auth/row-level-security"
+ href={`${DOCS_URL}/guides/auth/row-level-security`}
/>
</Admonition>
)}
diff --git a/apps/studio/components/layouts/AppLayout/ClockSkewBanner.tsx b/apps/studio/components/layouts/AppLayout/ClockSkewBanner.tsx
index 3ba765b5eab..61bbe5881a7 100644
--- a/apps/studio/components/layouts/AppLayout/ClockSkewBanner.tsx
+++ b/apps/studio/components/layouts/AppLayout/ClockSkewBanner.tsx
@@ -1,5 +1,5 @@
import { fetchHandler } from 'data/fetchers'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { useCallback, useEffect, useState } from 'react'
import { Button } from 'ui'
@@ -47,7 +47,7 @@ export const ClockSkewBanner = () => {
Your computer's clock appears to be inaccurate. This can cause issues with certain features.
</p>
<Button asChild type="text">
- <a href="https://supabase.com/docs" target="_blank">
+ <a href={`${DOCS_URL}`} target="_blank">
More information
</a>
</Button>
diff --git a/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx b/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx
index db1f0284c93..2356d309900 100644
--- a/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx
+++ b/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx
@@ -1,5 +1,5 @@
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { ArrowUpRight, Book, BookOpen } from 'lucide-react'
import SVG from 'react-inlinesvg'
@@ -91,7 +91,7 @@ export const generateDocsMenu = (
{
name: 'Guides',
key: 'guides',
- url: `https://supabase.com/docs`,
+ url: DOCS_URL,
icon: <Book size={14} strokeWidth={2} />,
items: [],
isExternal: true,
@@ -99,7 +99,7 @@ export const generateDocsMenu = (
{
name: 'API Reference',
key: 'api-reference',
- url: `https://supabase.com/docs/guides/api`,
+ url: `${DOCS_URL}/guides/api`,
icon: <BookOpen size={14} strokeWidth={2} />,
items: [],
isExternal: true,
diff --git a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
index 76b488fc845..f37b37a7a44 100644
--- a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
+++ b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx
@@ -18,6 +18,7 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { withAuth } from 'hooks/misc/withAuth'
+import { DOCS_URL } from 'lib/constants'
import {
Button,
Popover_Shadcn_,
@@ -169,7 +170,7 @@ const EdgeFunctionDetailsLayout = ({
}
/>
)}
- <DocsButton href="https://supabase.com/docs/guides/functions" />
+ <DocsButton href={`${DOCS_URL}/guides/functions`} />
<Popover_Shadcn_>
<PopoverTrigger_Shadcn_ asChild>
<Button type="default" icon={<Download />}>
diff --git a/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx b/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx
index 3ac1bd4847d..e41e23e2bc0 100644
--- a/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx
@@ -13,7 +13,7 @@ import { invalidateProjectsQuery } from 'data/projects/projects-query'
import { useCustomContent } from 'hooks/custom-content/useCustomContent'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import { Badge, Button } from 'ui'
const BuildingState = () => {
@@ -81,7 +81,7 @@ const BuildingState = () => {
<p className="text-sm text-foreground-light">
Browse the Supabase{' '}
<Link
- href="https://supabase.com/docs"
+ href={`${DOCS_URL}`}
className="mb-0 text-brand transition-colors hover:text-brand-600"
target="_blank"
rel="noreferrer"
diff --git a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx
index c229b33b787..015b64e5d2e 100644
--- a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx
@@ -7,8 +7,9 @@ import { Badge, Button } from 'ui'
import ShimmerLine from 'components/ui/ShimmerLine'
import { invalidateProjectDetailsQuery, type Project } from 'data/projects/project-detail-query'
import { setProjectPostgrestStatus } from 'data/projects/projects-query'
+import { DOCS_URL } from 'lib/constants'
import pingPostgrest from 'lib/pingPostgrest'
-import { Loader, Monitor, Server, ExternalLink } from 'lucide-react'
+import { ExternalLink, Loader, Monitor, Server } from 'lucide-react'
export interface ConnectingStateProps {
project: Project
@@ -86,9 +87,7 @@ const ConnectingState = ({ project }: ConnectingStateProps) => {
</Button>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<Link
- href={
- 'https://supabase.com/docs/guides/platform/troubleshooting#unable-to-connect-to-your-supabase-project'
- }
+ href={`${DOCS_URL}/guides/platform/troubleshooting#unable-to-connect-to-your-supabase-project`}
className="translate-y-[1px]"
>
Troubleshooting
diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx
index 91e2e2fd607..8ad7b313a3e 100644
--- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx
@@ -13,6 +13,7 @@ import { useFeedbackCategoryQuery } from 'data/feedback/feedback-category'
import { useSendFeedbackMutation } from 'data/feedback/feedback-send'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import { DOCS_URL } from 'lib/constants'
import { timeout } from 'lib/helpers'
import {
Button,
@@ -236,7 +237,7 @@ export const FeedbackWidget = ({
</span>
</Link>{' '}
or{' '}
- <a href="https://supabase.com/docs" target="_blank" rel="noreferrer">
+ <a href={`${DOCS_URL}`} target="_blank" rel="noreferrer">
<span className="cursor-pointer text-brand transition-colors hover:text-brand-600">
see docs
</span>
diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
index ca6289ea9d7..a2c7cee9f5a 100644
--- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
@@ -8,6 +8,7 @@ import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import {
AiIconAnimation,
@@ -99,7 +100,7 @@ export const HelpPopover = () => {
)}
<ButtonGroupItem size="tiny" icon={<Wrench strokeWidth={1.5} size={14} />} asChild>
<a
- href="https://supabase.com/docs/guides/platform/troubleshooting"
+ href={`${DOCS_URL}/guides/platform/troubleshooting`}
target="_blank"
rel="noreferrer"
>
@@ -107,7 +108,7 @@ export const HelpPopover = () => {
</a>
</ButtonGroupItem>
<ButtonGroupItem size="tiny" icon={<BookOpen strokeWidth={1.5} size={14} />} asChild>
- <a href="https://supabase.com/docs/" target="_blank" rel="noreferrer">
+ <a href={`${DOCS_URL}/`} target="_blank" rel="noreferrer">
Docs
</a>
</ButtonGroupItem>
diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LocalVersionPopover.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LocalVersionPopover.tsx
index f46d9ada293..1346a326b31 100644
--- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LocalVersionPopover.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LocalVersionPopover.tsx
@@ -3,6 +3,7 @@ import dayjs from 'dayjs'
import { DocsButton } from 'components/ui/DocsButton'
import { InlineLink } from 'components/ui/InlineLink'
import { useCLIReleaseVersionQuery } from 'data/misc/cli-release-version-query'
+import { DOCS_URL } from 'lib/constants'
import {
Badge,
Button,
@@ -134,7 +135,9 @@ export const LocalVersionPopover = () => {
<p className="text-sm">
Supabase CLI releases follows a two-week schedule, with stable updates available
through the{' '}
- <InlineLink href="https://supabase.com/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux#updating-the-supabase-cli">
+ <InlineLink
+ href={`${DOCS_URL}/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux#updating-the-supabase-cli`}
+ >
CLI
</InlineLink>
.
@@ -157,7 +160,7 @@ export const LocalVersionPopover = () => {
</p>
}
<DocsButton
- href="https://supabase.com/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux#using-beta-version"
+ href={`${DOCS_URL}/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux#using-beta-version`}
className="!no-underline mt-2"
/>
</Admonition>
@@ -168,7 +171,7 @@ export const LocalVersionPopover = () => {
<a
target="_blank"
rel="noreferrer noopener"
- href="https://supabase.com/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux"
+ href={`${DOCS_URL}/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux`}
>
CLI Docs
</a>
diff --git a/apps/studio/components/layouts/ProjectLayout/PausedState/PauseDisabledState.tsx b/apps/studio/components/layouts/ProjectLayout/PausedState/PauseDisabledState.tsx
index 3fe78430a09..8eaa7b8bad4 100644
--- a/apps/studio/components/layouts/ProjectLayout/PausedState/PauseDisabledState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/PausedState/PauseDisabledState.tsx
@@ -10,7 +10,7 @@ import { useStorageArchiveCreateMutation } from 'data/storage/storage-archive-cr
import { useStorageArchiveQuery } from 'data/storage/storage-archive-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { Database, Storage } from 'icons'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
@@ -164,7 +164,7 @@ export const PauseDisabledState = () => {
<a
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/platform/migrating-within-supabase/dashboard-restore"
+ href={`${DOCS_URL}/guides/platform/migrating-within-supabase/dashboard-restore`}
>
Restore backup to a new Supabase project guide
</a>
@@ -173,7 +173,7 @@ export const PauseDisabledState = () => {
<a
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/local-development/restoring-downloaded-backup"
+ href={`${DOCS_URL}/guides/local-development/restoring-downloaded-backup`}
>
Restore backup on your local machine guide
</a>
diff --git a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
index 508f1a0b002..4daecfa61bc 100644
--- a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
@@ -22,7 +22,7 @@ import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { usePHFlag } from 'hooks/ui/useFlag'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import { AWS_REGIONS, CloudProvider } from 'shared-data'
import {
AlertDescription_Shadcn_,
@@ -207,7 +207,7 @@ export const ProjectPausedState = ({ product }: ProjectPausedStateProps) => {
<a
target="_blank"
rel="noreferrer"
- href="https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#time-limits"
+ href={`${DOCS_URL}/guides/platform/migrating-and-upgrading-projects#time-limits`}
>
More information
</a>
diff --git a/apps/studio/components/layouts/ProjectLayout/RestorePaidPlanProjectNotice.tsx b/apps/studio/components/layouts/ProjectLayout/RestorePaidPlanProjectNotice.tsx
index 923cb6e1eab..c05285b2834 100644
--- a/apps/studio/components/layouts/ProjectLayout/RestorePaidPlanProjectNotice.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/RestorePaidPlanProjectNotice.tsx
@@ -1,3 +1,4 @@
+import { DOCS_URL } from 'lib/constants'
import { ExternalLink } from 'lucide-react'
import {
AlertDescription_Shadcn_,
@@ -21,7 +22,7 @@ export const RestorePaidPlanProjectNotice = () => {
<AlertDescription_Shadcn_ className="mt-3">
<Button asChild type="default" icon={<ExternalLink />}>
<a
- href="https://supabase.com/docs/guides/platform/manage-your-usage/compute"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx b/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
index 6c21c1bc7f4..fbc0b3abf0f 100644
--- a/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
+++ b/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
@@ -8,7 +8,7 @@ import { PropsWithChildren, useEffect, useState } from 'react'
import { useFlag } from 'common'
import { DocsButton } from 'components/ui/DocsButton'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { auth, buildPathWithParams, getAccessToken, getReturnToPath } from 'lib/gotrue'
import { tweets } from 'shared-data'
@@ -111,7 +111,7 @@ const SignInLayout = ({
</div>
<div className="items-center hidden space-x-3 md:ml-10 md:flex md:pr-4">
- <DocsButton abbrev={false} href="https://supabase.com/docs" />
+ <DocsButton abbrev={false} href={`${DOCS_URL}`} />
</div>
</nav>
</div>
diff --git a/apps/studio/components/ui/GrafanaPromoBanner.tsx b/apps/studio/components/ui/GrafanaPromoBanner.tsx
index 22598234352..c3bbab5918d 100644
--- a/apps/studio/components/ui/GrafanaPromoBanner.tsx
+++ b/apps/studio/components/ui/GrafanaPromoBanner.tsx
@@ -1,9 +1,10 @@
+import { BookOpen } from 'lucide-react'
+import Link from 'next/link'
+
import { useParams } from 'common'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
-import { BASE_PATH } from 'lib/constants'
-import { BookOpen } from 'lucide-react'
-import Link from 'next/link'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Button, cn } from 'ui'
const GrafanaPromoBanner = () => (
@@ -58,7 +59,7 @@ const GrafanaBannerActions = ({ className }: { className?: string }) => {
<div className={cn('flex gap-2', className)}>
<Button type="outline" className="bg-alternative" size="tiny" icon={<BookOpen />} asChild>
<Link
- href="https://supabase.com/docs/guides/telemetry/metrics"
+ href={`${DOCS_URL}/guides/telemetry/metrics`}
target="_blank"
onClick={() =>
sendEvent({
diff --git a/apps/studio/components/ui/Logs/LogsExplorerHeader.tsx b/apps/studio/components/ui/Logs/LogsExplorerHeader.tsx
index 6dc87be2204..71906c4f0d1 100644
--- a/apps/studio/components/ui/Logs/LogsExplorerHeader.tsx
+++ b/apps/studio/components/ui/Logs/LogsExplorerHeader.tsx
@@ -4,6 +4,7 @@ import { useState } from 'react'
import { LOGS_EXPLORER_DOCS_URL } from 'components/interfaces/Settings/Logs/Logs.constants'
import Table from 'components/to-be-cleaned/Table'
+import { DOCS_URL } from 'lib/constants'
import { logConstants } from 'shared-data'
import {
Button,
@@ -72,7 +73,7 @@ const LogsExplorerHeader = ({ subtitle }: LogsExplorerHeaderProps) => {
respective source. Do note that to access nested keys, you would need to perform the
necessary{' '}
<Link
- href="https://supabase.com/docs/guides/platform/logs#unnesting-arrays"
+ href={`${DOCS_URL}/guides/platform/logs#unnesting-arrays`}
target="_blank"
rel="noreferrer"
className="text-brand"
diff --git a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
index ac022df0ea5..5fe7d297aa1 100644
--- a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
+++ b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
@@ -1,3 +1,5 @@
+import { DOCS_URL } from 'lib/constants'
+
interface ResourceWarningMessage {
// should match pathnames, ex: ('/', 'project/[ref]/auth', 'project/[ref]/database', '/project/[ref]/settings/api')
restrictToRoutes?: string[]
@@ -41,7 +43,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: 'Database is no longer accepting write requests.',
},
},
- docsUrl: 'https://supabase.com/docs/guides/platform/database-size#disabling-read-only-mode',
+ docsUrl: `${DOCS_URL}/guides/platform/database-size#disabling-read-only-mode`,
buttonText: 'Learn more',
metric: 'read_only',
},
@@ -69,7 +71,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: 'It may become unresponsive',
},
},
- docsUrl: 'https://supabase.com/docs/guides/troubleshooting/exhaust-disk-io',
+ docsUrl: `${DOCS_URL}/guides/troubleshooting/exhaust-disk-io`,
buttonText: 'Learn more',
metric: 'disk_io',
},
@@ -97,7 +99,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: 'It may become unresponsive',
},
},
- docsUrl: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
+ docsUrl: `${DOCS_URL}/guides/platform/database-size#disk-management`,
buttonText: undefined,
metric: 'disk_space',
},
@@ -124,7 +126,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: `Performance is affected`,
},
},
- docsUrl: 'https://supabase.com/docs/guides/troubleshooting/high-cpu-usage',
+ docsUrl: `${DOCS_URL}/guides/troubleshooting/high-cpu-usage`,
buttonText: 'Learn more',
metric: 'cpu',
},
@@ -152,7 +154,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: `Performance is affected`,
},
},
- docsUrl: 'https://supabase.com/docs/guides/troubleshooting/exhaust-ram',
+ docsUrl: `${DOCS_URL}/guides/troubleshooting/exhaust-ram`,
buttonText: 'Learn more',
metric: 'ram',
},
@@ -180,7 +182,7 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
description: undefined,
},
},
- docsUrl: 'https://supabase.com/docs/guides/platform/going-into-prod#auth-rate-limits',
+ docsUrl: `${DOCS_URL}/guides/platform/going-into-prod#auth-rate-limits`,
buttonText: 'Enable Custom SMTP',
metric: 'auth_email_rate_limit',
},
diff --git a/apps/studio/data/reports/database-charts.ts b/apps/studio/data/reports/database-charts.ts
index eb25bd212b4..3f8efcc622c 100644
--- a/apps/studio/data/reports/database-charts.ts
+++ b/apps/studio/data/reports/database-charts.ts
@@ -1,5 +1,6 @@
import { numberFormatter } from 'components/ui/Charts/Charts.utils'
import { ReportAttributes } from 'components/ui/Charts/ComposedChart.utils'
+import { DOCS_URL } from 'lib/constants'
import { formatBytes } from 'lib/helpers'
import { Organization } from 'types'
import { DiskAttributesData } from '../config/disk-attributes-query'
@@ -97,7 +98,7 @@ export const getReportAttributes = (diskConfig?: DiskAttributesData): ReportAttr
tickFormatter: (value: any) => numberFormatter(value, 2),
},
defaultChartStyle: 'line',
- docsUrl: 'https://supabase.com/docs/guides/platform/compute-and-disk#compute-size',
+ docsUrl: `${DOCS_URL}/guides/platform/compute-and-disk#compute-size`,
attributes: [
{
attribute: 'disk_iops_write',
@@ -225,7 +226,7 @@ export const getReportAttributesV2: (
{
id: 'ram-usage',
label: 'Memory usage',
- docsUrl: 'https://supabase.com/docs/guides/telemetry/reports#memory-usage',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#memory-usage`,
availableIn: ['team', 'enterprise'],
hide: false,
showTooltip: true,
@@ -267,7 +268,7 @@ export const getReportAttributesV2: (
{
id: 'cpu-usage',
label: 'CPU usage',
- docsUrl: 'https://supabase.com/docs/guides/telemetry/reports#cpu-usage',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#cpu-usage`,
syncId: 'database-reports',
format: '%',
valuePrecision: 2,
@@ -336,8 +337,7 @@ export const getReportAttributesV2: (
{
id: 'disk-iops',
label: 'Disk Input/Output operations per second (IOPS)',
- docsUrl:
- 'https://supabase.com/docs/guides/telemetry/reports#disk-inputoutput-operations-per-second-iops',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#disk-inputoutput-operations-per-second-iops`,
syncId: 'database-reports',
availableIn: ['team', 'enterprise'],
hide: false,
@@ -381,7 +381,7 @@ export const getReportAttributesV2: (
{
id: 'disk-io-usage',
label: 'Disk IO Usage',
- docsUrl: 'https://supabase.com/docs/guides/telemetry/reports#disk-io-usage',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#disk-io-usage`,
syncId: 'database-reports',
availableIn: ['team', 'enterprise'],
hide: false,
@@ -421,7 +421,7 @@ export const getReportAttributesV2: (
showGrid: true,
YAxisProps: { width: 30 },
defaultChartStyle: 'line',
- docsUrl: 'https://supabase.com/docs/guides/telemetry/reports#database-connections',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#database-connections`,
attributes: [
{
attribute: 'client_connections_postgres',
@@ -485,7 +485,7 @@ export const getReportAttributesV2: (
YAxisProps: { width: 30 },
hideChartType: false,
defaultChartStyle: 'line',
- docsUrl: 'https://supabase.com/docs/guides/platform/compute-and-disk#limits-and-constraints',
+ docsUrl: `${DOCS_URL}/guides/platform/compute-and-disk#limits-and-constraints`,
attributes: [
{
attribute: 'client_connections_pgbouncer',
@@ -543,7 +543,7 @@ export const getReportAttributesV2: (
},
hideChartType: false,
defaultChartStyle: 'line',
- docsUrl: 'https://supabase.com/docs/guides/telemetry/reports#disk-size',
+ docsUrl: `${DOCS_URL}/guides/telemetry/reports#disk-size`,
attributes: [
{
attribute: 'disk_fs_used_system',
diff --git a/apps/studio/data/table-rows/table-row-delete-mutation.tsx b/apps/studio/data/table-rows/table-row-delete-mutation.tsx
index 103d9ff9cba..bfe4d96c67d 100644
--- a/apps/studio/data/table-rows/table-row-delete-mutation.tsx
+++ b/apps/studio/data/table-rows/table-row-delete-mutation.tsx
@@ -7,6 +7,7 @@ import { Markdown } from 'components/interfaces/Markdown'
import { DocsButton } from 'components/ui/DocsButton'
import { executeSql } from 'data/sql/execute-sql-query'
import { Entity } from 'data/table-editor/table-editor-types'
+import { DOCS_URL } from 'lib/constants'
import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
import type { ResponseError } from 'types'
@@ -108,7 +109,7 @@ export const useTableRowDeleteMutation = ({
View "{referencingTable}" table
</Link>
</Button> */}
- <DocsButton href="https://supabase.com/docs/guides/database/postgres/cascade-deletes" />
+ <DocsButton href={`${DOCS_URL}/guides/database/postgres/cascade-deletes`} />
</div>
),
})
@@ -121,7 +122,7 @@ export const useTableRowDeleteMutation = ({
each row before updating or deleting the row.
</p>
<div className="mt-3">
- <DocsButton href="https://supabase.com/docs/guides/database/tables#primary-keys" />
+ <DocsButton href={`${DOCS_URL}/guides/database/tables#primary-keys`} />
</div>
</div>
),
diff --git a/apps/studio/hooks/analytics/useLogsQuery.tsx b/apps/studio/hooks/analytics/useLogsQuery.tsx
index 4e4f8b84aed..33d9404c64e 100644
--- a/apps/studio/hooks/analytics/useLogsQuery.tsx
+++ b/apps/studio/hooks/analytics/useLogsQuery.tsx
@@ -16,6 +16,7 @@ import {
checkForWithClause,
} from 'components/interfaces/Settings/Logs/Logs.utils'
import { get } from 'data/fetchers'
+import { DOCS_URL } from 'lib/constants'
export interface LogsQueryHook {
params: LogsEndpointParams
@@ -98,13 +99,13 @@ const useLogsQuery = (
if (usesWith) {
error = {
message: 'The parser does not yet support WITH and subquery statements.',
- docs: 'https://supabase.com/docs/guides/platform/advanced-log-filtering#the-with-keyword-and-subqueries-are-not-supported',
+ docs: `${DOCS_URL}/guides/platform/advanced-log-filtering#the-with-keyword-and-subqueries-are-not-supported`,
}
}
if (usesILIKE) {
error = {
message: 'BigQuery does not support ILIKE. Use REGEXP_CONTAINS instead.',
- docs: 'https://supabase.com/docs/guides/platform/advanced-log-filtering#the-ilike-and-similar-to-keywords-are-not-supported',
+ docs: `${DOCS_URL}/guides/platform/advanced-log-filtering#the-ilike-and-similar-to-keywords-are-not-supported`,
}
}
}
diff --git a/apps/studio/lib/ai/prompts.ts b/apps/studio/lib/ai/prompts.ts
index 09682ba2f06..43df8afb19d 100644
--- a/apps/studio/lib/ai/prompts.ts
+++ b/apps/studio/lib/ai/prompts.ts
@@ -1,3 +1,5 @@
+import { DOCS_URL } from 'lib/constants'
+
export const RLS_PROMPT = `
Developer: # PostgreSQL RLS in Supabase: Condensed Guide
@@ -232,11 +234,11 @@ Developer: # Postgres Best Practices
- Enable Row Level Security (RLS) on all new tables with \`enable row level security\`; inform users that they need to add policies.
- Define foreign key references within the \`CREATE TABLE\` statement.
- Whenever a foreign key is used, generate a separate \`CREATE INDEX\` statement for the foreign key column(s) to improve performance on joins.
- - **Foreign Tables**: Place foreign tables in a schema named \`private\` (create the schema if needed). Explain the security risk (RLS bypass) and include a link: https://supabase.com/docs/guides/database/database-advisors?queryGroups=lint&lint=0017_foreign_table_in_api.
+ - **Foreign Tables**: Place foreign tables in a schema named \`private\` (create the schema if needed). Explain the security risk (RLS bypass) and include a link: ${DOCS_URL}/guides/database/database-advisors?queryGroups=lint&lint=0017_foreign_table_in_api.
- **Views**:
- Add \`with (security_invoker=on)\` immediately after \`CREATE VIEW view_name\`.
- - **Materialized Views**: Store materialized views in the \`private\` schema (create if needed). Explain the security risk (RLS bypass) and reference: https://supabase.com/docs/guides/database/database-advisors?queryGroups=lint&lint=0016_materialized_view_in_api.
+ - **Materialized Views**: Store materialized views in the \`private\` schema (create if needed). Explain the security risk (RLS bypass) and reference: ${DOCS_URL}/guides/database/database-advisors?queryGroups=lint&lint=0016_materialized_view_in_api.
- **Extensions**:
- Always install extensions in the \`extensions\` schema or a dedicated schema, never in \`public\`.
diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts
index 79338ec013d..4a95864039e 100644
--- a/apps/studio/lib/constants/index.ts
+++ b/apps/studio/lib/constants/index.ts
@@ -45,6 +45,8 @@ export const POSTHOG_URL =
export const USAGE_APPROACHING_THRESHOLD = 0.75
+export const DOCS_URL = process.env.NEXT_PUBLIC_DOCS_URL || 'https://supabase.com/docs'
+
export const OPT_IN_TAGS = {
AI_SQL: 'AI_SQL_GENERATOR_OPT_IN',
AI_DATA: 'AI_DATA_GENERATOR_OPT_IN',
diff --git a/apps/studio/pages/account/tokens.tsx b/apps/studio/pages/account/tokens.tsx
index cae0704f8f8..b03c749d4b1 100644
--- a/apps/studio/pages/account/tokens.tsx
+++ b/apps/studio/pages/account/tokens.tsx
@@ -14,6 +14,7 @@ import {
ScaffoldSectionTitle,
} from 'components/layouts/Scaffold'
import { NewAccessToken } from 'data/access-tokens/access-tokens-create-mutation'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
import { Input } from 'ui-patterns/DataInputs/Input'
@@ -45,20 +46,12 @@ const UserAccessTokens: NextPageWithLayout = () => {
/>
<div className="flex items-center gap-x-2">
<Button asChild type="default" icon={<ExternalLink />}>
- <a
- href="https://supabase.com/docs/reference/api/introduction"
- target="_blank"
- rel="noreferrer"
- >
+ <a href={`${DOCS_URL}/reference/api/introduction`} target="_blank" rel="noreferrer">
API Docs
</a>
</Button>
<Button asChild type="default" icon={<ExternalLink />}>
- <a
- href="https://supabase.com/docs/reference/cli/start"
- target="_blank"
- rel="noreferrer"
- >
+ <a href={`${DOCS_URL}/reference/cli/start`} target="_blank" rel="noreferrer">
CLI docs
</a>
</Button>
diff --git a/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts b/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
index e58f7b326f7..4431f0c0597 100644
--- a/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
+++ b/apps/studio/pages/api/platform/projects/[ref]/run-lints.ts
@@ -4,7 +4,7 @@ import { paths } from 'api-types'
import { fetchPost } from 'data/fetchers'
import { constructHeaders } from 'lib/api/apiHelpers'
import apiWrapper from 'lib/api/apiWrapper'
-import { PG_META_URL } from 'lib/constants'
+import { DOCS_URL, PG_META_URL } from 'lib/constants'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -92,7 +92,7 @@ select
fk.table_name,
fk.fkey_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0001_unindexed_foreign_keys' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0001_unindexed_foreign_keys' as remediation,
jsonb_build_object(
'schema', fk.schema_name,
'name', fk.table_name,
@@ -132,7 +132,7 @@ select
'View/Materialized View "%s" in the public schema may expose \`auth.users\` data to anon or authenticated roles.',
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0002_auth_users_exposed' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0002_auth_users_exposed' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -246,12 +246,12 @@ select
array['PERFORMANCE'] as categories,
'Detects if calls to \`auth.<function>()\` in RLS policies are being unnecessarily re-evaluated for each row' as description,
format(
- 'Table \`%s.%s\` has a row level security policy \`%s\` that re-evaluates an auth.<function>() for each row. This produces suboptimal query performance at scale. Resolve the issue by replacing \`auth.<function>()\` with \`(select auth.<function>())\`. See [docs](https://supabase.com/docs/guides/database/postgres/row-level-security#call-functions-with-select) for more info.',
+ 'Table \`%s.%s\` has a row level security policy \`%s\` that re-evaluates an auth.<function>() for each row. This produces suboptimal query performance at scale. Resolve the issue by replacing \`auth.<function>()\` with \`(select auth.<function>())\`. See [docs](${DOCS_URL}/guides/database/postgres/row-level-security#call-functions-with-select) for more info.',
schema_name,
table_name,
policy_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0003_auth_rls_initplan' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0003_auth_rls_initplan' as remediation,
jsonb_build_object(
'schema', schema_name,
'name', table_name,
@@ -315,7 +315,7 @@ select
pgns.nspname,
pgc.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0004_no_primary_key' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0004_no_primary_key' as remediation,
jsonb_build_object(
'schema', pgns.nspname,
'name', pgc.relname,
@@ -362,7 +362,7 @@ select
psui.schemaname,
psui.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0005_unused_index' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0005_unused_index' as remediation,
jsonb_build_object(
'schema', psui.schemaname,
'name', psui.relname,
@@ -407,7 +407,7 @@ select
act.cmd,
array_agg(p.polname order by p.polname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0006_multiple_permissive_policies' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0006_multiple_permissive_policies' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -478,7 +478,7 @@ select
c.relname,
array_agg(p.polname order by p.polname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0007_policy_exists_rls_disabled' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0007_policy_exists_rls_disabled' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -523,7 +523,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0008_rls_enabled_no_policy' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -570,7 +570,7 @@ select
c.relname,
array_agg(pi.indexname order by pi.indexname)
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0009_duplicate_index' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0009_duplicate_index' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -624,7 +624,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0010_security_definer_view' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0010_security_definer_view' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -677,7 +677,7 @@ select
n.nspname,
p.proname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0011_function_search_path_mutable' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0011_function_search_path_mutable' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', p.proname,
@@ -717,7 +717,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0013_rls_disabled_in_public' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0013_rls_disabled_in_public' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -757,7 +757,7 @@ select
'Extension \`%s\` is installed in the public schema. Move it to another schema.',
pe.extname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0014_extension_in_public' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0014_extension_in_public' as remediation,
jsonb_build_object(
'schema', pe.extnamespace::regnamespace,
'name', pe.extname,
@@ -811,7 +811,7 @@ select
table_name,
policy_name
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0015_rls_references_user_metadata' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0015_rls_references_user_metadata' as remediation,
jsonb_build_object(
'schema', schema_name,
'name', table_name,
@@ -847,7 +847,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0016_materialized_view_in_api' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0016_materialized_view_in_api' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -890,7 +890,7 @@ select
n.nspname,
c.relname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=0017_foreign_table_in_api' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
@@ -935,7 +935,7 @@ select
a.attname,
t.typname
) as detail,
- 'https://supabase.com/docs/guides/database/database-linter?lint=unsupported_reg_types' as remediation,
+ '${DOCS_URL}/guides/database/database-linter?lint=unsupported_reg_types' as remediation,
jsonb_build_object(
'schema', n.nspname,
'name', c.relname,
diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx
index 2936e140120..cadcae32c74 100644
--- a/apps/studio/pages/new/[slug].tsx
+++ b/apps/studio/pages/new/[slug].tsx
@@ -58,6 +58,7 @@ import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
import {
AWS_REGIONS_DEFAULT,
DEFAULT_MINIMUM_PASSWORD_STRENGTH,
+ DOCS_URL,
FLY_REGIONS_DEFAULT,
MANAGED_BY,
PROJECT_STATUS,
@@ -505,7 +506,7 @@ const Wizard: NextPageWithLayout = () => {
<p>
Each project includes a dedicated Postgres instance running on its own
server. You are charged for the{' '}
- <InlineLink href="https://supabase.com/docs/guides/platform/billing-on-supabase">
+ <InlineLink href={`${DOCS_URL}/guides/platform/billing-on-supabase`}>
Compute resource
</InlineLink>{' '}
of that server, independent of your database usage.
@@ -754,7 +755,7 @@ const Wizard: NextPageWithLayout = () => {
<Link
target="_blank"
rel="noopener noreferrer"
- href="https://supabase.com/docs/guides/platform/compute-add-ons"
+ href={`${DOCS_URL}/guides/platform/compute-add-ons`}
>
<div className="flex items-center space-x-2 opacity-75 hover:opacity-100 transition">
<p className="text-sm m-0">Compute add-ons</p>
@@ -764,7 +765,7 @@ const Wizard: NextPageWithLayout = () => {
<Link
target="_blank"
rel="noopener noreferrer"
- href="https://supabase.com/docs/guides/platform/manage-your-usage/compute"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
>
<div className="flex items-center space-x-2 opacity-75 hover:opacity-100 transition">
<p className="text-sm m-0">Compute billing</p>
@@ -1029,7 +1030,7 @@ const Wizard: NextPageWithLayout = () => {
monthly costs by ${additionalMonthlySpend}, independent of how actively you use it. By
clicking "I understand", you agree to the additional costs.{' '}
<Link
- href="https://supabase.com/docs/guides/platform/manage-your-usage/compute"
+ href={`${DOCS_URL}/guides/platform/manage-your-usage/compute`}
target="_blank"
className="underline"
>
diff --git a/apps/studio/pages/project/[ref]/advisors/performance.tsx b/apps/studio/pages/project/[ref]/advisors/performance.tsx
index 3b0e83b7a23..2e830a927cf 100644
--- a/apps/studio/pages/project/[ref]/advisors/performance.tsx
+++ b/apps/studio/pages/project/[ref]/advisors/performance.tsx
@@ -12,6 +12,7 @@ import DefaultLayout from 'components/layouts/DefaultLayout'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import { Lint, useProjectLintsQuery } from 'data/lint/lint-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { LoadingLine } from 'ui'
@@ -60,7 +61,7 @@ const ProjectLints: NextPageWithLayout = () => {
<FormHeader
className="py-4 px-6 !mb-0"
title="Performance Advisor"
- docsUrl="https://supabase.com/docs/guides/database/database-linter"
+ docsUrl={`${DOCS_URL}/guides/database/database-linter`}
/>
<LintPageTabs
activeLints={activeLints}
diff --git a/apps/studio/pages/project/[ref]/advisors/query-performance.tsx b/apps/studio/pages/project/[ref]/advisors/query-performance.tsx
index b94a267b3c1..4db0331e911 100644
--- a/apps/studio/pages/project/[ref]/advisors/query-performance.tsx
+++ b/apps/studio/pages/project/[ref]/advisors/query-performance.tsx
@@ -14,6 +14,7 @@ import DefaultLayout from 'components/layouts/DefaultLayout'
import DatabaseSelector from 'components/ui/DatabaseSelector'
import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
const QueryPerformanceReport: NextPageWithLayout = () => {
@@ -49,7 +50,9 @@ const QueryPerformanceReport: NextPageWithLayout = () => {
actions={
<div className="flex items-center gap-2">
<EnableIndexAdvisorButton />
- <DocsButton href="https://supabase.com/docs/guides/platform/performance#examining-query-performance" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/platform/performance#examining-query-performance`}
+ />
<DatabaseSelector />
</div>
}
diff --git a/apps/studio/pages/project/[ref]/advisors/security.tsx b/apps/studio/pages/project/[ref]/advisors/security.tsx
index aaa28234f92..4007964fa3e 100644
--- a/apps/studio/pages/project/[ref]/advisors/security.tsx
+++ b/apps/studio/pages/project/[ref]/advisors/security.tsx
@@ -12,6 +12,7 @@ import DefaultLayout from 'components/layouts/DefaultLayout'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import { Lint, useProjectLintsQuery } from 'data/lint/lint-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { LoadingLine } from 'ui'
@@ -62,7 +63,7 @@ const ProjectLints: NextPageWithLayout = () => {
<FormHeader
className="py-4 px-6 !mb-0"
title="Security Advisor"
- docsUrl="https://supabase.com/docs/guides/database/database-linter"
+ docsUrl={`${DOCS_URL}/guides/database/database-linter`}
/>
<LintPageTabs
activeLints={activeLints}
diff --git a/apps/studio/pages/project/[ref]/auth/audit-logs.tsx b/apps/studio/pages/project/[ref]/auth/audit-logs.tsx
index 6f955ce1ec1..e7936c63e30 100644
--- a/apps/studio/pages/project/[ref]/auth/audit-logs.tsx
+++ b/apps/studio/pages/project/[ref]/auth/audit-logs.tsx
@@ -11,6 +11,7 @@ import NoPermission from 'components/ui/NoPermission'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
const AuditLogsPage: NextPageWithLayout = () => {
@@ -38,9 +39,7 @@ const AuditLogsPage: NextPageWithLayout = () => {
)
}
-const secondaryActions = [
- <DocsButton key="docs" href="https://supabase.com/docs/guides/auth/audit-logs" />,
-]
+const secondaryActions = [<DocsButton key="docs" href={`${DOCS_URL}/guides/auth/audit-logs`} />]
AuditLogsPage.getLayout = (page) => (
<DefaultLayout>
diff --git a/apps/studio/pages/project/[ref]/auth/hooks.tsx b/apps/studio/pages/project/[ref]/auth/hooks.tsx
index 023327154fa..b3a04bfb3ba 100644
--- a/apps/studio/pages/project/[ref]/auth/hooks.tsx
+++ b/apps/studio/pages/project/[ref]/auth/hooks.tsx
@@ -8,6 +8,7 @@ import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import { DocsButton } from 'components/ui/DocsButton'
import NoPermission from 'components/ui/NoPermission'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { GenericSkeletonLoader } from 'ui-patterns'
@@ -33,9 +34,7 @@ const Hooks: NextPageWithLayout = () => {
</ScaffoldContainer>
)
}
-const secondaryActions = [
- <DocsButton key="docs" href="https://supabase.com/docs/guides/auth/auth-hooks" />,
-]
+const secondaryActions = [<DocsButton key="docs" href={`${DOCS_URL}/guides/auth/auth-hooks`} />]
Hooks.getLayout = (page) => (
<DefaultLayout>
diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx
index cc3bd1269d5..d3552118935 100644
--- a/apps/studio/pages/project/[ref]/auth/policies.tsx
+++ b/apps/studio/pages/project/[ref]/auth/policies.tsx
@@ -24,6 +24,7 @@ import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useUrlState } from 'hooks/ui/useUrlState'
import { useIsProtectedSchema } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Input } from 'ui-patterns/DataInputs/Input'
@@ -240,7 +241,7 @@ AuthPoliciesPage.getLayout = (page) => (
title="Policies"
subtitle="Manage Row Level Security policies for your tables"
secondaryActions={
- <DocsButton href="https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security" />
+ <DocsButton href={`${DOCS_URL}/learn/auth-deep-dive/auth-row-level-security`} />
}
size="large"
>
diff --git a/apps/studio/pages/project/[ref]/auth/rate-limits.tsx b/apps/studio/pages/project/[ref]/auth/rate-limits.tsx
index 4b6d186e64d..a58829a8791 100644
--- a/apps/studio/pages/project/[ref]/auth/rate-limits.tsx
+++ b/apps/studio/pages/project/[ref]/auth/rate-limits.tsx
@@ -12,6 +12,7 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { UnknownInterface } from 'components/ui/UnknownInterface'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
const RateLimitsPage: NextPageWithLayout = () => {
@@ -51,7 +52,9 @@ RateLimitsPage.getLayout = (page) => (
title="Rate Limits"
subtitle="Safeguard against bursts of incoming traffic to prevent abuse and maximize stability"
primaryActions={
- <DocsButton href="https://supabase.com/docs/guides/platform/going-into-prod#rate-limiting-resource-allocation--abuse-prevention" />
+ <DocsButton
+ href={`${DOCS_URL}/guides/platform/going-into-prod#rate-limiting-resource-allocation--abuse-prevention`}
+ />
}
>
{page}
diff --git a/apps/studio/pages/project/[ref]/branches/index.tsx b/apps/studio/pages/project/[ref]/branches/index.tsx
index ab2a15e25af..411755feb33 100644
--- a/apps/studio/pages/project/[ref]/branches/index.tsx
+++ b/apps/studio/pages/project/[ref]/branches/index.tsx
@@ -22,6 +22,7 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { useAppStateSnapshot } from 'state/app-state'
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
@@ -223,7 +224,7 @@ BranchesPage.getLayout = (page) => {
Branching Feedback
</a>
</Button>
- <DocsButton href="https://supabase.com/docs/guides/platform/branching" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/branching`} />
</div>
)
diff --git a/apps/studio/pages/project/[ref]/branches/merge-requests.tsx b/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
index 536e5f4a21d..a0fa030ca11 100644
--- a/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
+++ b/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
@@ -27,6 +27,7 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import {
Button,
@@ -386,7 +387,7 @@ const MergeRequestsPageWrapper = ({ children }: PropsWithChildren<{}>) => {
Branching Feedback
</a>
</Button>
- <DocsButton href="https://supabase.com/docs/guides/platform/branching" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/branching`} />
</div>
)
diff --git a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
index 94679b8eeb6..b211f18d665 100644
--- a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
@@ -17,7 +17,7 @@ import { useBackupsQuery } from 'data/database/backups-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useIsOrioleDbInAws, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_ } from 'ui'
import { Admonition } from 'ui-patterns'
@@ -73,7 +73,7 @@ const PITR = () => {
title="Database backups are not available for OrioleDB"
description="OrioleDB is currently in public alpha and projects created are strictly ephemeral with no database backups"
>
- <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ <DocsButton abbrev={false} className="mt-2" href={DOCS_URL} />
</Admonition>
)
}
diff --git a/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx b/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
index 56016f6392c..a95b71e6339 100644
--- a/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
@@ -30,7 +30,7 @@ import {
useIsOrioleDb,
useSelectedProjectQuery,
} from 'hooks/misc/useSelectedProject'
-import { PROJECT_STATUS } from 'lib/constants'
+import { DOCS_URL, PROJECT_STATUS } from 'lib/constants'
import { getDatabaseMajorVersion } from 'lib/helpers'
import type { NextPageWithLayout } from 'types'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Badge, Button } from 'ui'
@@ -269,7 +269,7 @@ const RestoreToNewProject = () => {
<Link
target="_blank"
className="underline"
- href="https://supabase.com/docs/guides/platform/backups"
+ href={`${DOCS_URL}/guides/platform/backups`}
>
in our docs
</Link>
diff --git a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
index b0a3b0c6c80..26662ba7b00 100644
--- a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
@@ -16,6 +16,7 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useBackupsQuery } from 'data/database/backups-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsOrioleDbInAws } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Admonition } from 'ui-patterns'
@@ -47,7 +48,7 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
title="Database backups are not available for OrioleDB"
description="OrioleDB is currently in public alpha and projects created are strictly ephemeral with no database backups"
>
- <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ <DocsButton abbrev={false} className="mt-2" href={`${DOCS_URL}`} />
</Admonition>
) : (
<div className="flex flex-col gap-y-4">
@@ -79,7 +80,7 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
terms of the granular recovery that can be performed.{' '}
<a
className="text-brand transition-colors hover:text-brand-600"
- href="https://supabase.com/docs/guides/platform/backups"
+ href={`${DOCS_URL}/guides/platform/backups`}
>
Learn more
</a>
diff --git a/apps/studio/pages/project/[ref]/database/column-privileges.tsx b/apps/studio/pages/project/[ref]/database/column-privileges.tsx
index 899e0ba4360..6b39bbab9f2 100644
--- a/apps/studio/pages/project/[ref]/database/column-privileges.tsx
+++ b/apps/studio/pages/project/[ref]/database/column-privileges.tsx
@@ -31,6 +31,7 @@ import { useLocalStorage } from 'hooks/misc/useLocalStorage'
import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useIsProtectedSchema } from 'hooks/useProtectedSchemas'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
@@ -227,7 +228,7 @@ const PrivilegesPage: NextPageWithLayout = () => {
<p>Grant or revoke privileges on a column based on user role.</p>
</div>
</div>
- <DocsButton href="https://supabase.com/docs/guides/auth/column-level-security" />
+ <DocsButton href={`${DOCS_URL}/guides/auth/column-level-security`} />
</div>
{isEnabled ? (
diff --git a/apps/studio/pages/project/[ref]/database/functions.tsx b/apps/studio/pages/project/[ref]/database/functions.tsx
index 1ab76e36bb8..83b5f67490e 100644
--- a/apps/studio/pages/project/[ref]/database/functions.tsx
+++ b/apps/studio/pages/project/[ref]/database/functions.tsx
@@ -12,6 +12,7 @@ import { FormHeader } from 'components/ui/Forms/FormHeader'
import NoPermission from 'components/ui/NoPermission'
import { DatabaseFunction } from 'data/database-functions/database-functions-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
const DatabaseFunctionsPage: NextPageWithLayout = () => {
@@ -67,7 +68,7 @@ const DatabaseFunctionsPage: NextPageWithLayout = () => {
<div className="col-span-12">
<FormHeader
title="Database Functions"
- docsUrl="https://supabase.com/docs/guides/database/functions"
+ docsUrl={`${DOCS_URL}/guides/database/functions`}
/>
<FunctionsList
createFunction={createFunction}
diff --git a/apps/studio/pages/project/[ref]/database/indexes.tsx b/apps/studio/pages/project/[ref]/database/indexes.tsx
index b8f936f391f..07d60c9714c 100644
--- a/apps/studio/pages/project/[ref]/database/indexes.tsx
+++ b/apps/studio/pages/project/[ref]/database/indexes.tsx
@@ -2,6 +2,7 @@ import { ExternalLink } from 'lucide-react'
import Indexes from 'components/interfaces/Database/Indexes/Indexes'
import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
+import DefaultLayout from 'components/layouts/DefaultLayout'
import {
ScaffoldContainer,
ScaffoldSection,
@@ -10,9 +11,9 @@ import {
} from 'components/layouts/Scaffold'
import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
-import DefaultLayout from 'components/layouts/DefaultLayout'
const IndexesPage: NextPageWithLayout = () => {
return (
@@ -28,14 +29,14 @@ const IndexesPage: NextPageWithLayout = () => {
<ScaffoldSectionDetail className="flex items-center lg:justify-end gap-2 flex-wrap">
<DocsButton
className="no-underline"
- href="https://supabase.com/docs/guides/database/query-optimization"
+ href={`${DOCS_URL}/guides/database/query-optimization`}
/>
<Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
<a
target="_blank"
rel="noreferrer"
className="no-underline"
- href="https://supabase.com/docs/guides/database/extensions/index_advisor"
+ href={`${DOCS_URL}/guides/database/extensions/index_advisor`}
>
Index Advisor
</a>
diff --git a/apps/studio/pages/project/[ref]/database/migrations.tsx b/apps/studio/pages/project/[ref]/database/migrations.tsx
index 6824c121b0e..e18d46a5bb3 100644
--- a/apps/studio/pages/project/[ref]/database/migrations.tsx
+++ b/apps/studio/pages/project/[ref]/database/migrations.tsx
@@ -1,18 +1,16 @@
-import { ExternalLink } from 'lucide-react'
-
import Migrations from 'components/interfaces/Database/Migrations/Migrations'
import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
+import DefaultLayout from 'components/layouts/DefaultLayout'
import {
ScaffoldContainer,
ScaffoldSection,
ScaffoldSectionContent,
ScaffoldSectionDetail,
} from 'components/layouts/Scaffold'
+import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
-import { Button } from 'ui'
-import { DocsButton } from 'components/ui/DocsButton'
-import DefaultLayout from 'components/layouts/DefaultLayout'
const MigrationsPage: NextPageWithLayout = () => {
return (
@@ -28,7 +26,7 @@ const MigrationsPage: NextPageWithLayout = () => {
<ScaffoldSectionDetail className="flex items-center md:justify-end gap-x-2">
<DocsButton
className="no-underline"
- href="https://supabase.com/docs/guides/deployment/database-migrations"
+ href={`${DOCS_URL}/guides/deployment/database-migrations`}
/>
</ScaffoldSectionDetail>
<div className="col-span-12 mt-3">
diff --git a/apps/studio/pages/project/[ref]/database/triggers.tsx b/apps/studio/pages/project/[ref]/database/triggers.tsx
index e483e2f752c..f08ad5a0f32 100644
--- a/apps/studio/pages/project/[ref]/database/triggers.tsx
+++ b/apps/studio/pages/project/[ref]/database/triggers.tsx
@@ -14,6 +14,7 @@ import { EditorPanel } from 'components/ui/EditorPanel/EditorPanel'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import NoPermission from 'components/ui/NoPermission'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
const TriggersPage: NextPageWithLayout = () => {
@@ -69,7 +70,7 @@ const TriggersPage: NextPageWithLayout = () => {
<FormHeader
title="Database Triggers"
description="Execute a set of actions automatically on specified table events"
- docsUrl="https://supabase.com/docs/guides/database/postgres/triggers"
+ docsUrl={`${DOCS_URL}/guides/database/postgres/triggers`}
/>
<TriggersList
createTrigger={createTrigger}
diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsx
index 7a76544467c..9d68e2471ed 100644
--- a/apps/studio/pages/project/[ref]/functions/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/index.tsx
@@ -15,9 +15,9 @@ import AlertError from 'components/ui/AlertError'
import { DocsButton } from 'components/ui/DocsButton'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
-import { IS_PLATFORM } from 'lib/constants'
+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
-import { Button, Table, TableHead, TableRow, TableHeader, TableBody, Card } from 'ui'
+import { Button, Card, Table, TableBody, TableHead, TableHeader, TableRow } from 'ui'
const EdgeFunctionsPage: NextPageWithLayout = () => {
const { ref } = useParams()
@@ -32,7 +32,7 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
const hasFunctions = (functions ?? []).length > 0
const secondaryActions = [
- <DocsButton key="docs" href="https://supabase.com/docs/guides/functions" />,
+ <DocsButton key="docs" href={`${DOCS_URL}/guides/functions`} />,
<Button asChild key="edge-function-examples" type="default" icon={<ExternalLink />}>
<a
target="_blank"
diff --git a/apps/studio/pages/project/[ref]/integrations/index.tsx b/apps/studio/pages/project/[ref]/integrations/index.tsx
index dcb1a512faa..482c9c835dd 100644
--- a/apps/studio/pages/project/[ref]/integrations/index.tsx
+++ b/apps/studio/pages/project/[ref]/integrations/index.tsx
@@ -14,6 +14,7 @@ import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
import { DocsButton } from 'components/ui/DocsButton'
import NoSearchResults from 'components/ui/NoSearchResults'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Input } from 'ui-patterns/DataInputs/Input'
@@ -50,7 +51,7 @@ const IntegrationsPage: NextPageWithLayout = () => {
subtitle:
'Connect to external data sources and services by querying APIs, databases, and files as if they were Postgres tables.',
secondaryActions: (
- <DocsButton href="https://supabase.com/docs/guides/database/extensions/wrappers/overview" />
+ <DocsButton href={`${DOCS_URL}/guides/database/extensions/wrappers/overview`} />
),
}
case 'postgres_extension':
diff --git a/apps/studio/pages/project/[ref]/realtime/policies.tsx b/apps/studio/pages/project/[ref]/realtime/policies.tsx
index 54dea9feff3..f6a67ce9cc4 100644
--- a/apps/studio/pages/project/[ref]/realtime/policies.tsx
+++ b/apps/studio/pages/project/[ref]/realtime/policies.tsx
@@ -6,6 +6,7 @@ import { PageLayout } from 'components/layouts/PageLayout/PageLayout'
import RealtimeLayout from 'components/layouts/RealtimeLayout/RealtimeLayout'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
const RealtimePoliciesPage: NextPageWithLayout = () => {
return (
@@ -23,9 +24,7 @@ RealtimePoliciesPage.getLayout = (page) => (
<PageLayout
title="Policies"
subtitle="Control access to your realtime channels"
- primaryActions={
- <DocsButton href="https://supabase.com/docs/guides/realtime/authorization" />
- }
+ primaryActions={<DocsButton href={`${DOCS_URL}/guides/realtime/authorization`} />}
size="large"
>
{page}
diff --git a/apps/studio/pages/project/[ref]/realtime/settings.tsx b/apps/studio/pages/project/[ref]/realtime/settings.tsx
index 0dae595dd4f..664d64d0376 100644
--- a/apps/studio/pages/project/[ref]/realtime/settings.tsx
+++ b/apps/studio/pages/project/[ref]/realtime/settings.tsx
@@ -6,6 +6,7 @@ import { PageLayout } from 'components/layouts/PageLayout/PageLayout'
import RealtimeLayout from 'components/layouts/RealtimeLayout/RealtimeLayout'
import { ScaffoldContainer } from 'components/layouts/Scaffold'
import { DocsButton } from 'components/ui/DocsButton'
+import { DOCS_URL } from 'lib/constants'
const RealtimePoliciesPage: NextPageWithLayout = () => {
return (
@@ -22,9 +23,7 @@ RealtimePoliciesPage.getLayout = (page) => (
title="Realtime Settings"
subtitle="Configure your project's Realtime settings"
// [Joshen] Scaffolding for now - once docs for this is ready
- primaryActions={
- <DocsButton href="https://supabase.com/docs/guides/realtime/authorization" />
- }
+ primaryActions={<DocsButton href={`${DOCS_URL}/guides/realtime/authorization`} />}
>
{page}
</PageLayout>
diff --git a/apps/studio/pages/project/[ref]/reports/database.tsx b/apps/studio/pages/project/[ref]/reports/database.tsx
index 1e9c5ea0730..0ba53523e2e 100644
--- a/apps/studio/pages/project/[ref]/reports/database.tsx
+++ b/apps/studio/pages/project/[ref]/reports/database.tsx
@@ -12,6 +12,8 @@ import ReportPadding from 'components/interfaces/Reports/ReportPadding'
import { REPORT_DATERANGE_HELPER_LABELS } from 'components/interfaces/Reports/Reports.constants'
import ReportStickyNav from 'components/interfaces/Reports/ReportStickyNav'
import ReportWidget from 'components/interfaces/Reports/ReportWidget'
+import { ReportChartUpsell } from 'components/interfaces/Reports/v2/ReportChartUpsell'
+import { POOLING_OPTIMIZATIONS } from 'components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants'
import DiskSizeConfigurationModal from 'components/interfaces/Settings/Database/DiskSizeConfigurationModal'
import { LogsDatePicker } from 'components/interfaces/Settings/Logs/Logs.DatePickers'
import UpgradePrompt from 'components/interfaces/Settings/Logs/UpgradePrompt'
@@ -33,17 +35,16 @@ import { useMaxConnectionsQuery } from 'data/database/max-connections-query'
import { usePgbouncerConfigQuery } from 'data/database/pgbouncer-config-query'
import { getReportAttributes, getReportAttributesV2 } from 'data/reports/database-charts'
import { useDatabaseReport } from 'data/reports/database-report-query'
+import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useReportDateRange } from 'hooks/misc/useReportDateRange'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import { formatBytes } from 'lib/helpers'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import type { NextPageWithLayout } from 'types'
import { AlertDescription_Shadcn_, Alert_Shadcn_, Button } from 'ui'
-import { ReportChartUpsell } from 'components/interfaces/Reports/v2/ReportChartUpsell'
-import { POOLING_OPTIMIZATIONS } from 'components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants'
-import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
const DatabaseReport: NextPageWithLayout = () => {
return (
@@ -438,7 +439,7 @@ const DatabaseUsage = () => {
<Button asChild type="default" icon={<ExternalLink />}>
<Link
- href="https://supabase.com/docs/guides/platform/database-size#disk-space-usage"
+ href={`${DOCS_URL}/guides/platform/database-size#disk-space-usage`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/pages/project/[ref]/reports/storage.tsx b/apps/studio/pages/project/[ref]/reports/storage.tsx
index 8135443dc82..fdbbbc2a571 100644
--- a/apps/studio/pages/project/[ref]/reports/storage.tsx
+++ b/apps/studio/pages/project/[ref]/reports/storage.tsx
@@ -28,6 +28,7 @@ import ReportsLayout from 'components/layouts/ReportsLayout/ReportsLayout'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useStorageReport } from 'data/reports/storage-report-query'
import { useReportDateRange } from 'hooks/misc/useReportDateRange'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
export const StorageReport: NextPageWithLayout = () => {
@@ -165,10 +166,7 @@ export const StorageReport: NextPageWithLayout = () => {
The number of storage requests that are cached at the edge level. A higher number of
hits is better.{' '}
<span className="flex items-center gap-1 text-foreground-lighter">
- <Link
- href="https://supabase.com/docs/guides/storage/cdn/fundamentals"
- target="_blank"
- >
+ <Link href={`${DOCS_URL}/guides/storage/cdn/fundamentals`} target="_blank">
Read More
</Link>
<ExternalLinkIcon className="w-3 h-3" />
diff --git a/apps/studio/pages/project/[ref]/settings/log-drains.tsx b/apps/studio/pages/project/[ref]/settings/log-drains.tsx
index b118cf9bccd..259adfc3569 100644
--- a/apps/studio/pages/project/[ref]/settings/log-drains.tsx
+++ b/apps/studio/pages/project/[ref]/settings/log-drains.tsx
@@ -20,6 +20,7 @@ import { LogDrainData, useLogDrainsQuery } from 'data/log-drains/log-drains-quer
import { useUpdateLogDrainMutation } from 'data/log-drains/update-log-drain-mutation'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useCurrentOrgPlan } from 'hooks/misc/useCurrentOrgPlan'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Alert_Shadcn_, Button } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
@@ -88,7 +89,7 @@ const LogDrainsSettings: NextPageWithLayout = () => {
</ScaffoldDescription>
</div>
<div className="flex items-center justify-end gap-2">
- <DocsButton href="https://supabase.com/docs/guides/platform/log-drains" />
+ <DocsButton href={`${DOCS_URL}/guides/platform/log-drains`} />
{!(logDrains?.length === 0) && (
<Button
diff --git a/apps/studio/pages/project/[ref]/storage/buckets/index.tsx b/apps/studio/pages/project/[ref]/storage/buckets/index.tsx
index 941c380c52d..4ca7587160f 100644
--- a/apps/studio/pages/project/[ref]/storage/buckets/index.tsx
+++ b/apps/studio/pages/project/[ref]/storage/buckets/index.tsx
@@ -6,6 +6,7 @@ import StorageLayout from 'components/layouts/StorageLayout/StorageLayout'
import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
import { useBucketsQuery } from 'data/storage/buckets-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { DOCS_URL } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
/**
@@ -25,7 +26,7 @@ const PageLayout: NextPageWithLayout = () => {
<ProductEmptyState
title="Storage"
infoButtonLabel="About storage"
- infoButtonUrl="https://supabase.com/docs/guides/storage"
+ infoButtonUrl={`${DOCS_URL}/guides/storage`}
>
<p className="text-foreground-light text-sm">
Create buckets to store and serve any type of digital content.
diff --git a/apps/studio/pages/support/new.tsx b/apps/studio/pages/support/new.tsx
index 267f2703e23..5a27e29ebb8 100644
--- a/apps/studio/pages/support/new.tsx
+++ b/apps/studio/pages/support/new.tsx
@@ -14,7 +14,7 @@ import InformationBox from 'components/ui/InformationBox'
import { InlineLink, InlineLinkClassName } from 'components/ui/InlineLink'
import { usePlatformStatusQuery } from 'data/platform/platform-status-query'
import { withAuth } from 'hooks/misc/withAuth'
-import { BASE_PATH } from 'lib/constants'
+import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { useQueryState } from 'nuqs'
import { NextPageWithLayout } from 'types'
import { Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
@@ -43,7 +43,7 @@ const SupportPage: NextPageWithLayout = () => {
<div className="flex items-center gap-x-3">
<Button asChild type="default" icon={<Wrench />}>
<Link
- href="https://supabase.com/docs/guides/platform/troubleshooting"
+ href={`${DOCS_URL}/guides/platform/troubleshooting`}
target="_blank"
rel="noreferrer"
>
diff --git a/apps/studio/scripts/download-graphql-schema.mts b/apps/studio/scripts/download-graphql-schema.mts
index 668f9a9b9ec..f703fdf728a 100644
--- a/apps/studio/scripts/download-graphql-schema.mts
+++ b/apps/studio/scripts/download-graphql-schema.mts
@@ -5,8 +5,11 @@ import { fileURLToPath } from 'node:url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
+// Note: This is a build-time script, so we use the fallback URL directly
+const DOCS_URL = process.env.NEXT_PUBLIC_DOCS_URL || 'https://supabase.com/docs'
+
async function downloadGraphQLSchema() {
- const schemaEndpoint = 'https://supabase.com/docs/api/graphql'
+ const schemaEndpoint = `${DOCS_URL}/api/graphql`
const outputPath = path.join(__dirname, './schema.graphql')
const schemaQuery = stripIndent`
@@ -17,7 +20,7 @@ async function downloadGraphQLSchema() {
try {
const response = await fetch(schemaEndpoint, {
- method: 'POST',
+ method: 'POST',
body: JSON.stringify({
query: schemaQuery.trim(),
}),
diff --git a/turbo.json b/turbo.json
index d7ed335d3bb..028863f609c 100644
--- a/turbo.json
+++ b/turbo.json
@@ -56,6 +56,7 @@
"NEXT_PUBLIC_IS_PLATFORM",
"NEXT_PUBLIC_SITE_URL",
"NEXT_PUBLIC_API_URL",
+ "NEXT_PUBLIC_DOCS_URL",
"NEXT_PUBLIC_CONFIGCAT_SDK_KEY",
"NEXT_PUBLIC_CONFIGCAT_PROXY_URL",
"NEXT_PUBLIC_HCAPTCHA_SITE_KEY",