The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: Update old Deno usage (#45934)
Chris Chinchilla2024855c8de0
diff --git a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdxindex 11f0672f9d6..b6b7b05ea47 100644--- a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx+++ b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx@@ -39,9 +39,9 @@ supabase gen types typescript --project-id=your-project-ref --schema=storage,pubFind the complete code on [GitHub](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/huggingface-image-captioning).```ts-import { serve } from 'https://deno.land/[email protected]/http/server.ts'import { HfInference } from 'https://esm.sh/@huggingface/[email protected]'import { createClient } from 'npm:@supabase/supabase-js@2'+import { Database } from './types.ts'console.log('Hello from `huggingface-image-captioning` function!')@@ -57,7 +57,7 @@ interface WebhookPayload {old_record: null | SoRecord}-serve(async (req) => {+Deno.serve(async (req) => {const payload: WebhookPayload = await req.json()const soRecord = payload.recordconst SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!)diff --git a/apps/docs/content/guides/ai/hugging-face.mdx b/apps/docs/content/guides/ai/hugging-face.mdxindex 424c16dc55c..082a73a1370 100644--- a/apps/docs/content/guides/ai/hugging-face.mdx+++ b/apps/docs/content/guides/ai/hugging-face.mdx@@ -94,12 +94,11 @@ HUGGING_FACE_ACCESS_TOKEN=<your-token-here>Let's modify the Edge Function to import Hugging Face's inference client and perform a `text-to-image` request:```ts-import { serve } from 'https://deno.land/[email protected]/http/server.ts'import { HfInference } from 'https://esm.sh/@huggingface/[email protected]'const hf = new HfInference(Deno.env.get('HUGGING_FACE_ACCESS_TOKEN'))-serve(async (req) => {+Deno.serve(async (req) => {const { prompt } = await req.json()const image = await hf.textToImage(diff --git a/apps/docs/content/guides/auth/oauth-server/token-security.mdx b/apps/docs/content/guides/auth/oauth-server/token-security.mdxindex 069d6098c1f..b5da836eb94 100644--- a/apps/docs/content/guides/auth/oauth-server/token-security.mdx+++ b/apps/docs/content/guides/auth/oauth-server/token-security.mdx@@ -182,9 +182,7 @@ Custom Access Token Hooks are triggered for **all** token issuance. Use `client_A common use case is customizing the `audience` claim for different OAuth clients. This allows third-party services to validate that tokens were issued specifically for them:```typescript-import { serve } from 'https://deno.land/[email protected]/http/server.ts'--serve(async (req) => {+Deno.serve(async (req) => {const { user, claims, client_id } = await req.json()// Customize audience based on OAuth client@@ -230,10 +228,9 @@ The `audience` claim is especially important for:You can also add custom claims and metadata based on the OAuth client:```typescript-import { serve } from 'https://deno.land/[email protected]/http/server.ts'import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'-serve(async (req) => {+Deno.serve(async (req) => {const { user, claims, client_id } = await req.json()const supabase = createClient(Deno.env.get('SUPABASE_URL')!, Deno.env.get('SUPABASE_SECRET_KEY')!)diff --git a/apps/docs/content/guides/functions/kysely-postgres.mdx b/apps/docs/content/guides/functions/kysely-postgres.mdxindex 22f4e09ecbf..a8930899f96 100644--- a/apps/docs/content/guides/functions/kysely-postgres.mdx+++ b/apps/docs/content/guides/functions/kysely-postgres.mdx@@ -34,6 +34,7 @@ GET YOUR CERT FROM YOUR PROJECT DASHBOARDCreate a `DenoPostgresDriver.ts` file to manage the connection to Postgres via [deno-postgres](https://deno-postgres.com/):```ts DenoPostgresDriver.ts+import { Pool, PoolClient } from 'https://deno.land/x/[email protected]/mod.ts'import {CompiledQuery,DatabaseConnection,@@ -44,7 +45,6 @@ import {} from 'https://esm.sh/[email protected]'import { freeze, isFunction } from 'https://esm.sh/[email protected]/dist/esm/util/object-utils.js'import { extendStackTrace } from 'https://esm.sh/[email protected]/dist/esm/util/stack-trace-utils.js'-import { Pool, PoolClient } from 'https://deno.land/x/[email protected]/mod.ts'export interface PostgresDialectConfig {pool: Pool | (() => Promise<Pool>)@@ -190,15 +190,15 @@ class PostgresConnection implements DatabaseConnection {Create an `index.ts` file to execute a query on incoming requests:```ts index.ts-import { serve } from 'https://deno.land/[email protected]/http/server.ts'import { Pool } from 'https://deno.land/x/[email protected]/mod.ts'import {- Kysely,Generated,+ Kysely,PostgresAdapter,PostgresIntrospector,PostgresQueryCompiler,} from 'https://esm.sh/[email protected]'+import { PostgresDriver } from './DenoPostgresDriver.ts'console.log(`Function "kysely-postgres" up and running!`)@@ -245,7 +245,7 @@ const db = new Kysely<Database>({},})-serve(async (_req) => {+Deno.serve(async (_req) => {try {// Run a queryconst animals = await db.selectFrom('animals').select(['id', 'animal', 'created_at']).execute()diff --git a/examples/edge-functions/supabase/functions/slack-bot-mention/slack-bot-mention.md b/examples/edge-functions/supabase/functions/slack-bot-mention/slack-bot-mention.mdindex c07b9d27509..c7426bd13f7 100644--- a/examples/edge-functions/supabase/functions/slack-bot-mention/slack-bot-mention.md+++ b/examples/edge-functions/supabase/functions/slack-bot-mention/slack-bot-mention.md@@ -23,14 +23,13 @@ set SLACK_TOKEN=<xoxb-0000000000-0000000000-01010101010nacho101010>Here's the code of the Edge Function, you can change the response to handle the text received:```ts index.ts-import { serve } from 'https://deno.land/[email protected]/http/server.ts'import { WebClient } from 'https://deno.land/x/[email protected]/mod.js'const slackBotToken = Deno.env.get('SLACK_TOKEN') ?? ''const botClient = new WebClient(slackBotToken)console.log(`Slack URL verification function up and running!`)-serve(async (req) => {+Deno.serve(async (req) => {try {const reqBody = await req.json()console.log(JSON.stringify(reqBody, null, 2))