Some logic just doesn't belong on the client, like calling a payment API with a secret key. This mission gets a Supabase Edge Function running end to end, from your first deploy through calling it from real app code. You'll create a function, test it locally, pull in an npm package, and store a secret key the right way. You'll end with a working function that talks to a third-party service without ever exposing that key to your users.
Who this is for: Anyone with a Supabase project who needs to run backend logic, like calling a third-party API with a secret key, without standing up a separate server.
By the end, you'll have:
What you'll learn:
3 objectives. One real outcome.
Objective 1
Create a function from the dashboard, then recreate it locally with the CLI and link it to your project.
Objective 2
Serve your functions locally, confirm edits update live, then import an npm package.
Objective 3
Store a secret key safely, read it inside your function, deploy, and call it from real app code.
Do I need Docker for this?
Yes, running functions locally requires Docker to be running in the background.
What language do edge functions use?
TypeScript, running on Deno, a modern JavaScript runtime that supports npm packages.
Where do secret keys go?
Into a local env file that's git ignored, then pushed to Supabase with the secrets command, never hardcoded in your function.
Can I test a function without deploying it?
Yes, the CLI can serve your functions locally so you can call them before they ever go live.
How do I call the function from my app?
Use the invoke method under the functions namespace on the Supabase client, or call it with a regular fetch.