© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
7 replies
dandis

Is it possible to create global functions for reusable code between Edge Functions?

Hey, after looking at the docs regarding Edge Functions, I've seen that on the git repository there is a
_shared
_shared
directory, which includes corsHeaders.ts. I've tried to do some validations and create a client, return it from that file, but I get an error when building the Edge Function. Is there a way to host the environment on the Edge as well (1 extra directory), and import from there?

My function structure looks like:
supabase/functions/someFunction/index.ts
supabase/functions/someFunction/index.ts

supabase/functions/someFunction/helpers.ts
supabase/functions/someFunction/helpers.ts
.

My specific question is there a workaround to store
helpers.ts
helpers.ts
in
supabase/functions
supabase/functions
instead of having to copy/paste the file in each of the EF I create?
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

is it possible to run edge functions on supabase dashboard?
SupabaseSSupabase / help-and-questions
4y ago
How to share code between edge functions and nextjs app?
SupabaseSSupabase / help-and-questions
3y ago
Deno VS Code Intellisense for Edge Functions
SupabaseSSupabase / help-and-questions
3y ago
Difference between edge functions and webhooks
SupabaseSSupabase / help-and-questions
4y ago