Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/docs/content/_partials/auth_helpers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Admonition type="caution">

The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Read out the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

</Admonition>
8 changes: 3 additions & 5 deletions apps/docs/content/guides/auth/auth-helpers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ description: 'Server-Side Auth guides and utilities for working with Supabase.'
sidebar_label: 'Overview'
---

<Admonition type="caution">

The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Check out the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

</Admonition>
<$Partial
path="auth_helpers.mdx"
/>

Working with server-side frameworks is slightly different to client-side frameworks. In this section we cover the various ways of handling server-side authentication and demonstrate how to use the Supabase helper-libraries to make the process more seamless.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/auth-helpers/auth-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: 'auth-ui'
title: 'Auth UI'
description: 'A prebuilt, customizable React component for authenticating users.'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

<Admonition type="caution">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: 'flutter-auth-ui'
title: 'Flutter Auth UI'
description: 'Prebuilt, customizable Flutter widgets for authenticating users.'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

Flutter Auth UI is a Flutter package containing pre-built widgets for authenticating users.
Expand Down
6 changes: 4 additions & 2 deletions apps/docs/content/guides/auth/auth-helpers/nextjs-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ id: 'nextjs-pages'
title: 'Supabase Auth with Next.js Pages Directory'
description: 'Authentication helpers for Next.js API routes, middleware, and SSR in the Pages Directory.'
sidebar_label: 'Next.js (pages)'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

<Admonition type="caution">

The `auth-helpers` package has been replaced with the `@supabase/ssr` package. We recommend setting up Auth for your Next.js app with `@supabase/ssr` instead. See the [Next.js Server-Side Auth guide](/docs/guides/auth/server-side/nextjs?router=pages) to learn how.
The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Read the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

We recommend setting up Auth for your Next.js app with `@supabase/ssr` instead. Read the [Next.js Server-Side Auth guide](/docs/guides/auth/server-side/nextjs?router=pages) to learn how.

</Admonition>

Expand Down
6 changes: 4 additions & 2 deletions apps/docs/content/guides/auth/auth-helpers/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ id: 'nextjs'
title: 'Supabase Auth with the Next.js App Router'
description: 'Authentication and Authorization helpers for creating an authenticated Supabase client with the Next.js 13 App Router.'
sidebar_label: 'Next.js'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

<Admonition type="caution">

The `auth-helpers` are now deprecated. Use `@supabase/ssr` to set up Auth for your Next.js app. See the [Next.js Server-Side Auth guide](/docs/guides/auth/server-side/nextjs) to learn how.
The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Read the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

We recommend setting up Auth for your Next.js app with `@supabase/ssr` instead. Read the [Next.js Server-Side Auth guide](/docs/guides/auth/server-side/nextjs?router=pages) to learn how.

</Admonition>

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/guides/auth/auth-helpers/remix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ id: 'remix'
title: 'Supabase Auth with Remix'
description: 'Authentication helpers for loaders and actions in Remix.'
sidebar_label: 'Remix'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

<Admonition type="caution">

We generally recommend using the new `@supabase/ssr` package instead of `auth-helpers`. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Check out the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.
The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Read the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

</Admonition>

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/guides/auth/auth-helpers/sveltekit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ id: 'sveltekit'
title: 'Supabase Auth with SvelteKit'
description: 'Convenience helpers for implementing user authentication in SvelteKit.'
sidebar_label: 'SvelteKit'
sitemapPriority: 0.5
sitemapPriority: 0.3
---

<Admonition type="caution">

We generally recommend using the new `@supabase/ssr` package instead of `auth-helpers`. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Check out the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.
The Auth helpers package is deprecated. Use the new `@supabase/ssr` package for Server Side Authentication. `@supabase/ssr` takes the core concepts of the Auth Helpers package and makes them available to any server framework. Read the [migration doc](/docs/guides/auth/server-side/migrating-to-ssr-from-auth-helpers) to learn more.

</Admonition>

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/quickstarts/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hideToc: true
<StepHikeCompact.Details title="Create a Next.js app">

Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with:
- [Cookie-based Auth](/docs/guides/auth/auth-helpers/nextjs)
- [Cookie-based Auth](docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)

Expand Down
8 changes: 3 additions & 5 deletions apps/docs/content/guides/auth/server-side.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ Make sure to use the PKCE flow instructions where those differ from the implicit

