Skip to content

feat(functions) update functions template to match new 'server' style#5063

Merged
kallebysantos merged 15 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk
May 6, 2026
Merged

feat(functions) update functions template to match new 'server' style#5063
kallebysantos merged 15 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk

Conversation

@kallebysantos
Copy link
Copy Markdown
Member

@kallebysantos kallebysantos commented Apr 10, 2026

What kind of change does this PR introduce?

Feature

What is the new behavior?

Apply withSupabase helper from @supabase/server

Additional context

A new optional flag --auth was introduced for the functions new command, chose between the auth access template:

  • none No credentials required - Open endpoints, wrappers that handle their own auth
  • apikey Valid publishable key or secret key - Use respectively for Client-facing, key-validated endpoints or Server-to-server, internal calls
  • user User JWT required - Authenticated user endpoints

Current default --auth apikey

--
Towards FUNC-563

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 10, 2026

Coverage Report for CI Build 25400572175

Coverage decreased (-0.04%) to 63.707%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: 5 uncovered changes across 2 files (19 of 24 lines covered, 79.17%).
  • 9 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
cmd/functions.go 4 1 25.0%
internal/functions/new/new.go 20 18 90.0%

Coverage Regressions

9 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
internal/utils/git.go 5 57.14%
internal/debug/postgres.go 3 66.09%
cmd/functions.go 1 45.92%

Coverage Stats

Coverage Status
Relevant Lines: 15675
Covered Lines: 9986
Line Coverage: 63.71%
Coverage Strength: 7.05 hits per line

💛 - Coveralls

@kallebysantos
Copy link
Copy Markdown
Member Author

WIP: Do not merge until @supabase/server be announced

Comment thread cmd/functions.go Outdated
Comment thread internal/functions/new/templates/index_auth_mode_none.ts
Copy link
Copy Markdown
Member

@avallete avallete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. Otherwise LGTM.

Comment thread internal/functions/new/templates/index_user_access.ts Outdated
Comment thread internal/functions/new/templates/index_user_access.ts Outdated
Comment thread internal/functions/new/templates/deno.json Outdated
Comment thread cmd/functions.go Outdated
@kallebysantos kallebysantos force-pushed the feat-update-functions-template-server-sdk branch from 6b96df4 to b24c3aa Compare April 29, 2026 18:52
@kallebysantos kallebysantos force-pushed the feat-update-functions-template-server-sdk branch from 830a4af to 9d8c4fd Compare May 5, 2026 17:12
@kallebysantos
Copy link
Copy Markdown
Member Author

Last update: Towards FUNC-581

@kallebysantos kallebysantos requested a review from tomaspozo May 5, 2026 17:13
Copy link
Copy Markdown
Member

@tomaspozo tomaspozo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🔥

@kallebysantos kallebysantos merged commit 693b7d3 into supabase:develop May 6, 2026
20 checks passed
@supabase-cli-releaser supabase-cli-releaser Bot mentioned this pull request May 6, 2026
@kallebysantos kallebysantos deleted the feat-update-functions-template-server-sdk branch May 6, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants