Skip to content

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

docs: update deno deps to jsr. (#27766)

Thor 雷神 Schaeff0dbb5e52256c
diff --git a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx
index 64012a95fea..d2737bd6e29 100644
--- a/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx
+++ b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx
@@ -41,7 +41,7 @@ Find the complete code on [GitHub](https://github.com/supabase/supabase/tree/mas
```ts
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import { HfInference } from 'https://esm.sh/@huggingface/[email protected]'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { Database } from './types.ts'
console.log('Hello from `huggingface-image-captioning` function!')
diff --git a/apps/docs/content/guides/ai/hybrid-search.mdx b/apps/docs/content/guides/ai/hybrid-search.mdx
index 535b0782338..0a21fd1f83c 100644
--- a/apps/docs/content/guides/ai/hybrid-search.mdx
+++ b/apps/docs/content/guides/ai/hybrid-search.mdx
@@ -166,7 +166,7 @@ from
In practice, you will likely be calling this from the [Supabase client](/docs/reference/javascript/introduction) or through a custom backend layer. Here is a quick example of how you might call this from an [Edge Function](/docs/guides/functions) using JavaScript:
```tsx
-import { createClient } from 'npm:@supabase/supabase-js'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import OpenAI from 'npm:openai'
const supabaseUrl = Deno.env.get('SUPABASE_URL')!
diff --git a/apps/docs/content/guides/functions/ai-models.mdx b/apps/docs/content/guides/functions/ai-models.mdx
index a4f3cce8c05..12b40de6462 100644
--- a/apps/docs/content/guides/functions/ai-models.mdx
+++ b/apps/docs/content/guides/functions/ai-models.mdx
@@ -23,7 +23,7 @@ const model = new Supabase.ai.Session('model-name')
To get type hints and checks for the API you can import types from `functions-js` at the top of your file:
```ts
-import 'https://esm.sh/@supabase/functions-js/src/edge-runtime.d.ts'
+import 'jsr:@supabase/functions-js/edge-runtime.d.ts'
```
</Admonition>
@@ -100,7 +100,7 @@ Inference via larger models is supported via [Ollama](https://ollama.com/). In t
```
```ts
- import 'https://esm.sh/@supabase/functions-js/src/edge-runtime.d.ts'
+ import 'jsr:@supabase/functions-js/edge-runtime.d.ts'
const session = new Supabase.ai.Session('mistral')
Deno.serve(async (req: Request) => {
diff --git a/apps/docs/content/guides/functions/auth.mdx b/apps/docs/content/guides/functions/auth.mdx
index 73dc436f377..f607c3587ed 100644
--- a/apps/docs/content/guides/functions/auth.mdx
+++ b/apps/docs/content/guides/functions/auth.mdx
@@ -12,7 +12,7 @@ Edge Functions work seamlessly with [Supabase Auth](/docs/guides/auth).
When a user makes a request to an Edge Function, you can use the Authorization header to set the Auth context in the Supabase client:
```js mark=9
-import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (req: Request) => {
@@ -33,7 +33,7 @@ Importantly, this is done _inside_ the `Deno.serve()` callback argument, so that
After initializing a Supabase client with the Auth context, you can use `getUser()` to fetch the user object, and run queries in the context of the user with [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security) policies enforced.
```js mark=12:13
-import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (req: Request) => {
@@ -61,7 +61,7 @@ Deno.serve(async (req: Request) => {
After initializing a Supabase client with the Auth context, all queries will be executed with the context of the user. For database queries, this means [Row Level Security](/docs/guides/database/postgres/row-level-security) will be enforced.
```js mark=12
-import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (req: Request) => {
diff --git a/apps/docs/content/guides/functions/connect-to-postgres.mdx b/apps/docs/content/guides/functions/connect-to-postgres.mdx
index 651c4fe56b2..12478874d5c 100644
--- a/apps/docs/content/guides/functions/connect-to-postgres.mdx
+++ b/apps/docs/content/guides/functions/connect-to-postgres.mdx
@@ -14,7 +14,7 @@ You can also use other Postgres clients like [Deno Postgres](https://deno.land/x
The `supabase-js` client is a great option for connecting to your Supabase database since it handles authorization with Row Level Security, and it automatically formats your response as JSON.
```ts index.ts
-import { createClient } from 'https://esm.sh/@supabase/supabase-js'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (_req) => {
try {
diff --git a/apps/docs/content/guides/functions/examples/push-notifications.mdx b/apps/docs/content/guides/functions/examples/push-notifications.mdx
index 9a53c86541d..b59ad8879a9 100644
--- a/apps/docs/content/guides/functions/examples/push-notifications.mdx
+++ b/apps/docs/content/guides/functions/examples/push-notifications.mdx
@@ -53,7 +53,7 @@ Push notifications are an important part of any mobile app. They allow you to se
1. `supabase secrets set --env-file .env.local`
```ts supabase/functions/push/index.ts
- import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+ import { createClient } from 'jsr:@supabase/supabase-js@2'
console.log('Hello from Functions!')
diff --git a/apps/docs/content/guides/functions/unit-test.mdx b/apps/docs/content/guides/functions/unit-test.mdx
index e08c853b2b3..0430bbc3254 100644
--- a/apps/docs/content/guides/functions/unit-test.mdx
+++ b/apps/docs/content/guides/functions/unit-test.mdx
@@ -35,7 +35,7 @@ The following script is a good example to get started with testing your Edge Fun
```typescript function-one-test.ts
// Import required libraries and modules
import { assert, assertEquals } from 'https://deno.land/[email protected]/testing/asserts.ts'
-import { createClient, SupabaseClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient, SupabaseClient } from 'jsr:@supabase/supabase-js@2'
// Set up the configuration for the Supabase client
const supabaseUrl = Deno.env.get('SUPABASE_URL') ?? ''
diff --git a/apps/docs/docs/ref/javascript/installing.mdx b/apps/docs/docs/ref/javascript/installing.mdx
index eb133446abf..3a5d4cbe44d 100644
--- a/apps/docs/docs/ref/javascript/installing.mdx
+++ b/apps/docs/docs/ref/javascript/installing.mdx
@@ -73,14 +73,14 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
- You can use supabase-js in the Deno runtime via esm.sh:
+ You can use supabase-js in the Deno runtime via [JSR](https://jsr.io/@supabase/supabase-js):
</RefSubLayout.Details>
<RefSubLayout.Examples>
```ts
- import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+ import { createClient } from 'jsr:@supabase/supabase-js@2'
```
</RefSubLayout.Examples>
diff --git a/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx b/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
index 2196f41a5b0..fb4f913b48d 100644
--- a/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
+++ b/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
@@ -203,7 +203,7 @@ Finally, let's create an [Edge Function](https://supabase.com/docs/guides/functi
```tsx
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { Configuration, OpenAIApi } from 'https://esm.sh/[email protected]'
import { supabaseClient } from './lib/supabase'
@@ -264,7 +264,7 @@ Here's another Edge Function that expands upon the simple example above:
```tsx
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import GPT3Tokenizer from 'https://esm.sh/[email protected]'
import { Configuration, OpenAIApi } from 'https://esm.sh/[email protected]'
import { oneLine, stripIndent } from 'https://esm.sh/[email protected]'
diff --git a/apps/www/_blog/2023-08-07-hugging-face-supabase.mdx b/apps/www/_blog/2023-08-07-hugging-face-supabase.mdx
index 124805b560d..11ef0eca430 100644
--- a/apps/www/_blog/2023-08-07-hugging-face-supabase.mdx
+++ b/apps/www/_blog/2023-08-07-hugging-face-supabase.mdx
@@ -96,7 +96,7 @@ Let’s step through a small demo where we accept some text, convert it into an
```ts
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import { env, pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]'
-import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
// Preparation for Deno runtime
env.useBrowserCache = false
diff --git a/apps/www/components/Products/Functions/WorksWithAuthPanel.tsx b/apps/www/components/Products/Functions/WorksWithAuthPanel.tsx
index 470fb46a523..926e1a4f9e3 100644
--- a/apps/www/components/Products/Functions/WorksWithAuthPanel.tsx
+++ b/apps/www/components/Products/Functions/WorksWithAuthPanel.tsx
@@ -1,7 +1,7 @@
import React from 'react'
import CodeWindow from '~/components/CodeWindow'
-const code = `import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+const code = `import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (req: Request) => {
// Create supabase client
diff --git a/apps/www/components/Products/Functions/WorksWithStoragePanel.tsx b/apps/www/components/Products/Functions/WorksWithStoragePanel.tsx
index 91811b86f4f..437fef40e92 100644
--- a/apps/www/components/Products/Functions/WorksWithStoragePanel.tsx
+++ b/apps/www/components/Products/Functions/WorksWithStoragePanel.tsx
@@ -1,7 +1,7 @@
import React from 'react'
import CodeWindow from '~/components/CodeWindow'
-const code = `import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
+const code = `import { createClient } from 'jsr:@supabase/supabase-js@2'
Deno.serve(async (req: Request) => {
// Create supabase client
diff --git a/apps/www/data/products/functions/usecase-examples.js b/apps/www/data/products/functions/usecase-examples.js
index 1699f9d7617..e536fde42e2 100644
--- a/apps/www/data/products/functions/usecase-examples.js
+++ b/apps/www/data/products/functions/usecase-examples.js
@@ -56,7 +56,7 @@ serve(async (req: Request) => {
description: `Read and write to any of your buckets, while also respecting storage auth policies.`,
size: 'large',
code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
-import { createClient } from "https://esm.sh/@supabase/[email protected]";
+import { createClient } from "jsr:@supabase/supabase-js@2";
serve(async (req) => {
const SUPABASE_URL = Deno.env.get("SUPABASE_URL") ?? "";
@@ -78,7 +78,7 @@ serve(async (req) => {
description: `Read, Write, Update, Insert anything on the database`,
size: 'large',
code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
-import { createClient } from "https://esm.sh/@supabase/[email protected]";
+import { createClient } from "jsr:@supabase/supabase-js@2";
serve(async () => {
const SUPABASE_URL = Deno.env.get("SUPABASE_URL") ?? "";
diff --git a/apps/www/supabase/functions/lw11-og/handler.tsx b/apps/www/supabase/functions/lw11-og/handler.tsx
index a8d3fbf8544..e036659fb0b 100644
--- a/apps/www/supabase/functions/lw11-og/handler.tsx
+++ b/apps/www/supabase/functions/lw11-og/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.140.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/apps/www/supabase/functions/lwx-og/handler.tsx b/apps/www/supabase/functions/lwx-og/handler.tsx
index cfc34459248..b4eea3fbcb1 100644
--- a/apps/www/supabase/functions/lwx-og/handler.tsx
+++ b/apps/www/supabase/functions/lwx-og/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.140.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/apps/www/supabase/functions/lwx-ticket-og/handler.tsx b/apps/www/supabase/functions/lwx-ticket-og/handler.tsx
index 2a53663cd2a..207d7ac5495 100644
--- a/apps/www/supabase/functions/lwx-ticket-og/handler.tsx
+++ b/apps/www/supabase/functions/lwx-ticket-og/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.140.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/apps/www/supabase/functions/lwx-ticket/handler.tsx b/apps/www/supabase/functions/lwx-ticket/handler.tsx
index 63e63787da1..72bf3ff3fa6 100644
--- a/apps/www/supabase/functions/lwx-ticket/handler.tsx
+++ b/apps/www/supabase/functions/lwx-ticket/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.140.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts
index 1fa1b6dc4b5..89174e016c4 100644
--- a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts
+++ b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts
@@ -1,6 +1,6 @@
-import "https://esm.sh/@supabase/functions-js/src/edge-runtime.d.ts";
+import "jsr:@supabase/functions-js/edge-runtime.d.ts";
-import { createClient } from "npm:@supabase/[email protected]";
+import { createClient } from "jsr:@supabase/supabase-js@2";
import { Database, Tables } from "../_shared/database.types.ts";
type EmbeddingsRecord = Tables<"embeddings">;
diff --git a/examples/ai/edge-functions/supabase/functions/search/index.ts b/examples/ai/edge-functions/supabase/functions/search/index.ts
index 25585e99ce8..2f045d7a0aa 100644
--- a/examples/ai/edge-functions/supabase/functions/search/index.ts
+++ b/examples/ai/edge-functions/supabase/functions/search/index.ts
@@ -1,6 +1,6 @@
-import "https://esm.sh/@supabase/functions-js/src/edge-runtime.d.ts";
+import "jsr:@supabase/functions-js/edge-runtime.d.ts";
-import { createClient } from "npm:@supabase/[email protected]";
+import { createClient } from "jsr:@supabase/supabase-js@2";
import { Database } from "../_shared/database.types.ts";
const supabase = createClient<Database>(
diff --git a/examples/edge-functions/supabase/functions/file-upload-storage/index.ts b/examples/edge-functions/supabase/functions/file-upload-storage/index.ts
index 025255da132..e90e5ae71c2 100644
--- a/examples/edge-functions/supabase/functions/file-upload-storage/index.ts
+++ b/examples/edge-functions/supabase/functions/file-upload-storage/index.ts
@@ -2,7 +2,7 @@
// and write files to Supabase Storage and other fields to a database table.
import { Application } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const MB = 1024 * 1024
diff --git a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
index 492eeb4a6d0..16a89ab145c 100644
--- a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
+++ b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
@@ -2,7 +2,7 @@
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { corsHeaders } from '../_shared/cors.ts'
console.log(`Function "get-tshirt-competition" up and running!`)
diff --git a/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts b/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts
index 9134aa44af9..4e5a7e909e3 100644
--- a/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts
+++ b/examples/edge-functions/supabase/functions/huggingface-image-captioning/index.ts
@@ -1,5 +1,5 @@
import { HfInference } from 'https://esm.sh/@huggingface/[email protected]'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { Database } from './types.ts'
console.log('Hello from `huggingface-image-captioning` function!')
diff --git a/examples/edge-functions/supabase/functions/import_map.json b/examples/edge-functions/supabase/functions/import_map.json
index f703de7b56c..4007dd0c652 100644
--- a/examples/edge-functions/supabase/functions/import_map.json
+++ b/examples/edge-functions/supabase/functions/import_map.json
@@ -10,7 +10,7 @@
"std/server": "https://deno.land/[email protected]/http/server.ts",
"stripe": "https://esm.sh/[email protected]?target=deno",
"sift": "https://deno.land/x/[email protected]/mod.ts",
- "@supabase/supabase-js": "https://esm.sh/@supabase/[email protected]",
+ "@supabase/supabase-js": "jsr:@supabase/supabase-js@2",
"postgres": "https://deno.land/x/[email protected]/mod.ts",
"puppeteer": "https://deno.land/x/[email protected]/mod.ts",
"React": "https://esm.sh/[email protected]?deno-std=0.177.0",
diff --git a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx
index 2aef3b2be14..824fdbb66a4 100644
--- a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx
+++ b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.177.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { corsHeaders } from '../_shared/cors.ts'
const STORAGE_URL = 'https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw6'
diff --git a/examples/edge-functions/supabase/functions/read-storage/index.ts b/examples/edge-functions/supabase/functions/read-storage/index.ts
index 51d84eef8b5..938b435b173 100644
--- a/examples/edge-functions/supabase/functions/read-storage/index.ts
+++ b/examples/edge-functions/supabase/functions/read-storage/index.ts
@@ -2,7 +2,7 @@
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/examples/edge-functions/supabase/functions/restful-tasks/index.ts b/examples/edge-functions/supabase/functions/restful-tasks/index.ts
index 77a5b84fdb0..4b40c117c5d 100644
--- a/examples/edge-functions/supabase/functions/restful-tasks/index.ts
+++ b/examples/edge-functions/supabase/functions/restful-tasks/index.ts
@@ -2,7 +2,7 @@
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { createClient, SupabaseClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient, SupabaseClient } from 'jsr:@supabase/supabase-js@2'
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
diff --git a/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts b/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts
index 93fc185c480..04fa80dd0b2 100644
--- a/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts
+++ b/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts
@@ -2,7 +2,7 @@
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { corsHeaders } from '../_shared/cors.ts'
console.log(`Function "select-from-table-with-auth-rls" up and running!`)
diff --git a/examples/edge-functions/supabase/functions/sentry/index.ts b/examples/edge-functions/supabase/functions/sentry/index.ts
index c2919ef4bc7..ecdf4bb511d 100644
--- a/examples/edge-functions/supabase/functions/sentry/index.ts
+++ b/examples/edge-functions/supabase/functions/sentry/index.ts
@@ -4,7 +4,7 @@
console.log('Hello from the Sentry Functions Challenge!')
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import * as Sentry from 'https://deno.land/x/[email protected]/index.mjs'
const supabase = createClient(
diff --git a/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx b/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx
index c55060c77ec..6d54b55f55f 100644
--- a/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx
+++ b/examples/edge-functions/supabase/functions/tweet-to-image/handler.tsx
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/[email protected]?deno-std=0.140.0'
import { ImageResponse } from 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { corsHeaders } from '../_shared/cors.ts'
import { getTweets } from './getTweet.ts'
import Tweet from './Tweet.tsx'
diff --git a/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts b/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts
index 9ecac3b9ff9..91774d9cc22 100644
--- a/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts
+++ b/examples/edge-functions/supabase/functions/upstash-redis-ratelimit/index.ts
@@ -1,6 +1,6 @@
import { Redis } from 'https://deno.land/x/[email protected]/mod.ts'
import { Ratelimit } from 'https://cdn.skypack.dev/@upstash/[email protected]'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
console.log(`Function "upstash-redis-counter" up and running!`)
diff --git a/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts b/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts
index 40903c51f06..79141a0e403 100644
--- a/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts
+++ b/examples/user-management/expo-push-notifications/supabase/functions/push/index.ts
@@ -1,54 +1,54 @@
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { createClient } from "https://esm.sh/@supabase/[email protected]";
+import { createClient } from 'jsr:@supabase/supabase-js@2'
-console.log("Hello from Functions!");
+console.log('Hello from Functions!')
interface Notification {
- id: string;
- user_id: string;
- body: string;
+ id: string
+ user_id: string
+ body: string
}
interface WebhookPayload {
- type: "INSERT" | "UPDATE" | "DELETE";
- table: string;
- record: Notification;
- schema: "public";
- old_record: null | Notification;
+ type: 'INSERT' | 'UPDATE' | 'DELETE'
+ table: string
+ record: Notification
+ schema: 'public'
+ old_record: null | Notification
}
const supabase = createClient(
- Deno.env.get("SUPABASE_URL")!,
- Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!
-);
+ Deno.env.get('SUPABASE_URL')!,
+ Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
+)
Deno.serve(async (req) => {
- const payload: WebhookPayload = await req.json();
+ const payload: WebhookPayload = await req.json()
const { data } = await supabase
- .from("profiles")
- .select("expo_push_token")
- .eq("id", payload.record.user_id)
- .single();
+ .from('profiles')
+ .select('expo_push_token')
+ .eq('id', payload.record.user_id)
+ .single()
- const res = await fetch("https://exp.host/--/api/v2/push/send", {
- method: "POST",
+ const res = await fetch('https://exp.host/--/api/v2/push/send', {
+ method: 'POST',
headers: {
- "Content-Type": "application/json",
- Authorization: `Bearer ${Deno.env.get("EXPO_ACCESS_TOKEN")}`,
+ 'Content-Type': 'application/json',
+ Authorization: `Bearer ${Deno.env.get('EXPO_ACCESS_TOKEN')}`,
},
body: JSON.stringify({
to: data?.expo_push_token,
- sound: "default",
+ sound: 'default',
body: payload.record.body,
}),
- }).then((res) => res.json());
+ }).then((res) => res.json())
return new Response(JSON.stringify(res), {
- headers: { "Content-Type": "application/json" },
- });
-});
+ headers: { 'Content-Type': 'application/json' },
+ })
+})
// To invoke:
// curl -i --location --request POST 'http://localhost:54321/functions/v1/' \
diff --git a/supabase/functions/ai-docs/index.ts b/supabase/functions/ai-docs/index.ts
index b01359c1461..e87e4836945 100644
--- a/supabase/functions/ai-docs/index.ts
+++ b/supabase/functions/ai-docs/index.ts
@@ -1,6 +1,6 @@
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { codeBlock, oneLine } from 'https://esm.sh/[email protected]'
import {
ChatCompletionRequestMessage,
diff --git a/supabase/functions/search-embeddings/index.ts b/supabase/functions/search-embeddings/index.ts
index 6ba578baef1..91a912fe3f0 100644
--- a/supabase/functions/search-embeddings/index.ts
+++ b/supabase/functions/search-embeddings/index.ts
@@ -1,5 +1,5 @@
import 'https://deno.land/x/[email protected]/mod.ts'
-import { createClient } from 'https://esm.sh/@supabase/[email protected]'
+import { createClient } from 'jsr:@supabase/supabase-js@2'
import { Configuration, OpenAIApi } from 'https://esm.sh/[email protected]'
import { Database } from '../common/database-types.ts'
import { ApplicationError, UserError } from '../common/errors.ts'