Edge Functions

Local development

Setup local development environment for Edge Functions.

We recommend installing the Deno CLI and related tools for local development.

Deno support

You can follow the Deno guide for setting up your development environment with your favorite editor/IDE.

Deno with Visual Studio Code

When using VSCode, you should install both the Deno CLI and the the Deno language server via this link or by browsing the extensions in vscode and choosing to install the Deno extension.

Deno support in subfolders

You can enable the Deno language server for specific sub-paths in a workspace, while using VSCode's built-in JavaScript/TypeScript language server for all other files.

For example if you have a project like this:


_10
project
_10
├── app
_10
└── supabase
_10
└── functions

To enable the Deno language server only for the supabase/functions folder, add ./supabase/functions to the list of Deno: Enable Paths in the configuration. In your .vscode/settings.json file add:


_10
{
_10
"deno.enablePaths": ["./supabase/functions"],
_10
"deno.importMap": "./supabase/functions/import_map.json"
_10
}

Multi-root workspaces in VSCode

We recommend using deno.enablePaths mentioned above as it's easier to manage, however if you like multi-root workspaces you can use these as an alternative.

For example, see this edge-functions.code-workspace configuration for a CRA (create react app) client with Supabase Edge Functions. You can find the complete example on GitHub.


_24
{
_24
"folders": [
_24
{
_24
"name": "project-root",
_24
"path": "./"
_24
},
_24
{
_24
"name": "client",
_24
"path": "app"
_24
},
_24
{
_24
"name": "supabase-functions",
_24
"path": "supabase/functions"
_24
}
_24
],
_24
"settings": {
_24
"files.exclude": {
_24
"node_modules/": true,
_24
"app/": true,
_24
"supabase/functions/": true
_24
},
_24
"deno.importMap": "./supabase/functions/import_map.json"
_24
}
_24
}