mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
## Problem Restructure the topic based off of the PRed Style Guide. ## Solution - **Group the seven sections into three.** A concept opener, `Choose an auth mode`, holds the mode table. `Secure your function` holds the six patterns. `Environment variables` stays last as the fact group. - **Add an intro outline** linking the three groups, and a group introduction for the patterns. - **Move the Authorization headers link below the mode table**, so the sentence that introduces the table sits next to it. - **Correct the content listing entry** to match the page's own title. **Anchors:** every heading text is unchanged. Five headings move from `##` to `###`, which preserves the slug. The in-page link to `#external-webhooks` and the two existing redirects in `apps/www/lib/redirects.js` all still resolve. Verified by grepping the repo for `functions/auth#` before and after. ## Preview links | Site | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | Docs | [/docs/guides/functions/auth](https://supabase.com/docs/guides/functions/auth) | [/docs/guides/functions/auth](https://docs-git-docs-functions-auth-structure-supabase.vercel.app/docs/guides/functions/auth) | Choose an auth mode | | Docs | [/docs/guides/functions](https://supabase.com/docs/guides/functions) | [/docs/guides/functions](https://docs-git-docs-functions-auth-structure-supabase.vercel.app/docs/guides/functions) | Securing Edge Functions | ## Review instructions 1. Open the live and preview links side-by-side. 2. See three top-level entries in the preview's table of contents, with six nested under `Secure your function`. 3. Load `/docs/guides/functions/auth#external-webhooks` on the preview. See the page jump to that section. 4. Open the second preview link. See the listing card read "Securing Edge Functions" rather than "With supabase-js". ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which references [WORD_LIST](https://github.com/supabase/supabase/blob/master/apps/docs/WORD_LIST.md) and the docs [CONTRIBUTING](https://github.com/supabase/supabase/blob/master/apps/docs/CONTRIBUTING.md) guide <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Reorganized the authentication guide with a table of contents and clearer sections on choosing an auth mode and securing a function. * Clarified that the guide covers all supported auth modes, combining modes, and custom error responses. * Renamed the guide listing to “Securing Edge Functions” and updated its description to mention declaring accepted credentials. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
212 lines
7.1 KiB
TypeScript
212 lines
7.1 KiB
TypeScript
import type { ContentListingGroup } from '~/lib/content-listings.schema'
|
|
|
|
export const functionsGetStarted: ContentListingGroup = {
|
|
id: 'functions-get-started',
|
|
heading: 'Get started',
|
|
type: 'grid',
|
|
columns: 2,
|
|
items: [
|
|
{
|
|
title: 'Edge Functions quickstart',
|
|
href: '/guides/functions/quickstart',
|
|
description: 'Create, test, and deploy your first Edge Function with the Supabase CLI.',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const functionsExamplesSupabase: ContentListingGroup = {
|
|
id: 'functions-examples-supabase',
|
|
heading: 'Supabase integration',
|
|
headingLevel: 'h3',
|
|
type: 'grid',
|
|
items: [
|
|
{
|
|
title: 'Securing Edge Functions',
|
|
href: '/guides/functions/auth',
|
|
description: 'Declare which credentials your Edge Function accepts.',
|
|
},
|
|
{
|
|
title: 'Connect to Postgres',
|
|
href: '/guides/functions/connect-to-postgres',
|
|
description: 'Connect to Postgres from Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Type-Safe SQL with Kysely',
|
|
href: '/guides/functions/kysely-postgres',
|
|
description:
|
|
'Combine Kysely with Deno Postgres for a convenient developer experience when interacting directly with your Postgres database.',
|
|
},
|
|
{
|
|
title: 'With CORS headers',
|
|
href: '/guides/functions/cors',
|
|
description: 'Send CORS headers for invoking from the browser.',
|
|
},
|
|
{
|
|
title: 'Building a RESTful Service API',
|
|
href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/restful-tasks/index.ts',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description:
|
|
'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.',
|
|
},
|
|
{
|
|
title: 'Oak Server Middleware',
|
|
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/oak-server',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Route requests with Oak server middleware.',
|
|
},
|
|
{
|
|
title: 'Web Stream',
|
|
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/streams',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Stream Server-Sent Events from Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Get User Location',
|
|
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/location',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: "Get user location data from user's IP address.",
|
|
},
|
|
{
|
|
title: 'Working with Supabase Storage',
|
|
href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/read-storage/index.ts',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Read a file from Supabase Storage.',
|
|
},
|
|
{
|
|
title: 'Upload File',
|
|
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/file-upload-storage',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Process multipart/form-data.',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const functionsExamplesWebhooksPayments: ContentListingGroup = {
|
|
id: 'functions-examples-webhooks-payments',
|
|
heading: 'Webhooks & payments',
|
|
headingLevel: 'h3',
|
|
type: 'grid',
|
|
items: [
|
|
{
|
|
title: 'Stripe Webhooks',
|
|
href: '/guides/functions/examples/stripe-webhooks',
|
|
description: 'Handle signed Stripe webhooks with Edge Functions.',
|
|
},
|
|
{
|
|
title: 'React Native with Stripe',
|
|
href: 'https://github.com/supabase-community/expo-stripe-payments-with-supabase-functions',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Use Supabase and Stripe in a React Native app with Expo.',
|
|
},
|
|
{
|
|
title: 'Flutter with Stripe',
|
|
href: 'https://github.com/supabase-community/flutter-stripe-payments-with-supabase-functions',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Use Supabase and Stripe in a Flutter app.',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const functionsExamplesAiMedia: ContentListingGroup = {
|
|
id: 'functions-examples-ai-media',
|
|
heading: 'AI & media',
|
|
headingLevel: 'h3',
|
|
type: 'grid',
|
|
items: [
|
|
{
|
|
title: 'Hugging Face',
|
|
href: '/guides/ai/examples/huggingface-image-captioning',
|
|
description: 'Access 100,000+ Machine Learning models.',
|
|
},
|
|
{
|
|
title: 'OpenAI',
|
|
href: '/guides/ai/examples/openai',
|
|
description: 'Use OpenAI in Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Amazon Bedrock',
|
|
href: '/guides/functions/examples/amazon-bedrock-image-generator',
|
|
description: 'Generate images with Amazon Bedrock in Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Open Graph Image Generation',
|
|
href: '/guides/functions/examples/og-image',
|
|
description: 'Generate Open Graph images with Deno and Supabase Edge Functions.',
|
|
},
|
|
{
|
|
title: 'OG Image Generation & Storage CDN Caching',
|
|
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/og-image-with-storage-cdn',
|
|
icon: '/docs/img/icons/github-icon',
|
|
description: 'Cache generated images with Supabase Storage CDN.',
|
|
},
|
|
{
|
|
title: 'Puppeteer',
|
|
href: '/guides/functions/examples/screenshots',
|
|
description: 'Generate screenshots with Puppeteer.',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const functionsExamplesMessaging: ContentListingGroup = {
|
|
id: 'functions-examples-messaging',
|
|
heading: 'Bots & email',
|
|
headingLevel: 'h3',
|
|
type: 'grid',
|
|
items: [
|
|
{
|
|
title: 'Send emails',
|
|
href: '/guides/functions/examples/send-emails',
|
|
description: 'Send emails in Edge Functions with Resend.',
|
|
},
|
|
{
|
|
title: 'Discord Bot',
|
|
href: '/guides/functions/examples/discord-bot',
|
|
description: 'Build a slash command Discord bot with Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Telegram Bot',
|
|
href: '/guides/functions/examples/telegram-bot',
|
|
description: 'Build a Telegram bot with Edge Functions.',
|
|
},
|
|
{
|
|
title: 'Slack Bot Mention Edge Function',
|
|
href: '/guides/functions/examples/slack-bot-mention',
|
|
description: 'Handle Slack mentions in a Slack bot Edge Function.',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const functionsExamplesOperations: ContentListingGroup = {
|
|
id: 'functions-examples-operations',
|
|
heading: 'Operations & security',
|
|
headingLevel: 'h3',
|
|
type: 'grid',
|
|
items: [
|
|
{
|
|
title: 'Monitoring with Sentry',
|
|
href: '/guides/functions/examples/sentry-monitoring',
|
|
description: 'Monitor Edge Functions with the Sentry Deno SDK.',
|
|
},
|
|
{
|
|
title: 'GitHub Actions',
|
|
href: '/guides/functions/examples/github-actions',
|
|
description: 'Deploy Edge Functions with GitHub Actions.',
|
|
},
|
|
{
|
|
title: 'Upstash Redis',
|
|
href: '/guides/functions/examples/upstash-redis',
|
|
description: 'Build an Edge Functions Counter with Upstash Redis.',
|
|
},
|
|
{
|
|
title: 'Rate Limiting',
|
|
href: '/guides/functions/examples/rate-limiting',
|
|
description: 'Rate-limit Edge Functions with Upstash Redis.',
|
|
},
|
|
{
|
|
title: 'Cloudflare Turnstile',
|
|
href: '/guides/functions/examples/cloudflare-turnstile',
|
|
description: 'Protect forms with Cloudflare Turnstile.',
|
|
},
|
|
],
|
|
}
|