diff --git a/apps/docs/content/guides/ai.mdx b/apps/docs/content/guides/ai.mdx
index c2cfe4743d73f..1c4cc86b92309 100644
--- a/apps/docs/content/guides/ai.mdx
+++ b/apps/docs/content/guides/ai.mdx
@@ -31,7 +31,7 @@ Check out all of the AI [templates and examples](https://github.com/supabase/sup
{/* */}
-export const integrations = [
- {
- name: 'OpenAI',
- description:
- 'OpenAI is an AI research and deployment company. Supabase provides a simple way to use OpenAI in your applications.',
- href: '/guides/ai/examples/building-chatgpt-plugins',
- },
- {
- name: 'Amazon Bedrock',
- description:
- 'A fully managed service that offers a choice of high-performing foundation models from leading AI companies.',
- href: '/guides/ai/integrations/amazon-bedrock',
- },
- {
- name: 'Hugging Face',
- description:
- "Hugging Face is an open-source provider of NLP technologies. Supabase provides a simple way to use Hugging Face's models in your applications.",
- href: '/guides/ai/hugging-face',
- },
- {
- name: 'LangChain',
- description:
- 'LangChain is a language-agnostic, open-source, and self-hosted API for text translation, summarization, and sentiment analysis.',
- href: '/guides/ai/langchain',
- },
- {
- name: 'LlamaIndex',
- description: 'LlamaIndex is a data framework for your LLM applications.',
- href: '/guides/ai/integrations/llamaindex',
- },
-]
-
{/* */}
## Case studies
diff --git a/apps/docs/content/guides/self-hosting.mdx b/apps/docs/content/guides/self-hosting.mdx
index 60d129837edeb..37ac3e9b57190 100644
--- a/apps/docs/content/guides/self-hosting.mdx
+++ b/apps/docs/content/guides/self-hosting.mdx
@@ -34,7 +34,7 @@ The fastest and recommended way to self-host Supabase is using Docker.
There are several other ways to deploy Supabase with the help of community-driven projects. These projects may be outdated and are seeking active maintainers. If you're interested in maintaining one of these projects, [contact the Community team](/open-source/contributing/supasquad).
-export const community = [
- {
- name: 'Kubernetes',
- description: 'Helm charts to deploy a Supabase on Kubernetes.',
- href: 'https://github.com/supabase-community/supabase-kubernetes',
- },
- {
- name: 'Traefik',
- description: 'A self-hosted Supabase setup with Traefik as a reverse proxy.',
- href: 'https://github.com/supabase-community/supabase-traefik',
- },
-]
-
## About self-hosting
Self-hosting is a good fit if you need full control over your data, have compliance requirements that prevent using managed services, or want to run Supabase in an isolated environment.
diff --git a/apps/docs/content/guides/storage.mdx b/apps/docs/content/guides/storage.mdx
index 5139bd5873e32..51b8a466b64b0 100644
--- a/apps/docs/content/guides/storage.mdx
+++ b/apps/docs/content/guides/storage.mdx
@@ -71,7 +71,7 @@ Specialized storage for vector embeddings and similarity search operations. Desi
Check out all of the Storage [templates and examples](https://github.com/supabase/supabase/tree/master/examples/storage) in our GitHub repository.
@@ -82,15 +82,6 @@ Check out all of the Storage [templates and examples](https://github.com/supabas
))}
-export const examples = [
- {
- name: 'Resumable Uploads with Uppy',
- description:
- 'Use Uppy to upload files to Supabase Storage using the TUS protocol (resumable uploads).',
- href: 'https://github.com/supabase/supabase/tree/master/examples/storage/resumable-upload-uppy',
- },
-]
-
## Resources
Find the source code and documentation in the Supabase GitHub repository.
diff --git a/apps/docs/features/docs/MdxBase.tsx b/apps/docs/features/docs/MdxBase.tsx
index 672a49b04ab06..ba2d15b3a540a 100644
--- a/apps/docs/features/docs/MdxBase.tsx
+++ b/apps/docs/features/docs/MdxBase.tsx
@@ -1,17 +1,17 @@
+import { preprocessMdxWithDefaults } from '~/features/directives/utils'
+import { components } from '~/features/docs/MdxBase.shared'
+import { guidesData } from '~/lib/guidesData'
+import { SerializeOptions } from '~/types/next-mdx-remote-serialize'
+import { isFeatureEnabled } from 'common'
import { MDXRemote } from 'next-mdx-remote/rsc'
import { type ComponentProps } from 'react'
import rehypeKatex from 'rehype-katex'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
-import { isFeatureEnabled } from 'common'
-import { preprocessMdxWithDefaults } from '~/features/directives/utils'
-import { components } from '~/features/docs/MdxBase.shared'
-import { SerializeOptions } from '~/types/next-mdx-remote-serialize'
-
const mdxOptions: SerializeOptions = {
+ blockJS: false,
mdxOptions: {
- useDynamicImport: true,
remarkPlugins: [[remarkMath, { singleDollarTextMath: false }], remarkGfm],
rehypePlugins: [rehypeKatex as any],
},
@@ -40,7 +40,7 @@ const MDXRemoteBase = async ({
} = mdxOptions
const finalOptions = {
- scope: { isFeatureEnabled },
+ scope: { isFeatureEnabled, ...guidesData },
...mdxOptions,
...otherOptions,
mdxOptions: {
diff --git a/apps/docs/lib/docs.ts b/apps/docs/lib/docs.ts
index 6e6d44b55e4ff..3e8ea84a746be 100644
--- a/apps/docs/lib/docs.ts
+++ b/apps/docs/lib/docs.ts
@@ -126,8 +126,8 @@ export async function getGuidesStaticProps(
}
const mdxOptions: SerializeOptions = {
+ blockJS: false,
mdxOptions: {
- useDynamicImport: true,
remarkPlugins: [[remarkMath, { singleDollarTextMath: false }], remarkGfm],
rehypePlugins: [rehypeKatex as any],
},
diff --git a/apps/docs/lib/guidesData.ts b/apps/docs/lib/guidesData.ts
new file mode 100644
index 0000000000000..2bf5c7ccc37db
--- /dev/null
+++ b/apps/docs/lib/guidesData.ts
@@ -0,0 +1,102 @@
+/**
+ * Data used in guide MDX files.
+ *
+ * This data is passed to MDX files via scope to avoid using `export const`
+ * within MDX content, which is not supported by next-mdx-remote.
+ *
+ * @see https://github.com/hashicorp/next-mdx-remote#import--export
+ */
+
+export const guidesData = {
+ // apps/docs/content/guides/self-hosting.mdx
+ selfHostingCommunity: [
+ {
+ name: 'Kubernetes',
+ description: 'Helm charts to deploy a Supabase on Kubernetes.',
+ href: 'https://github.com/supabase-community/supabase-kubernetes',
+ },
+ {
+ name: 'Traefik',
+ description: 'A self-hosted Supabase setup with Traefik as a reverse proxy.',
+ href: 'https://github.com/supabase-community/supabase-traefik',
+ },
+ ],
+
+ // apps/docs/content/guides/ai.mdx
+ aiExamples: [
+ {
+ name: 'Headless Vector Search',
+ description:
+ 'A toolkit to perform vector similarity search on your knowledge base embeddings.',
+ href: '/guides/ai/examples/headless-vector-search',
+ },
+ {
+ name: 'Image Search with OpenAI CLIP',
+ description: 'Implement image search with the OpenAI CLIP Model and Supabase Vector.',
+ href: '/guides/ai/examples/image-search-openai-clip',
+ },
+ {
+ name: 'Hugging Face inference',
+ description: 'Generate image captions using Hugging Face.',
+ href: '/guides/ai/examples/huggingface-image-captioning',
+ },
+ {
+ name: 'OpenAI completions',
+ description: 'Generate GPT text completions using OpenAI in Edge Functions.',
+ href: '/guides/ai/examples/openai',
+ },
+ {
+ name: 'Building ChatGPT Plugins',
+ description: 'Use Supabase as a Retrieval Store for your ChatGPT plugin.',
+ href: '/guides/ai/examples/building-chatgpt-plugins',
+ },
+ {
+ name: 'Vector search with Next.js and OpenAI',
+ description:
+ 'Learn how to build a ChatGPT-style doc search powered by Next.js, OpenAI, and Supabase.',
+ href: '/guides/ai/examples/nextjs-vector-search',
+ },
+ ],
+
+ aiIntegrations: [
+ {
+ name: 'OpenAI',
+ description:
+ 'OpenAI is an AI research and deployment company. Supabase provides a simple way to use OpenAI in your applications.',
+ href: '/guides/ai/examples/building-chatgpt-plugins',
+ },
+ {
+ name: 'Amazon Bedrock',
+ description:
+ 'A fully managed service that offers a choice of high-performing foundation models from leading AI companies.',
+ href: '/guides/ai/integrations/amazon-bedrock',
+ },
+ {
+ name: 'Hugging Face',
+ description:
+ "Hugging Face is an open-source provider of NLP technologies. Supabase provides a simple way to use Hugging Face's models in your applications.",
+ href: '/guides/ai/hugging-face',
+ },
+ {
+ name: 'LangChain',
+ description:
+ 'LangChain is a language-agnostic, open-source, and self-hosted API for text translation, summarization, and sentiment analysis.',
+ href: '/guides/ai/langchain',
+ },
+ {
+ name: 'LlamaIndex',
+ description: 'LlamaIndex is a data framework for your LLM applications.',
+ href: '/guides/ai/integrations/llamaindex',
+ },
+ ],
+
+ // apps/docs/content/guides/storage.mdx
+ storageExamples: [
+ {
+ name: 'Resumable Uploads with Uppy',
+ description:
+ 'Use Uppy to upload files to Supabase Storage using the TUS protocol (resumable uploads).',
+ href: 'https://github.com/supabase/supabase/tree/master/examples/storage/resumable-upload-uppy',
+ },
+ ],
+}
diff --git a/apps/docs/lib/mdx/generateRefMarkdown.tsx b/apps/docs/lib/mdx/generateRefMarkdown.tsx
index 75ac7a3d06acb..bd3b03fb4c2aa 100644
--- a/apps/docs/lib/mdx/generateRefMarkdown.tsx
+++ b/apps/docs/lib/mdx/generateRefMarkdown.tsx
@@ -40,13 +40,12 @@ async function generateRefMarkdown(sections: ICommonMarkdown[], slug: string) {
// introPage: introPages.includes(x),
content: content
? await serialize(content ?? '', {
+ blockJS: false,
// MDX's available options, see the MDX docs for more info.
// https://mdxjs.com/packages/mdx/#compilefile-options
mdxOptions: {
- useDynamicImport: true,
remarkPlugins: [remarkGfm],
},
- // Indicates whether or not to parse the frontmatter from the mdx source
})
: null,
})
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 17908a4ff2cc0..298f9686230a7 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -43,8 +43,8 @@
},
"dependencies": {
"@har-sdk/openapi-sampler": "^2.2.0",
- "@mdx-js/loader": "^2.1.5",
- "@mdx-js/react": "^2.3.0",
+ "@mdx-js/loader": "^3.0.0",
+ "@mdx-js/react": "^3.0.0",
"@next/bundle-analyzer": "15.3.1",
"@next/mdx": "15.3.1",
"@octokit/auth-app": "^7.0.0",
@@ -91,7 +91,7 @@
"micromark-extension-gfm": "^2.0.3",
"micromark-extension-mdxjs": "^1.0.0",
"next": "catalog:",
- "next-mdx-remote": "^4.4.1",
+ "next-mdx-remote": "^6.0.0",
"next-plugin-yaml": "^1.0.1",
"next-themes": "^0.3.0",
"nuqs": "^1.19.1",
@@ -108,7 +108,7 @@
"rehype-slug": "^5.1.0",
"remark": "^14.0.2",
"remark-emoji": "^3.1.2",
- "remark-gfm": "^3.0.1",
+ "remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"server-only": "^0.0.1",
"shared-data": "workspace:*",
diff --git a/apps/studio/components/grid/components/header/filter/FilterPopoverNew.tsx b/apps/studio/components/grid/components/header/filter/FilterPopoverNew.tsx
index b4323dde9d5c3..9a731fc4edf2f 100644
--- a/apps/studio/components/grid/components/header/filter/FilterPopoverNew.tsx
+++ b/apps/studio/components/grid/components/header/filter/FilterPopoverNew.tsx
@@ -5,15 +5,15 @@ import { format } from 'date-fns'
import { Loader2 } from 'lucide-react'
import { useCallback, useMemo, useState } from 'react'
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
-import { Button, Calendar } from 'ui'
+import { AiIconAnimation, Button, Calendar } from 'ui'
import {
CustomOptionProps,
FilterBar,
FilterGroup,
FilterOption,
FilterProperty,
- SerializableFilterProperty,
isGroup,
+ SerializableFilterProperty,
updateGroupAtPath,
} from 'ui-patterns'
@@ -190,7 +190,9 @@ export const FilterPopoverNew = ({ isRefetching = false }: FilterPopoverProps) =
[generateFilters, serializableFilterProperties, handleFilterChange, setFreeformText]
)
- const icon = isRefetching ? (
+ const icon = isGenerating ? (
+
+ ) : isRefetching ? (
) : null
diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx
index 19c0031b0966b..a2ef83a4e49e8 100644
--- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx
@@ -1,12 +1,7 @@
import type { PostgresPolicy } from '@supabase/postgres-meta'
+import { useParams } from 'common'
import { noop } from 'lodash'
import { memo, useMemo } from 'react'
-
-import { useParams } from 'common'
-import AlertError from 'components/ui/AlertError'
-import { InlineLink } from 'components/ui/InlineLink'
-import { useTablesRolesAccessQuery } from 'data/tables/tables-roles-access-query'
-import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import {
Card,
CardContent,
@@ -20,10 +15,15 @@ import {
} from 'ui'
import { Admonition } from 'ui-patterns'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
+
import { usePoliciesData } from '../PoliciesDataContext'
import { PolicyRow } from './PolicyRow'
import type { PolicyTable } from './PolicyTableRow.types'
import { PolicyTableRowHeader } from './PolicyTableRowHeader'
+import AlertError from '@/components/ui/AlertError'
+import { InlineLink } from '@/components/ui/InlineLink'
+import { useTablesRolesAccessQuery } from '@/data/tables/tables-roles-access-query'
+import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
export interface PolicyTableRowProps {
table: PolicyTable
@@ -120,7 +120,10 @@ const PolicyTableRowComponent = ({
No data will be selectable via Supabase APIs as this schema is not exposed. You may
configure this in your project’s{' '}
- API settings.
+
+ API settings
+
+ .
)}
diff --git a/apps/studio/components/interfaces/Docs/Authentication.tsx b/apps/studio/components/interfaces/Docs/Authentication.tsx
index 88a063b844da8..aa4d72d166874 100644
--- a/apps/studio/components/interfaces/Docs/Authentication.tsx
+++ b/apps/studio/components/interfaces/Docs/Authentication.tsx
@@ -1,12 +1,13 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import Link from 'next/link'
-
import { useParams } from 'common'
-import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query'
-import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
-import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+
import CodeSnippet from './CodeSnippet'
+import { DocSection } from './DocSection'
import Snippets from './Snippets'
+import { InlineLink } from '@/components/ui/InlineLink'
+import { getKeys, useAPIKeysQuery } from '@/data/api-keys/api-keys-query'
+import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
+import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
interface AuthenticationProps {
selectedLang: 'bash' | 'js'
@@ -35,83 +36,102 @@ const Authentication = ({ selectedLang, showApiKey }: AuthenticationProps) => {
: 'SUPABASE_SERVICE_KEY'
return (
- <>
-
Authentication
-
-
-
Supabase works through a mixture of JWT and Key auth.
-
- If no Authorization header is included, the API will assume that you are
- making a request with an anonymous user.
-
-
- If an Authorization header is included, the API will "switch" to the role
- of the user making the request. See the User Management section for more details.
-
-
We recommend setting your keys as Environment Variables.
-
-
+
+
+
Supabase works through a mixture of JWT and Key auth.
+
+ If no Authorization header is included, the API will assume that you are
+ making a request with an anonymous user.
+
+
+ If an Authorization header is included, the API will "switch" to the role
+ of the user making the request. See the User Management section for more details.
+
+
We recommend setting your keys as Environment Variables.
+ >
+ }
+ />
-
Client API Keys
-
-
-
- Client keys allow "anonymous access" to your database, until the user has logged in.
- After logging in the keys will switch to the user's own login token.
-
-
- In this documentation, we will refer to the key using the name SUPABASE_KEY
- .
-
-
- We have provided you a Client Key to get started. You will soon be able to add as many
- keys as you like. You can find the anon key in the{' '}
- API Settings page.
-
-
-
-
-
-
-
+
+
+ Client keys allow "anonymous access" to your database, until the user has logged in.
+ After logging in the keys will switch to the user's own login token.
+
+
+ In this documentation, we will refer to the key using the name{' '}
+ SUPABASE_KEY.
+
+
+ We have provided you a Client Key to get started. You will soon be able to add as many
+ keys as you like. You can find the anon key in the{' '}
+
+ API Keys Settings
+ {' '}
+ page.
+
+ >
+ }
+ snippets={
+ <>
+
+
+ >
+ }
+ />
-
Service Keys
-
-
-
- Service keys have FULL access to your data, bypassing any security policies. Be VERY
- careful where you expose these keys. They should only be used on a server and never on a
- client or browser.
-
-
- In this documentation, we will refer to the key using the name SERVICE_KEY.
-
-
- We have provided you with a Service Key to get started. Soon you will be able to add as
- many keys as you like. You can find the service_role in the{' '}
- API Settings page.
-
-
-
-
-
-
-
- >
+
+
+ Service keys have FULL access to your data, bypassing any security policies. Be VERY
+ careful where you expose these keys. They should only be used on a server and never on
+ a client or browser.
+
+
+ In this documentation, we will refer to the key using the name{' '}
+ SERVICE_KEY.
+
+
+ We have provided you with a Service Key to get started. Soon you will be able to add
+ as many keys as you like. You can find the service_role in the{' '}
+
+ API Keys Settings
+ {' '}
+ page.
+
+ )
+}
diff --git a/apps/studio/components/interfaces/Docs/Docs.types.ts b/apps/studio/components/interfaces/Docs/Docs.types.ts
index 7ea36375c9086..200dcb6f7c103 100644
--- a/apps/studio/components/interfaces/Docs/Docs.types.ts
+++ b/apps/studio/components/interfaces/Docs/Docs.types.ts
@@ -1,4 +1,4 @@
-export type showApiKey = {
+export type ShowApiKey = {
key: string
name: string
}
diff --git a/apps/studio/components/interfaces/Docs/GeneralContent.tsx b/apps/studio/components/interfaces/Docs/GeneralContent.tsx
index 72be21d3d769c..bb428100c3539 100644
--- a/apps/studio/components/interfaces/Docs/GeneralContent.tsx
+++ b/apps/studio/components/interfaces/Docs/GeneralContent.tsx
@@ -1,8 +1,9 @@
-import Authentication from 'components/interfaces/Docs/Authentication'
-import Introduction from 'components/interfaces/Docs/Introduction'
-import RpcIntroduction from 'components/interfaces/Docs/Pages/Rpc/Introduction'
-import TablesIntroduction from 'components/interfaces/Docs/Pages/Tables/Introduction'
-import { UserManagement } from 'components/interfaces/Docs/Pages/UserManagement'
+import { DocSection } from './DocSection'
+import Authentication from '@/components/interfaces/Docs/Authentication'
+import Introduction from '@/components/interfaces/Docs/Introduction'
+import RpcIntroduction from '@/components/interfaces/Docs/Pages/Rpc/Introduction'
+import TablesIntroduction from '@/components/interfaces/Docs/Pages/Tables/Introduction'
+import { UserManagement } from '@/components/interfaces/Docs/Pages/UserManagement'
interface GeneralContentProps {
page?: string
@@ -21,9 +22,9 @@ export const GeneralContent = ({ selectedLang, page, showApiKey }: GeneralConten
if (selected == 'rpc-intro') return
else
return (
-
-
Not found
-
Looks like you went somewhere that nobody knows.
-
+ Looks like you went somewhere that nobody knows.}
+ />
)
}
diff --git a/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx b/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
index 6605631c78e18..9460c6d2e448e 100644
--- a/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
+++ b/apps/studio/components/interfaces/Docs/GeneratingTypes.tsx
@@ -1,21 +1,22 @@
+import { useParams } from 'common'
import { Download } from 'lucide-react'
-import Link from 'next/link'
import { useState } from 'react'
import { toast } from 'sonner'
-
-import { useParams } from 'common'
-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'
+import { DocSection } from './DocSection'
+import CodeSnippet from '@/components/interfaces/Docs/CodeSnippet'
+import { DocsButton } from '@/components/ui/DocsButton'
+import { InlineLink } from '@/components/ui/InlineLink'
+import { useProjectPostgrestConfigQuery } from '@/data/config/project-postgrest-config-query'
+import { generateTypes } from '@/data/projects/project-type-generation-query'
+import { DOCS_URL } from '@/lib/constants'
+
interface Props {
selectedLang: 'bash' | 'js'
}
-export default function GeneratingTypes({ selectedLang }: Props) {
+export function GeneratingTypes({ selectedLang }: Props) {
const { ref } = useParams()
const [isGeneratingTypes, setIsGeneratingTypes] = useState(false)
@@ -41,42 +42,48 @@ export default function GeneratingTypes({ selectedLang }: Props) {
}
return (
- <>
-
- Generating types
-
-
-
-
+
+ Generating types
+
+
+ }
+ content={
+ <>
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, or
- by downloading the types file via the button on the right and importing it in your
+
+ Supabase CLI
+
+ , or by downloading the types file via the button on the right and importing it in your
application within src/index.ts.
+ }
+ />
)
}
diff --git a/apps/studio/components/interfaces/Docs/Introduction.tsx b/apps/studio/components/interfaces/Docs/Introduction.tsx
index 18ee355957d3b..49bc91da599ad 100644
--- a/apps/studio/components/interfaces/Docs/Introduction.tsx
+++ b/apps/studio/components/interfaces/Docs/Introduction.tsx
@@ -1,11 +1,12 @@
import { useParams } from 'common'
-import Snippets from 'components/interfaces/Docs/Snippets'
-import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'
-import { InlineLink } from 'components/ui/InlineLink'
-import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import CodeSnippet from './CodeSnippet'
+import { DocSection } from './DocSection'
import PublicSchemaNotEnabledAlert from './PublicSchemaNotEnabledAlert'
+import Snippets from '@/components/interfaces/Docs/Snippets'
+import { InlineLink } from '@/components/ui/InlineLink'
+import { useProjectPostgrestConfigQuery } from '@/data/config/project-postgrest-config-query'
+import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
interface Props {
selectedLang: 'bash' | 'js'
@@ -27,26 +28,31 @@ export default function Introduction({ selectedLang }: Props) {
.includes('public')
return (
- <>
-
Connect to your project
-
-
+
All projects have a RESTful endpoint that you can use with your project's API key to
query and manage your database. These can be obtained from the{' '}
- API settings.
+
+ API settings
+
+ .
You can initialize a new Supabase client using the createClient() method.
The Supabase client is your entrypoint to the rest of the Supabase functionality and is
the easiest way to interact with everything we offer within the Supabase ecosystem.
All of your database stored procedures are available on your API. This means you can
build your logic directly into the database (if you're brave enough)!
The API endpoint supports POST (and in some cases GET) to execute the function.
-
-
- >
+ >
+ }
+ />
)
}
diff --git a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
index b8c130e216ede..b5a2e9e019f26 100644
--- a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
+++ b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx
@@ -1,10 +1,11 @@
import { useParams } from 'common'
-import Link from 'next/link'
-import CodeSnippet from 'components/interfaces/Docs/CodeSnippet'
-import GeneratingTypes from 'components/interfaces/Docs/GeneratingTypes'
-import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'
+import { DocSection } from '../../DocSection'
import PublicSchemaNotEnabledAlert from '../../PublicSchemaNotEnabledAlert'
+import CodeSnippet from '@/components/interfaces/Docs/CodeSnippet'
+import { GeneratingTypes } from '@/components/interfaces/Docs/GeneratingTypes'
+import { InlineLink } from '@/components/ui/InlineLink'
+import { useProjectPostgrestConfigQuery } from '@/data/config/project-postgrest-config-query'
interface IntroductionProps {
selectedLang: 'bash' | 'js'
@@ -21,62 +22,65 @@ const Introduction = ({ selectedLang }: IntroductionProps) => {
.includes('public')
return (
- <>
-
Introduction
-
-
+
+
All views and tables in the public schema and accessible by the active
database role for a request are available for querying.
-
-
- {isSuccess && !isPublicSchemaEnabled && }
-
-
-
+
If you don't want to expose tables in your API, simply add them to a different schema
(not the public schema).
-
-
-
+ }
+ />
-
- GraphQL vs Supabase
-
-
-
-
- If you have a GraphQL background, you might be wondering if you can fetch your data in a
- single round-trip. The answer is yes!
-
-
- The syntax is very similar. This example shows how you might achieve the same thing with
- Apollo GraphQL and Supabase.
-
-
-
-
Still want GraphQL?
-
- If you still want to use GraphQL, you can. Supabase provides you with a full Postgres
- database, so as long as your middleware can connect to the database then you can still
- use the tools you love. You can find the database connection details{' '}
- in the settings.
-
+ If you have a GraphQL background, you might be wondering if you can fetch your data in
+ a single round-trip. The answer is yes!
+
+
+ The syntax is very similar. This example shows how you might achieve the same thing
+ with Apollo GraphQL and Supabase.
+
+
Still want GraphQL?
+
+ If you still want to use GraphQL, you can. Supabase provides you with a full Postgres
+ database, so as long as your middleware can connect to the database then you can still
+ use the tools you love. You can find the database connection details{' '}
+
+ in the settings.
+
+
+ >
+ }
+ snippets={
+ <>
+
+
+ >
+ }
+ />
+
)
}
diff --git a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
index 35a056b4a0226..776c904d21a04 100644
--- a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
+++ b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
@@ -1,13 +1,14 @@
-import Link from 'next/link'
+import { useParams } from 'common'
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 { DocSection } from '../DocSection'
import Snippets from '../Snippets'
+import { InlineLink } from '@/components/ui/InlineLink'
+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'
const randomPassword = makeRandomString(20)
@@ -31,158 +32,172 @@ export const UserManagement = ({ selectedLang, showApiKey }: UserManagementProps
const endpoint = `${protocol}://${hostEndpoint ?? ''}`
return (
- <>
-
User Management
-
-
-
Supabase makes it easy to manage your users.
-
- Supabase assigns each user a unique ID. You can reference this ID anywhere in your
- database. For example, you might create a profiles table references the
- user using a user_id field.
-
-
- Supabase already has built in the routes to sign up, login, and log out for managing
- users in your apps and websites.
-
-
-
+
+
+
Supabase makes it easy to manage your users.
+
+ Supabase assigns each user a unique ID. You can reference this ID anywhere in your
+ database. For example, you might create a profiles table that references
+ the user using a user_id field.
+
+
+ Supabase already has built in the routes to sign up, login, and log out for managing
+ users in your apps and websites.
+
+ >
+ }
+ />
-
Sign up
-
-
-
Allow your users to sign up and create a new account.
-
- After they have signed up, all interactions using the Supabase JS client will be
- performed as "that user".
-
-
-
+
+
Allow your users to sign up and create a new account.
+
+ After they have signed up, all interactions using the Supabase JS client will be
+ performed as "that user".
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
-
Log in with Email/Password
-
-
-
If an account is created, users can login to your app.
-
- After they have logged in, all interactions using the Supabase JS client will be
- performed as "that user".
-
-
-
+
+
If an account is created, users can login to your app.
+
+ After they have logged in, all interactions using the Supabase JS client will be
+ performed as "that user".
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
-
Log in with Magic Link via Email
-
-
-
Send a user a passwordless link which they can use to redeem an access_token.
-
- After they have clicked the link, all interactions using the Supabase JS client will be
- performed as "that user".
-
-
-
+
+
Send a user a passwordless link which they can use to redeem an access_token.
+
+ After they have clicked the link, all interactions using the Supabase JS client will
+ be performed as "that user".
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
-
Sign Up with Phone/Password
-
-
-
- A phone number can be used instead of an email as a primary account confirmation
- mechanism.
-
-
- The user will receive a mobile OTP via sms with which they can verify that they control
- the phone number.
-
-
- You must enter your own twilio credentials on the auth settings page to enable sms
- confirmations.
-
-
-
+
+
+ A phone number can be used instead of an email as a primary account confirmation
+ mechanism.
+
+
+ The user will receive a mobile OTP via sms with which they can verify that they
+ control the phone number.
+
+
+ You must enter your own twilio credentials on the auth settings page to enable sms
+ confirmations.
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
-
Login via SMS OTP
-
-
-
- SMS OTPs work like magic links, except you have to provide an interface for the user to
- verify the 6 digit number they receive.
-
-
- You must enter your own twilio credentials on the auth settings page to enable SMS-based
- Logins.
-
-
-
+
+
+ SMS OTPs work like magic links, except you have to provide an interface for the user
+ to verify the 6 digit number they receive.
+
+
+ You must enter your own twilio credentials on the auth settings page to enable
+ SMS-based Logins.
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
-
Verify an SMS OTP
-
-
-
- Once the user has received the OTP, have them enter it in a form and send it for
- verification
-
-
- You must enter your own twilio credentials on the auth settings page to enable SMS-based
- OTP verification.
-
-
-
+
+
+ Once the user has received the OTP, have them enter it in a form and send it for
+ verification
+
+
+ You must enter your own twilio credentials on the auth settings page to enable
+ SMS-based OTP verification.
+
Users can log in with Third Party OAuth like Google, Facebook, GitHub, and more. You
must first enable each of these in the Auth Providers settings{' '}
-
+
here
-
+ {' '}
.
After they have logged in, all interactions using the Supabase JS client will be
@@ -190,131 +205,111 @@ export const UserManagement = ({ selectedLang, showApiKey }: UserManagementProps
-
-
+ Get the JSON object for the logged in user.}
+ snippets={
-
-
+ }
+ />
-
Forgotten Password Email
-
-
+
Sends the user a log in link via email. Once logged in you should direct the user to a
new password form. And use "Update User" below to save the new password.
-
-
+ }
+ snippets={
-
-
+ }
+ />
-
Update User
-
-
+
Update the user with a new email or password. Each key (email, password, and data) is
optional
-
-
+ }
+ snippets={
-
-
+ }
+ />
-
Log out
-
-
+
After calling log out, all interactions using the Supabase JS client will be
"anonymous".
-
-
+ }
+ snippets={
-
-
+ }
+ />
-
Send a User an Invite over Email
-
-
-
Send a user a passwordless link which they can use to sign up and log in.
-
- After they have clicked the link, all interactions using the Supabase JS client will be
- performed as "that user".
-
-
- This endpoint requires you use the service_role_key when initializing the
- client, and should only be invoked from the server, never from the client.
-
-
-
+
+
Send a user a passwordless link which they can use to sign up and log in.
+
+ After they have clicked the link, all interactions using the Supabase JS client will
+ be performed as "that user".
+
+
+ This endpoint requires you use the service_role_key when initializing the
+ client, and should only be invoked from the server, never from the client.
+
+ >
+ }
+ snippets={
-
-
- >
+ }
+ />
+
)
}
diff --git a/apps/studio/components/interfaces/Docs/Param.tsx b/apps/studio/components/interfaces/Docs/Param.tsx
index 88ebeda3f46b3..41ef4b7d5bfcd 100644
--- a/apps/studio/components/interfaces/Docs/Param.tsx
+++ b/apps/studio/components/interfaces/Docs/Param.tsx
@@ -1,8 +1,7 @@
import { noop } from 'lodash'
import { Badge } from 'ui'
-import Description from 'components/interfaces/Docs/Description'
-import { Code, Database } from 'lucide-react'
+import Description from '@/components/interfaces/Docs/Description'
function getColumnType(type: string, format: string) {
// json and jsonb both have type=undefined, so check format instead
@@ -43,65 +42,35 @@ const Param = ({
onDesciptionUpdated = noop,
}: ParamProps) => {
return (
- <>
-
-
-
-
-
-
- {name}
-
-
-
+
+
+
{name}
{required ? 'Required' : 'Optional'}
{format && (
-
-
-
-
-
-
-
- {getColumnType(type, format)}
-
-
-
-
-
-
-
-
-
-
- {format}
-
-
-
-
-
- )}
- {description !== false && (
-
-
-
+
+
+
{getColumnType(type, format)}
+
+
{format}
+ {description !== false && (
+ <>
+
+
+
+
+ >
+ )}
)}
- >
+
)
}
export default Param
diff --git a/apps/studio/components/interfaces/Docs/ResourceContent.tsx b/apps/studio/components/interfaces/Docs/ResourceContent.tsx
index e055021341248..f5f58076ab591 100644
--- a/apps/studio/components/interfaces/Docs/ResourceContent.tsx
+++ b/apps/studio/components/interfaces/Docs/ResourceContent.tsx
@@ -1,14 +1,16 @@
+import { useParams } from 'common'
import { Table2 } from 'lucide-react'
-import { useParams } from 'common'
-import CodeSnippet from 'components/interfaces/Docs/CodeSnippet'
-import Description from 'components/interfaces/Docs/Description'
-import Param from 'components/interfaces/Docs/Param'
-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'
+import { DocSection } from './DocSection'
+import CodeSnippet from '@/components/interfaces/Docs/CodeSnippet'
+import Description from '@/components/interfaces/Docs/Description'
+import Param from '@/components/interfaces/Docs/Param'
+import Snippets from '@/components/interfaces/Docs/Snippets'
+import { InlineLink } from '@/components/ui/InlineLink'
+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
@@ -55,32 +57,35 @@ export const ResourceContent = ({
if (!paths || !definitions) return null
return (
- <>
-
insert lets you insert into your tables. You can also insert in bulk
and do UPSERT.
@@ -188,16 +181,12 @@ export const ResourceContent = ({
insert will also return the replaced values for UPSERT.
update lets you update rows. update will match all rows by
default. You can update specific rows using horizontal filters, e.g. eq
@@ -228,73 +218,61 @@ export const ResourceContent = ({
update will also return the replaced values for UPDATE.
)
}
diff --git a/apps/studio/components/interfaces/Docs/RpcContent.tsx b/apps/studio/components/interfaces/Docs/RpcContent.tsx
index 8f02ea9ee4823..5fb8d1ac6f69a 100644
--- a/apps/studio/components/interfaces/Docs/RpcContent.tsx
+++ b/apps/studio/components/interfaces/Docs/RpcContent.tsx
@@ -1,10 +1,12 @@
import { useParams } from 'common'
-import CodeSnippet from 'components/interfaces/Docs/CodeSnippet'
-import Description from 'components/interfaces/Docs/Description'
-import Param from 'components/interfaces/Docs/Param'
-import Snippets from 'components/interfaces/Docs/Snippets'
-import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
-import { ProjectJsonSchemaPaths } from 'data/docs/project-json-schema-query'
+
+import { DocSection } from './DocSection'
+import CodeSnippet from '@/components/interfaces/Docs/CodeSnippet'
+import Description from '@/components/interfaces/Docs/Description'
+import Param from '@/components/interfaces/Docs/Param'
+import Snippets from '@/components/interfaces/Docs/Snippets'
+import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
+import { ProjectJsonSchemaPaths } from '@/data/docs/project-json-schema-query'
/**
* TODO: need to support rpc with the same name and different params type
@@ -50,17 +52,18 @@ export const RpcContent = ({
if (!path) return null
return (
- <>
-
- {meta.id}
-
-
-
-
-
-
-
-
+
+
+
+
+ >
+ }
+ snippets={
-
-
+ }
+ />
+
{rpcParams.length > 0 && (
-
-
Function Arguments
+
+
{rpcParams.map((x, i) => {
return (
-
-
+
-
-
-
+ }
+ />
)
})}
)}
- >
+
)
}
diff --git a/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx b/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
index 55b77743b2155..44db9c1c7dc16 100644
--- a/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
+++ b/apps/studio/components/interfaces/Home/NewProjectPanel/NewProjectPanel.tsx
@@ -1,17 +1,17 @@
-import { ExternalLink, Settings } from 'lucide-react'
-import Link from 'next/link'
-
import { useParams } from 'common'
-import { DocsButton } from 'components/ui/DocsButton'
-import { InlineLink } from 'components/ui/InlineLink'
-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 { ExternalLink, Settings } from 'lucide-react'
+import Link from 'next/link'
import { Button } from 'ui'
+
import { APIKeys } from './APIKeys'
import { GetStartedHero } from './GetStartedHero'
+import { DocsButton } from '@/components/ui/DocsButton'
+import { InlineLink } from '@/components/ui/InlineLink'
+import Panel from '@/components/ui/Panel'
+import { EditorIndexPageLink } from '@/data/prefetchers/project.$ref.editor'
+import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
+import { DOCS_URL } from '@/lib/constants'
export const NewProjectPanel = () => {
const { ref } = useParams()
@@ -222,7 +222,7 @@ export const NewProjectPanel = () => {