Skip to content

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

Merged
kallebysantos merged 15 commits into
supabase: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 into
supabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk

Conversation

@kallebysantos

@kallebysantoskallebysantos commented Apr 10, 2026

Copy link
Copy Markdown
Member

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

@kallebysantos
kallebysantos requested a review from a team as a code ownerApril 10, 2026 19:04
@kallebysantoskallebysantos added the do not merge Approve to apply; do not merge. label Apr 10, 2026
@coveralls

coveralls commented Apr 10, 2026

Copy link
Copy Markdown

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

FileChangedCovered%
cmd/functions.go4125.0%
internal/functions/new/new.go201890.0%

Coverage Regressions

9 previously-covered lines in 3 files lost coverage.

FileLines Losing CoverageCoverage
internal/utils/git.go557.14%
internal/debug/postgres.go366.09%
cmd/functions.go145.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
MemberAuthor

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

Comment threadcmd/functions.go Outdated
Comment threadinternal/functions/new/templates/index_auth_mode_none.ts
@kallebysantoskallebysantos removed the do not merge Approve to apply; do not merge. label Apr 28, 2026

@avalleteavallete left a comment

Copy link
Copy Markdown
Member

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 threadinternal/functions/new/templates/index_user_access.ts Outdated
Comment threadinternal/functions/new/templates/index_user_access.ts Outdated
Comment threadinternal/functions/new/templates/deno.json Outdated
Comment threadcmd/functions.go Outdated
@kallebysantos
kallebysantosforce-pushed the feat-update-functions-template-server-sdk branch from 6b96df4 to b24c3aaCompareApril 29, 2026 18:52
@kallebysantos
kallebysantosforce-pushed the feat-update-functions-template-server-sdk branch from 830a4af to 9d8c4fdCompareMay 5, 2026 17:12
@kallebysantos

Copy link
Copy Markdown
MemberAuthor

Last update: Towards FUNC-581

@tomaspozotomaspozo left a comment

Copy link
Copy Markdown
Member

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:developMay 6, 2026
20 checks passed
@supabase-cli-releasersupabase-cli-releaserBot mentioned this pull request May 6, 2026
@kallebysantos
kallebysantos deleted the feat-update-functions-template-server-sdk branch May 6, 2026 09:21
avallete added a commit that referenced this pull request May 7, 2026
Will avoid in the future a PR getting merged with invalid semantic
release name, causing it to be dismissed from deployment:
#5176https://github.com/supabase/cli/actions/runs/25422547737/job/74567952624#5063
Sign up for freeto 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

@kallebysantos@coveralls@avallete@tomaspozo