We have developed an [`@supabase/ssr`](https://www.npmjs.com/package/@supabase/ssr) package to make setting up the Supabase client as simple as possible. This package is currently in beta. Adoption is recommended but be aware that the API is still unstable and may have breaking changes in the future.

<Admonition type="tip">

If you're currently using the [Auth Helpers package](https://github.com/supabase/auth-helpers), the [docs are still available](/docs/guides/auth/auth-helpers), however we recommend migrating to the new `@supabase/ssr` package as this will be the recommended path moving forward.

</Admonition>
<$Partial
path="auth_helpers.mdx"
/>

## Framework quickstarts

Expand Down
2 changes: 0 additions & 2 deletions apps/docs/content/guides/auth/server-side/advanced-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ In the PKCE flow, a redirect is made to your app, with an Auth Code contained in

To maintain the session, these tokens must be stored in a storage medium securely shared between client and server, which is traditionally cookies. Whenever the session is refreshed, the auth and refresh tokens in the shared storage medium must be updated. Supabase client libraries provide a customizable `storage` option when a client is initiated, allowing you to change where tokens are stored.

For an implementation example, see the [@supabase/ssr](https://github.com/supabase/auth-helpers/blob/main/packages/ssr/src/index.ts) package.

## Frequently asked questions

{/* supa-mdx-lint-disable Rule004ExcludeWords */}
Expand Down
10 changes: 10 additions & 0 deletions apps/docs/content/guides/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ hideToc: true

### Framework quickstarts

<$Show if="docs:framework_quickstarts">

<div className="grid lg:grid-cols-12 gap-6 not-prose">
{[
{
Expand Down Expand Up @@ -211,6 +213,14 @@ hideToc: true
})}
</div>

</$Show>

<$Show if="!quickstarts:hide_nimbus">

<$Partial path="quickstart_nimbus.mdx" />

</$Show>

<$Show if="docs:web_apps">

### Web app demos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hideToc: true
<StepHikeCompact.Details title="Create a Next.js app">

Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with:
- [Cookie-based Auth](/docs/guides/auth/auth-helpers/nextjs)
- [Cookie-based Auth](docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,6 @@ At this stage you have a fully functional application!

- See the complete [example on GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-user-management) and deploy it to Vercel
- [Build a Twitter Clone with the Next.js App Router and Supabase - free egghead course](https://egghead.io/courses/build-a-twitter-clone-with-the-next-js-app-router-and-supabase-19bebadb)
- Explore the [pre-built Auth UI for React](/docs/guides/auth/auth-helpers/auth-ui)
- Explore the [Auth Helpers for Next.js](/docs/guides/auth/auth-helpers/nextjs)
- Explore the [pre-built Auth components](/ui/docs/nextjs/password-based-auth)
- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers)
- See the [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub
3 changes: 1 addition & 2 deletions apps/docs/content/guides/realtime/authorization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ Realtime Authorization is in Public Beta. To use Authorization for your Realtime

<Admonition type="note">

To enforce private channels you need to disable the 'Allow public access' setting in [Realtime Settings](/dashboard/project/_?featurePreviewModal=supabase-ui-realtime-settings)
To enforce private channels you need to disable the 'Allow public access' setting in [Realtime Settings](/dashboard/project/_/realtime/settings)

</Admonition>

## How it works

Realtime uses the `messages` table in your database's `realtime` schema to generate access policies for your clients when they connect to a Channel topic.
Expand Down
6 changes: 0 additions & 6 deletions apps/docs/content/guides/realtime/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ subtitle: 'Realtime Settings that allow you to configure your Realtime usage.'

## Settings

<Admonition type="note">

Realtime settings are currently under Feature Preview section in the dashboard.

</Admonition>

<Admonition type="caution">

All changes made in this screen will disconnect all your connected clients to ensure Realtime starts with the appropriate settings and all changes are stored in Supabase middleware.
Expand Down
45 changes: 39 additions & 6 deletions apps/docs/features/directives/Show.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,51 @@ Content after the show block.
expect(isFeatureEnabled).toHaveBeenCalledWith('test-feature')
})

it('should remove entire $Show block and children when feature is disabled', async () => {
it('should keep children when negated feature is disabled', async () => {
vi.mocked(isFeatureEnabled).mockReturnValue(false)

const markdown = `
# Test content

<$Show if="disabled-feature">
This content should NOT be visible when feature is disabled.
<$Show if="!negated-feature">
This content should be visible when the feature is disabled.

## Additional content

More text that should remain.
</$Show>

Content after the show block.
`.trim()

const mdast = fromDocsMarkdown(markdown)
const transformed = showRemark()(mdast)
const output = toMarkdown(transformed, { extensions: [mdxToMarkdown()] })

const expected = `
# Test content

## This heading should also be removed
This content should be visible when the feature is disabled.

Some more content that should be hidden.
## Additional content

More text that should remain.

Content after the show block.
`.trimStart()

expect(output).toEqual(expected)
expect(isFeatureEnabled).toHaveBeenCalledWith('negated-feature')
})

it('should remove $Show block when negated feature is enabled', async () => {
vi.mocked(isFeatureEnabled).mockReturnValue(true)

const markdown = `
# Test content

<$Show if="!enabled-negated-feature">
This content should NOT be visible because the feature is enabled.
</$Show>

Content after the show block should remain.
Expand All @@ -87,7 +120,7 @@ Content after the show block should remain.
`.trimStart()

expect(output).toEqual(expected)
expect(isFeatureEnabled).toHaveBeenCalledWith('disabled-feature')
expect(isFeatureEnabled).toHaveBeenCalledWith('enabled-negated-feature')
})

it('should handle multiple $Show blocks with different feature flags', async () => {
Expand Down
17 changes: 14 additions & 3 deletions apps/docs/features/directives/Show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,24 @@ export function showRemark() {
if (node.name !== '$Show') return

const parent = ancestors[ancestors.length - 1]
const featureName = getAttributeValue(node, 'if')
const rawFeatureName = getAttributeValue(node, 'if')

if (typeof featureName !== 'string') {
if (typeof rawFeatureName !== 'string') {
throw new Error('$Show directive requires a string value for the "if" attribute')
}

const shouldShow = isFeatureEnabled(featureName as Feature)
const trimmedFeatureName = rawFeatureName.trim()
const isNegated = trimmedFeatureName.startsWith('!')
const normalizedFeatureName = (
isNegated ? trimmedFeatureName.slice(1) : trimmedFeatureName
).trim()

if (!normalizedFeatureName) {
throw new Error('$Show directive requires a non-empty feature name for the "if" attribute')
}

const isEnabled = isFeatureEnabled(normalizedFeatureName as Feature)
const shouldShow = isNegated ? !isEnabled : isEnabled

nodesToProcess.push({
node,
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/internals/files/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const cliSpec = yaml.load(fs.readFileSync(`spec/cli_v1_commands.yaml`, 'utf8'))
* @returns {Array<{link: string}>} - An array of CLI page links.
*/
export function generateCLIPages() {
let cliPages: Array<{ link: string }> = []
let cliPages: Array<{ link: string; priority: number }> = []

cliSpec.commands.map((section: any) => {
const slug = (flatCLISections as any[]).find((item: any) => item.id === section.id)?.slug
if (slug) cliPages.push({ link: `reference/cli/${slug}` })
if (slug) cliPages.push({ link: `reference/cli/${slug}`, priority: 0.8 })
})
return cliPages
}
1 change: 1 addition & 0 deletions apps/docs/internals/files/reference-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export async function generateReferencePages() {
link: isLatestVersion
? `reference/${libPath}/${section.slug}`
: `reference/${libPath}/${version}/${section.slug}`,
priority: 0.8,
})) ?? []
)
})
Expand Down
7 changes: 4 additions & 3 deletions apps/docs/internals/generate-sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function generate() {

return {
link: filePath.replace(/^content\//, '').replace(/\.mdx$/, ''),
priority: sitemapPriority,
priority: sitemapPriority ?? 0.8,
}
})
)
Expand All @@ -40,7 +40,7 @@ async function generate() {
})
)

const allPages = (contentPages as Array<{ link: string; priority?: number }>).concat(
const allPages = (contentPages as Array<{ link: string; priority: number }>).concat(
troubleshootingPages,
referencePages,
cliPages
Expand All @@ -51,11 +51,12 @@ async function generate() {
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${allPages
.map(({ link, priority }) => {
const finalPriority = priority ?? 0.8
return `
<url>
<loc>${`https://supabase.com/docs/${link}`}</loc>
<changefreq>weekly</changefreq>
${priority ? `<priority>${priority}</priority>` : ''}
<priority>${finalPriority}</priority>
</url>
`
})
Expand Down
Loading
Loading