© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2w ago•
4 replies
Zeke

Authorization for Local Edge Functions

edge functionsCLI
I'm trying to set up my local dev environment so that I can develop and test edge functions locally. I followed the getting started (CLI) instructions in the docs to create a basic hello world function, but I haven't succeeded in connecting to it. The error seems to be something to do with the authorization header.

The request I'm sending looks like this:
curl -i --location --request POST 'http://127.0.0.1:54321/functions/v1/hello-world' \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Functions"}'
curl -i --location --request POST 'http://127.0.0.1:54321/functions/v1/hello-world' \
  --header 'Authorization: Bearer [token]' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Functions"}'


I've tried a number of different things for
[token]
[token]
:
- The "Publishable" authentication key outputed by
supabase status
supabase status
—this is what the docs said to use, even though it's not a JWT
- The "Secret" authentication key outputed by
supabase status
supabase status

- The long JWT string (
xxxx.yyyy.zzzz
xxxx.yyyy.zzzz
) that is shown in the example cURL request in the comment at the bottom of the function definition file
- The anonymous key gotten via local Supabase Studio -> avator icon -> Command menu -> Copy anonymous API key
- The service key gotten via local Supabase Studio -> avatar icon -> Command menu -> Copy service API key

The first two options result in
Error: Missing authorization header
Error: Missing authorization header
(status 401). The other three options return
Invalid JWT
Invalid JWT
(status 401), and on the server side I see
TypeError: Key for ES256 algorithm must be of type CryptoKey. Received an instance of Uint8Array
TypeError: Key for ES256 algorithm must be of type CryptoKey. Received an instance of Uint8Array
.

This feels like a very basic question. but I'm struggling with it: What is the key you are supposed to use as the bearer token when querying a local edge function?

I can provide my
config.toml
config.toml
file or anything else if it might help explain the situation.
Getting Started with Edge Functions | Supabase Docs
Get started with Supabase Edge Functions.
Getting Started with Edge Functions | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

edge functions missing authorization header
SupabaseSSupabase / help-and-questions
2w ago
Supabase edge functions and local imports
SupabaseSSupabase / help-and-questions
4mo ago
Database error with local edge functions
SupabaseSSupabase / help-and-questions
13mo ago
Local edge functions don't log
SupabaseSSupabase / help-and-questions
2y ago