From 0.66 to 0.67
What to change when upgrading from better-supabase 0.66 to 0.67. Sessions and sign-in run on @supabase/ssr, the lite browser client is removed, every peer range starts at the release the tests run on, the previous majors of SvelteKit, Nuxt, React Router, NestJS, Stripe, expo-server, undici, redis and PowerSync are no longer supported, and better-supabase/eve follows eve 1.0.
0.67 calls Supabase only through its own clients: session cookies are read
with the @supabase/ssr helpers and written by its createServerClient, the
Next.js sign-in flows call auth-js, and the browser client always comes from
createBrowserClient (ADR 0846 and ADR 0847). Every peer range now starts at
the release the conformance tests run on and covers one major release
(ADR 0848). It is a minor release, and
below 1.0 a minor version may carry breaking changes. Each change is also in
the
changelog.
| Section | Needs code |
|---|---|
| Supabase peers | Bump the Supabase packages |
| Dropped majors | Move to the supported major of each framework |
| Other peer floors | Upgrade a peer that is older than its new floor |
| Expo | Remove the unstable_ options from app.json |
| New optional peers | None; install one only for the subpath you use |
| Lite browser client | Import better-supabase/client |
| Session cookies | Replace readSession with await ssrSession |
| Sign-in flows | Replace passwordGrant, and check the PKCE error code |
| Notification avatars | Pass a function to avatars |
| Session status | None; a 403 that is not Auth's JSON now reads as unknown |
| eve 1.0 | Upgrade eve, rename hook events and credentialOwner |
| Workflow 5.5 | Upgrade the workflow-sdk SQL module, then deploy |
| Archive and purge | Rename each delete, deleted event and permissions.delete in its table |
| Submission purge | Rename forms.deleteSubmission and form_submission.deleted |
| Team purge | Rename teams.delete, team.deleted and permissions.delete |
| Per-row bulk | None; move off shareMany and setMany before 0.70 |
Supabase peers
Install the newest Supabase packages:
pnpm add @supabase/supabase-js@^2.119.0 @supabase/ssr @supabase/server@^1.9.2
pnpm add -D @supabase/postgrest-typegen@0.8.1@supabase/config needs ^1.6.1. @supabase/postgrest-typegen and
@supabase/mcp-server-supabase have a floor and no upper bound. The CLI is
tested against postgrest-typegen 0.8.1, so install that release to keep
database.types.ts equal to supabase gen types.
0.8 marks a returns table column and a table argument that can never be
null as not nullable, so a few generated types get narrower; run
better-supabase gen after the upgrade. oxfmt still starts at 0.66.0, the
version typegen 0.8.1 requires.
Dropped majors
These majors were in range on 0.66 and are not on 0.67. Upgrade the framework
or SDK first, following its own guide, then better-supabase. After the bump,
better-supabase doctor reports every installed peer outside its new range
as BS601.
| Package | 0.66 accepted | 0.67 accepts |
|---|---|---|
@sveltejs/kit | 2 and 3 | >=3.2.0 <4 |
nuxt | 3 and 4 | >=4.6.4 <5 |
react-router | 7.9 and 8 | >=8.5.1 <9 |
@nestjs/common | 11 and 12 | >=12.5.0 <13 |
stripe | 17 to 23 | >=23.1.0 <24 |
expo-server | 55 to 58 | >=58.1.0 <59 |
undici | 7.30.1 and 8 | >=8.12.4 <9 |
redis | 5 and 6 | >=6.3.1 <7 |
@powersync/common | 1 and 2 | >=2.5.0 <3 |
better-supabase/h3/v1 stays: Nuxt 4 still runs on Nitro 2 and H3 1, so h3
accepts >=1.15.11 <3.
Other peer floors
Every other range keeps its upper bound and starts at the tested release. The Supabase packages are in Supabase peers.
| Package | 0.67 accepts |
|---|---|
next, @next/playwright | >=16.4.6 <17 |
react | ^19.3.1 |
svelte, vue, solid-js | ^5.57.3, ^3.5.45, ^1.9.19 |
astro | >=7.4.11 <8 |
@solidjs/start | >=2.2.2 <3 |
@tanstack/react-start | >=1.169.5 <2 |
hono, elysia | >=4.13.18 <5, >=1.4.32 <2 |
express, fastify, koa | >=5.3.0 <6, >=5.12.8 <6, >=3.3.0 <4 |
ai | >=7.0.171 <8 |
@ai-sdk/react, @ai-sdk/mcp, @ai-sdk/workflow | >=4.0.175, >=2.0.98, >=2.0.103 |
@ai-sdk/anthropic, @ai-sdk/sandbox-vercel | >=4.0.103 <5, >=1.0.182 <2 |
chat, @chat-adapter/catalog, @chat-adapter/whatsapp | >=4.44.0 <5 |
@orpc/server | >=2.0.0-beta.50 <3 |
@modelcontextprotocol/server | >=2.4.0 <3 |
@tanstack/query-core | ^5.107.1 |
@json-render/core | >=0.22.0 <1 |
nuqs, pg | >=2.10.3 <3, >=8.23.1 <9 |
zod, valibot | >=4.6.7 <5, >=1.5.0 <2 |
yjs, fast-xml-parser | >=13.6.33 <14, >=5.12.0 <6 |
better-result, temporal-polyfill | >=3.0.1 <4, >=1.0.8 |
@openfeature/server-sdk, flags | >=1.23.0 <2, >=4.4.0 <5 |
@opentelemetry/api | >=1.9.1 <2 |
workflow | >=5.5.0 <6 |
@workflow/world, @workflow/world-postgres | >=5.2.0 <5.3, see Workflow 5.5 |
eve | >=1.0.0-rc.13 <2, see eve 1.0 |
@vercel/connect, @vercel/functions | >=2.7.0 <3, >=3.11.1 <4 |
@vercel/queue | >=0.11.0 <0.12 |
@vercel/sandbox | >=4.0.0 <5 |
@vercel/sandbox 4 talks to api.vercel.com over undici 8 and needs Node
22.19 or later; better-supabase already needs Node 24. @vercel/queue is a
0.x package, so 0.11 is a new minor range: upgrade it together with
better-supabase when you use vercelQueueProvider.
Expo
expo-server 58.1 is Expo SDK 58, which turns on data loaders, middleware and
server rendering with web.output: "server" alone. Remove the three
unstable_ options from the expo-router plugin in app.json; they are
deprecated in SDK 58 and have no effect. bsb.loader() now names
web.output when a route renders without a request.
New optional peers
0.67 declares eight more optional peers for the Vercel integrations:
@vercel/schedules, botid, @vercel/firewall, @vercel/passport,
@vercel/sdk, @vercel/functions, @vercel/kms and @vercel/blob.
better-supabase types them structurally or loads them on first use, so
nothing changes until you import the subpath that needs one.
Peers lists the ranges and subpaths.
Lite browser client
better-supabase/client/lite is removed, along with its optional peers
@supabase/auth-js and @supabase/realtime-js:
| Before | After |
|---|---|
import { createLiteBrowserClient } from "better-supabase/client/lite" | import { createClient } from "better-supabase/client" |
A route that used the lite client loads about 12 KB more. Uninstall
@supabase/auth-js and @supabase/realtime-js if nothing else in the app
imports them.
Session cookies
readSession is replaced by ssrSession, which decodes the cookies with the
@supabase/ssr helpers and returns a promise. applyCookieWrites is no
longer exported: let a createServerClient write the cookies.
| Before | After |
|---|---|
readSession(cookies, name) | await ssrSession(cookies, name) |
Chunks that don't parse together now read as no session, as they do in
@supabase/ssr.
Sign-in flows
The Next.js flows (signInWithPassword, verifyOtp, signInWithOAuth,
exchangeCodeForSession, the email flows, verifyMfa and signOut) call
auth-js on a createServerClient. Their results don't change, but a few
names do:
| Before | After |
|---|---|
passwordGrant from better-supabase/server | signInWithPassword on a createServerClient |
error code code_verifier_missing | pkce_code_verifier_not_found (auth-js) |
verifier cookie httpOnly, 10 minutes | the auth-js verifier cookie @supabase/ssr writes |
SignInWithOAuthParams.provider: string | Provider from @supabase/supabase-js |
A magic link or OAuth redirect from a flow that started before the deploy
fails the exchange once with pkce_code_verifier_not_found. Show the sign-in
page again so the user can request a new one. Flows the browser client starts
can now finish in exchangeCodeForSession on the server.
Notification avatars
The notifications block's avatars option takes a function of the object
path. For a public bucket, pass getPublicUrl from a supabase-js client:
const users = supabase.storage.from("users");
avatars: (path) => users.getPublicUrl(path).data.publicUrl;Session status
sessionStatus now calls auth.getUser. A 403 whose body is not Auth's JSON
(a proxy or firewall page) reads as unknown instead of ended, so it no
longer signs the user out.
Archive and purge
Records a person enters get an archive and a restore, and their hard delete
becomes purge (ADR 1041). Archiving keeps the row, hides it from the lists
and records <entity>.archived. restore brings it back and records
<entity>.restored. purge removes it for good, records <entity>.purged and
needs permissions.purge, which falls back to the block's manage key until
you set it. Run better-supabase upgrade and apply the migration, which adds
the archived_at column and replaces the delete function with purge.
| Block | Before | After |
|---|---|---|
announcements | announcements.remove(id), delete_announcement() | announcements.purge(id), purge_announcement() |
announcements | event announcement.deleted | announcement.purged, plus archived and restored |
announcements | announcements.list() shows every row | hides archived rows; list({ includeArchived: true }) adds them |
maintenance | maintenance.deletePlan(id), delete_maintenance_plan() | maintenance.purgePlan(id), purge_maintenance_plan(), plus archivePlan and restorePlan |
maintenance | event maintenance_plan.deleted | maintenance_plan.purged, plus archived and restored |
maintenance | an archived plan can still be due | an archived plan is never due and opens no work order; listPlans({ archived: true }) lists them |
funding | funding.deleteClaim(id), delete_funding_claim() | funding.purgeClaim(id), purge_funding_claim(), plus archiveClaim and restoreClaim |
funding | event funding_claim.deleted | funding_claim.purged, plus archived and restored |
funding | funding.claims() shows every claim | hides archived claims; claims({ includeArchived: true }) adds them |
meetings | meetings.delete(id), delete_meeting() | meetings.purge(id), purge_meeting(), plus archive and restore |
meetings | event meeting.deleted | meeting.purged, plus archived and restored |
meetings | meetings.list() shows every meeting | hides archived meetings; list({ archived: true }) lists only them |
courses | courses.delete(id), delete_course() | courses.purge(id), purge_course(), plus archive and restore |
courses | event course.deleted | course.purged, plus archived and restored |
time_entries | timeEntries.remove(id), delete_time_entry() | timeEntries.purge(id), purge_time_entry(), plus archive and restore (ADR 1046) |
time_entries | event time_entry.deleted | time_entry.purged, plus archived and restored |
products | catalog.deleteProduct(id), delete_product() | catalog.purgeProduct(id), purge_product(), plus archiveProduct and restoreProduct (ADR 1048) |
product_variants | catalog.deleteVariant(id), delete_variant() | catalog.purgeVariant(id), purge_variant(), plus archiveVariant and restoreVariant (ADR 1049) |
products | events product.deleted, product_variant.deleted | product.purged, product_variant.purged, plus archived and restored |
products | blocks.catalog.permissions.delete | permissions.purge (falls back to catalog.manage) |
time_entries | an entry always counts toward totals and reports | an archived entry leaves lists, totals, billing, payroll and metrics and never blocks an overlap |
activities | activities.remove(id), delete_activity() | activities.purge(id), purge_activity(), plus archive and restore (ADR 1047) |
activities | event activity.deleted | activity.purged, plus archived and restored |
activities | activities.of() shows every activity | hides archived activities; of(subject, { archived: true }) lists only them |
posts | posts.delete(id), delete_post() | posts.purge(id), purge_post(), plus archive and restore |
posts | event post.deleted | post.purged, plus archived and restored |
posts | posts.list() shows every post | hides archived posts; list({ archived: true }) lists only them |
employees | employees.delete(id), delete_employee() | employees.purge(id), purge_employee(); offboarding stays the archive |
employees | event employee.deleted | employee.purged |
employees | hooks before_employee_delete, after_employee_delete | before_employee_purge, after_employee_purge |
calendar | calendar.delete(eventId), delete_calendar_event() | calendar.purge(eventId), purge_calendar_event(); cancelled stays the archive |
calendar | event calendar_event.deleted | calendar_event.purged |
calendar | permissions.delete on an event | permissions.purge; delete is still read when purge is unset |
expenses | expenses.deleteExpense(id), delete_expense() | expenses.purgeExpense(id), purge_expense(); the status stays the archive |
expenses | event expense.deleted | expense.purged |
expenses | permissions.delete | permissions.purge; delete is still read when purge is unset |
scores | scores.deleteModel(id), delete_score_model() | scores.purgeModel(id), purge_score_model() (ADR 1053) |
scores | event score_model.deleted | score_model.purged, plus archived and restored |
scores | models() and list_score_models() show every row | hide archived models; models({ includeArchived: true }) adds them |
clinical-decision-support | deleteRule(id), delete_care_rule() | purgeRule(id), purge_care_rule() (ADR 1054) |
clinical-decision-support | event care_rule.deleted | care_rule.purged, plus archived and restored |
clinical-decision-support | rules() and list_care_rules() show every rule | hide archived rules; rules({ includeArchived: true }) adds them |
agents | agents.remove(id), delete_agent() | agents.purge(id), purge_agent() (ADR 1080) |
agents | event agent.deleted | agent.purged, plus archived and restored |
agents | agents.list() shows every agent | hides archived agents; list({ includeArchived: true }) adds them |
custom-fields | deleteDefinition(id), delete_field_definition() | purgeDefinition(id), purge_field_definition() (ADR 1083) |
custom-fields | event field_definition.deleted | field_definition.purged, plus archived and restored |
custom-fields | listDefinitions(entity) shows every field | hides archived fields; listDefinitions({ entity, includeArchived: true }) adds them |
drive | deleteDrive(id), drive_delete_drive() | purgeDrive(id) after archiveDrive(id), drive_purge_drive() (ADR 1084) |
drive | event drive.deleted | drive.purged, plus archived and restored |
drive | drives() shows every drive | hides archived drives; drives({ options: { includeArchived: true } }) adds them |
enrollments | deleteProgram(id), delete_enrollment_program() | purgeProgram(id) after archiveProgram(id), purge_enrollment_program() (ADR 1085) |
enrollments | event enrollment_program.deleted | enrollment_program.purged, plus archived and restored |
enrollments | programs() shows every program | hides archived programs; programs({ includeArchived: true }) adds them |
Team purge
A team that can be archived and restored no longer has a delete: the hard
delete is purge, behind its own permissions.purge key (ADR 0851). Archive
keeps the row and restore brings it back.
| Before | After |
|---|---|
teams.delete(id) | teams.purge(id) |
SQL function delete_team(team) | purge_team(team) |
Event team.deleted | team.purged (team_member.deleted is unchanged) |
blocks.teams.permissions.delete | blocks.teams.permissions.purge |
teamsRoute needs delete on its TeamWrites | purge |
Run better-supabase upgrade and apply the migration, which drops
delete_team and adds purge_team. A permissions.delete entry on the teams
block is ignored after the upgrade, so purging falls back to manage until
you set purge. Sinks and workflows that match team.deleted need the new
type.
Submission purge
A form submission can now be archived and restored, so its hard delete is
purge (ADR 1051). Archive keeps the row, hides it from listSubmissions and
nps, and restoreSubmission brings it back.
| Before | After |
|---|---|
forms.deleteSubmission(id) | forms.purgeSubmission(id) |
SQL function delete_form_submission | purge_form_submission(submission_id) |
Event form_submission.deleted | form_submission.purged |
list_form_submissions(...) four args | a fifth argument, include_archived (default false) |
| no archive | archiveSubmission, restoreSubmission, archivedAt |
Run better-supabase upgrade and apply the migration, which adds the
archived_at column, drops delete_form_submission and the four-argument
list_form_submissions, and adds the new functions. Purging needs the review
permission until you set permissions.purge. Sinks and workflows that match
form_submission.deleted need the new type, and a hooks.deleteSubmission
entry moves to hooks.purgeSubmission.
eve 1.0
better-supabase/eve follows eve 1.0 and accepts eve >=1.0.0-rc.13 <2
(ADRs 1022 and 1023). Upgrade eve first with eve's own
upgrade guide, then change these:
| Before | After |
|---|---|
persistSessions handlers message.received, message.completed | delivery.consumed, content.completed |
persistSessions handlers turn.completed, turn.failed, cancelled | turn.settled, with the outcome as the run's status |
EveTokenAuthorization.credentialOwner | principalType, which credentialAuth and openApiAuth now return |
EveApprovalResponseContext request.requestId | request.interactionId |
an approval answer decision: "cancel" | decision: "deny"; approvalPolicy treats it as before |
EveApprovalStatus | also { type: "not-applicable" } and { type: "user-approval" } |
EveMemoryTool.inputSchema: unknown | a JSON Schema object, as eve's MemoryToolSet requires |
defineHook({ events: persistSessions(...) }) needs no change of its own, but
any hook of yours that reads v26 event names stops firing; eve's guide maps
them. Messages that persistSessions stores from now on have ids
<turnId>:<deliveryId> and <turnId>:<partId>, so a turn that started
before the upgrade and finishes after it can store its reply twice.
eve build in 1.0 rejects a tool input schema it can't turn into JSON
Schema, such as a plain Valibot schema: wrap it in toStandardJsonSchema from
@valibot/to-json-schema when you pass it to supabaseTool. queueScheduleProvider and queueDynamicSchedules are new:
they store eve's dynamic schedules in the queue block's drain scheduler (see
eve on Supabase).
eve 1.0.0-rc.13 marks content.completed's runId optional: a part the turn
wrote without a model run has none, and scope.turnId names its turn.
persistSessions stores such a part like any other. A hook of yours that
reads event.data.runId needs a fallback.
Workflow 5.5
better-supabase/workflow-sdk/world speaks the @workflow/world 5.2
protocol, so it needs workflow 5.5 and @workflow/world and
@workflow/world-postgres 5.2 (ADR 1023):
pnpm add workflow@5.5.0 @workflow/world@5.2.0 @workflow/world-postgres@5.2.0
pnpm better-supabase upgradeApply the migration upgrade writes before you deploy: workflow-sdk
version 5 adds the workflow.workflow_job_lock_holders table. eve
1.0.0-rc.13 bundles Workflow 5.5 and moves with it. Runs started on
workflow 5.4 keep running, and new runs stay on spec version 8 unless
WORKFLOW_SPEC_VERSION=9 is set (see
Rolling out 5.2).
Per-row bulk
drive.bulkShare, filespace.bulkShare and customFields.bulkSet give each
row its own value and return the common { succeeded, failed } report (ADR
1075). The calls they replace still work and are marked @deprecated. They
are removed in 0.70.
| Old | New |
|---|---|
drive.shareMany({ ids, grants }) | drive.bulkShare(ids.map((id) => ({ id, grants }))) |
filespace.shareMany({ id, principals, expiresAt }) | filespace.bulkShare({ id, principals, expiresAt }) |
customFields.setMany({ subject, inputs }) | customFields.bulkSet({ subject, inputs }) |
The new calls do not stop at the first failure and return the grants or values
they wrote only as ids. A caller that needs the written rows reads them with
drive.grants or customFields.readFields.
Last updated on
From 0.57 to 0.58
What to change when upgrading from better-supabase 0.57 to 0.58. One naming convention for config keys, exports, SQL objects and blocks, declarative module files, CLI contract 3, and the codemods that apply most of it. The organization key moves to auth.tenant by hand.
From 0.79 to 0.80
What to change when upgrading from better-supabase 0.79 to 0.80. eve 1.2 and Workflow 5.7, SQL modules at new versions, persistSessions that only wakes the session sync, WorkflowAgent toolApproval, the key ring and Vercel Queues delivery.