---
title: "supabase-js v2"
description: "Supabase announces supabase-js v2, a release focused on developer quality-of-life improvements and designed around incremental changes rather than a large rewrite. Its type system uses CLI-generated database definitions at the client level, while authentication adds explicit signInWithPassword() and signInWithOtp() methods, makes most Auth operations asynchronous, and moves server-side methods under auth.admin. Data mutations return minimal by default unless select() is appended, constructor options are scoped by library, and Edge Functions automatically detect request and response content types. The release also introduces typed errors, a channel() interface for presence and PostgreSQL change subscriptions, and a preparatory path toward multiplayer features; older realtime syntax remains supported for now. Developers can install v2, consult updated documentation and migration guidance, while v1 continues receiving security fixes and maintenance patches for three months."
---

# supabase-js v2

[Supabase](https://yomu.fyi/company/supabase) · inian,alaister · Aug 16, 2022

**Type:** Announcement

## Summary

Supabase announces supabase-js v2, a release focused on developer quality-of-life improvements and designed around incremental changes rather than a large rewrite. Its type system uses CLI-generated database definitions at the client level, while authentication adds explicit signInWithPassword() and signInWithOtp() methods, makes most Auth operations asynchronous, and moves server-side methods under auth.admin. Data mutations return minimal by default unless select() is appended, constructor options are scoped by library, and Edge Functions automatically detect request and response content types. The release also introduces typed errors, a channel() interface for presence and PostgreSQL change subscriptions, and a preparatory path toward multiplayer features; older realtime syntax remains supported for now. Developers can install v2, consult updated documentation and migration guidance, while v1 continues receiving security fixes and maintenance patches for three months.

## Context

Supabase users identified recurring pain points through feedback, including unclear authentication methods, confusion around configuration names, unexpected data returned from mutations, authentication session issues, and limited detail in generated types. The v1 library had been used in over 17K repositories and reached 50K weekly downloads.

## Approach / What changed

Version 2 applies incremental API and developer-experience changes: CLI-generated database types are supplied at the client level; Auth methods are renamed, made asynchronous, and reorganized under auth.admin; mutations default to minimal returns; constructor settings are scoped by library; typed errors and automatic Edge Functions content-type detection are added; and channel() prepares the realtime API for multiplayer features.

## Takeaways

- insert(), update(), and upsert() return minimal data by default; callers must append select() when they want returned data.
- All Auth admin methods are under supabase.auth.admin and require a SERVICE\_ROLE key, clarifying that they belong in trusted server-side environments.
- The new channel() interface supports presence and postgres\_changes subscriptions, while the existing from().on().subscribe() syntax remains supported temporarily.

**Tags:** [Authentication](https://yomu.fyi/topic/authentication), [Developer Experience](https://yomu.fyi/topic/developer-experience), [Migrations](https://yomu.fyi/topic/migration), [TypeScript](https://yomu.fyi/topic/typescript)

- Source: [Supabase](https://supabase.com/blog/supabase-js-v2)
- Source URL: https://supabase.com/blog/supabase-js-v2
- Ingested by Yomu: 2026-08-28T12:00:53.415Z

[Read original post](https://supabase.com/blog/supabase-js-v2)
