Skip to content

Releases: floatingpixels/supabase-nuxt

v0.6.0

13 Mar 15:11
f032635

Choose a tag to compare

Release Notes 0.6.0

Summary

This release introduces a breaking change to useSupabaseUser() and expands the module test suite substantially.

It also fixes two runtime issues:

  • configured login redirects now respect redirectOptions.login
  • clientOptions are now applied to Supabase client creation on both client and server

Breaking Change: useSupabaseUser()

useSupabaseUser() no longer returns raw claims directly.

It now returns a normalized user-shaped object:

type SupabaseAuthUser = {
  id: string
  email?: string
  phone?: string
  role?: string
  aud?: string
  app_metadata: Record<string, unknown>
  user_metadata: Record<string, unknown>
  claims: Record<string, unknown>
}

The signed-out state is now:

{ data: null, error: null }

instead of returning undefined user data.

Why

Consumers of the module should get a sane user-centric default without having to understand the difference between getClaims() and getUser().

The implementation now:

  • uses auth.getClaims() first for a fast auth-state path
  • falls back to auth.getUser() only when claim data is too sparse to build the normalized user object

This preserves the performance advantages of claims-based auth while giving callers a more stable and beginner-friendly public API.

Required Changes for Consumers

1. Update signed-out checks

Before:

const { data: user } = await useSupabaseUser()

if (user === undefined) {
  // signed out
}

After:

const { data: user } = await useSupabaseUser()

if (user === null) {
  // signed out
}

2. Update raw claim access

Before:

const { data: user } = await useSupabaseUser()
console.log(user?.sub)
console.log(user?.email)

After:

const { data: user } = await useSupabaseUser()
console.log(user?.claims.sub)
console.log(user?.email)

3. Update metadata access

Before:

const { data: user } = await useSupabaseUser()
console.log(user?.first_name)

After:

const { data: user } = await useSupabaseUser()
console.log(user?.user_metadata?.first_name)

Commits:

  • chore: update test tooling and nix environment (b157296)
  • docs: add testing guide and migration notes (d84af20)
  • test: expand module and integration coverage (1cf6cc5)
  • fix: honor redirect login path and supabase client options (5136539)
  • feat!: normalize useSupabaseUser return value (329ca25)

v0.5.12

30 Jan 14:24
e17bdc0

Choose a tag to compare

  • chore(packages): update packages (d28e17e)

v0.5.11

08 Jan 12:04
04e41ba

Choose a tag to compare

  • chore(packages): update packages (1da461c)

v0.5.10

18 Dec 11:54
ce6641e

Choose a tag to compare

  • chore(packages): update packages (dcd62a6)
  • test: test for type inference, test:bun stub as temp workaround (ecb1038)

v0.5.9

05 Dec 12:43
c6bac62

Choose a tag to compare

  • fix(packages): include supabase-js in optimizeDeps to avoid esm issue (70661bc)

v0.5.8

05 Dec 11:53
2a9c2b9

Choose a tag to compare

  • chore(packages): update supabase and supabase ssr (93cebb6)
  • fix(playground): add Database types to check for type inference (db0072e)

v0.5.7

25 Nov 10:09
ab5f70c

Choose a tag to compare

  • chore(packages): update supabase and other packages (9f22e70)
  • ci(nix): improved flake and flake update (1e222f1)
  • fix(playground): ignore direnv folder (56a81b4)

v0.5.6

11 Nov 15:15
0182d74

Choose a tag to compare

  • fix(playground): fix ts errors in playground (88ab657)
  • chore(packages): update nix flake to lates nodejs LTS 24, add supabase to path (3d6d4f6)
  • chore(packages): update supabase and packages to latest (0010d5c)

v0.5.5

27 Oct 14:37
617eed9

Choose a tag to compare

  • chore(packages): update packages (00c2881)
  • fix(docs): fix email sign in example, correct cofirm default path for email template (3e37721)

v0.5.4

13 Oct 14:28
5b3c917

Choose a tag to compare

  • chore(packages): udpate supabase to 2.51.0 (cbe0674)