We've been hard at work making an Auth experience that is as smooth as possible for Supabase developers. One of the challenges has been creating a simple experience for server-side rendering (SSR) environments. We previously released our Auth Helpers libraries with support for React and NextJS, and today we’re announcing some exciting updates.
What are Auth Helpers?
Auth Helpers are a collection of framework-specific utilities for Supabase Auth. They allow you to implement secure applications with little effort. These libraries include functions for protecting API routes and pages in your applications.
Today, we’re adding support for SvelteKit. We’ve tried to keep the library’s interface similar to the other frameworks. This makes transitioning between frameworks seamless. You can follow our step by step guide on how to get this setup.
We’ve changed the name from
@supabase/auth-helpers. With this change we:
- Reset to a sub
0.xversion number. This makes sense given that SvelteKit itself is still pre-1.0. And being pre-1.0 helps to manage expectations for future breaking changes.
- Removed an extra “supabase”. We realized that the namespace already contained
supabasein it and we didn’t want to double up (naming is hard!).
We’ve moved the Auth Helpers into a monorepo so that we can publish packages individually rather than using the same package name for every framework. Each package only includes relevant dependencies - (eg, Next.js helpers don’t include SvelteKit dependencies).
We use Turborepo for managing our monorepo pipelines and have been incredibly pleased with its caching and performance. For packaging, we use changesets and GitHub Actions to create the release and publish to the npm registry. Each library lives in its own directory inside of the packages directory, with accompanying example applications making use of the library inside the examples directory.
We minimized the breaking changes as much as possible, but there were a few that were necessary. With that in mind we have provided a guide for migrating away from the old
@supabase/supabase-auth-helpers library over to the new
Having good documentation is great, especially when there are examples to augment. We’re always looking for community support in expanding our list of examples. If you have an interesting use case that you thing others may benefit from please consider contributing it.
Remix Auth Helpers are in the works. You can follow the development of this on our GitHub repo, or subscribe to our Supabase YouTube channel as we build it live on air.
Contributors are welcome! You can help by creating pull requests, reporting bugs, writing documentation, replying to issues on our GitHub issue tracker, and helping others with questions they may have about using the library. If you’re already an active contributor to Supabase or any associated open source projects, consider applying to join the SupaSquad.
Big shoutout to Willow aka GHOST for her help with the Svelte/SvelteKit auth helper libraries.