• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth-js / 15436819162
71%

Build:
DEFAULT BRANCH: master
Ran 04 Jun 2025 07:58AM UTC
Jobs 2
Files 15
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Jun 2025 07:57AM UTC coverage: 64.468% (-2.2%) from 66.618%
15436819162

push

github

web-flow
feat: introduce experimental split user and session storage (#1023)

A common complaint when using Supabase in SSR is that the cookie size is
huge. Some server configurations are not able to use such large cookies.

A major contributor to cookie size is that the user object is stored
alongside the access and refresh tokens. This object _should not be used
on the server_ but nevertheless has to exist to make this library happy.

This change introduces the ability for this library to store the user
object in a separate storage location. For now it's experimental mode to
be proofed before being widely adopted.

**How does it work?**

You can initialize the client by passing in a new option `userStorage`
in addition to the already existing and optional `storage` option. By
default `userStorage` is not set and a single storage is used for all
elements of the session (including `user` property).

If `userStorage` is set, **all future changes to the session** will
write the user there, and the rest of the session object to `storage`.

**Unsolvable Problems**

Say you set up the client like so:

```typescript
new GoTrueClient(URL, {
  // ...
  storage: cookieStorage,
  userStorage: window.localStorage,
})
```

On the server, the cookies -- obviously -- will not contain the `user`
object. Because the `Session` type defines `user: User` as non-nullable,
attempting to access a property on this object will throw an exception.
Instead you should always call `getUser()` to fetch a trusted and fresh
user object. This problem will be solved in v3 of this library.

**Testing**

[This PR](https://github.com/supabase/supabase/pull/32833) can be used
to test this PR before merging. Merging should be safe as this is opt-in
behavior for now.

---------

Co-authored-by: Cemal Kilic <cemalkilic96@gmail.com>
Co-authored-by: Cemal Kılıç <cemalkilic@users.noreply.github.com>

692 of 1267 branches covered (54.62%)

Branch coverage included in aggregate %.

19 of 65 new or added lines in 2 files covered. (29.23%)

1155 of 1598 relevant lines covered (72.28%)

119.61 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
11
73.36
-2.15% src/lib/helpers.ts
35
55.35
-1.88% src/GoTrueClient.ts
Jobs
ID Job ID Ran Files Coverage
1 15436819162.1 04 Jun 2025 07:58AM UTC 15
64.08
GitHub Action Run
2 15436819162.2 04 Jun 2025 07:59AM UTC 15
63.63
GitHub Action Run
Source Files on build 15436819162
  • Tree
  • List 15
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • e7b2f216 on github
  • Prev Build on master (#15253919607)
  • Next Build on master (#15488988768)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc