Detalhes do pacote

@supabase/auth-js

supabase26.3mMIT2.89.0

Official SDK for Supabase Auth

auth, supabase, auth, authentication

readme (leia-me)


<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--light.svg"> Supabase Logo </picture>

Supabase JS SDK

Guides · Reference Docs

Build Package License: MIT pkg.pr.new

For contributors: Repository Structure Changed

This repository has been restructured as a monorepo. All libraries, including supabase-js itself, have moved to packages/core/:

What You're Looking For Where It Is Now
Main supabase-js code packages/core/supabase-js/
Other libraries packages/core/*/

Read the Migration Guide to learn more.

📦 Libraries

This monorepo contains the complete suite of Supabase JavaScript SDK:

Library Description
@supabase/supabase-js Main isomorphic SDK for Supabase
@supabase/auth-js Authentication SDK
@supabase/postgrest-js PostgREST SDK for database operations
@supabase/realtime-js Real-time subscriptions SDK
@supabase/storage-js File storage SDK
@supabase/functions-js Edge Functions SDK

Support Policy

This section outlines the scope of support for various runtime environments in Supabase JavaScript client.

Node.js

We only support Node.js versions that are in Active LTS or Maintenance status as defined by the official Node.js release schedule. This means we support versions that are currently receiving long-term support and critical bug fixes.

When a Node.js version reaches end-of-life and is no longer in Active LTS or Maintenance status, Supabase will drop it in a minor release, and this won't be considered a breaking change.

⚠️ Node.js 18 Deprecation Notice

Node.js 18 reached end-of-life on April 30, 2025. As announced in our deprecation notice, support for Node.js 18 was dropped in version 2.79.0.

If you must use Node.js 18, please use version 2.78.0, which is the last version that supported Node.js 18.

Deno

We support Deno versions that are currently receiving active development and security updates. We follow the official Deno release schedule and only support versions from the stable and lts release channels.

When a Deno version reaches end-of-life and is no longer receiving security updates, Supabase will drop it in a minor release, and this won't be considered a breaking change.

Browsers

All modern browsers are supported. We support browsers that provide native fetch API. For Realtime features, browsers must also support native WebSocket API.

Bun

We support Bun runtime environments. Bun provides native fetch support and is compatible with Node.js APIs. Since Bun does not follow a structured release schedule like Node.js or Deno, we support current stable versions of Bun and may drop support for older versions in minor releases without considering it a breaking change.

React Native

We support React Native environments with fetch polyfills provided by the framework. Since React Native does not follow a structured release schedule, we support current stable versions and may drop support for older versions in minor releases without considering it a breaking change.

Cloudflare Workers

We support Cloudflare Workers runtime environments. Cloudflare Workers provides native fetch support. Since Cloudflare Workers does not follow a structured release schedule, we support current stable versions and may drop support for older versions in minor releases without considering it a breaking change.

Important Notes

  • Experimental features: Features marked as experimental may be removed or changed without notice

🚀 Quick Start

Installation

npm install @supabase/supabase-js

Read more in each package's README file.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and add tests
  4. Run tests (npx nx affected --target=test)
  5. Commit your changes (npm run commit)
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Guidelines

  • Follow conventional commits for commit messages
  • Add tests for new functionality
  • Update documentation for API changes
  • Run npx nx format before committing
  • Ensure all tests pass with npx nx affected --target=test

🧪 Testing

Testing varies per package. See the top-level TESTING.md for an overview and links to package-specific guides.

📚 Documentation

API Documentation

Architecture Documentation

🔐 Verifying provenance attestations

You can verify registry signatures and provenance attestations for installed packages using the npm CLI:

npm audit signatures

Quick example for a single package install:

npm install @supabase/auth-js
npm audit signatures

Example output:

audited 1 package in 0s

1 package has a verified registry signature

Because provenance attestations are a new capability, security features may evolve over time. Ensure you are using the latest npm CLI to verify attestation signatures reliably. This may require updating npm beyond the version bundled with Node.js.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support


changelog (log de mudanças)

2.88.0 (2025-12-16)

🚀 Features

  • auth: allow custom predicate for detectSessionInUrl option (#1958)
  • postgrest: add notin filter (#1957)
  • repo: migrate build system to tsdown for proper ESM/CJS support (#1961)

🩹 Fixes

  • realtime: handle websocket race condition in node.js (#1946)
  • realtime: omit authorization header when no access token exists (#1937)

❤️ Thank You

  • Katerina Skroumpelou @mandarini
  • Vaibhav @7ttp

2.87.3 (2025-12-15)

🩹 Fixes

  • supabase: resolve jsDelivr CDN ESM import failure with .js extensions (#1953)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.87.2 (2025-12-15)

🩹 Fixes

  • auth: add helpful error when PKCE code verifier is missing (#1931)
  • realtime: terminate web worker on disconnect to prevent memory leak (#1907)
  • supabase: resolve jsDelivr CDN ESM import failure (#1950)

❤️ Thank You

  • Katerina Skroumpelou @mandarini
  • Tanmay Sharma @tanmaysharma2001

2.87.1 (2025-12-09)

🩹 Fixes

  • auth: skip navigator lock when persistSession is false (#1928)
  • realtime: preserve custom JWT tokens across channel resubscribe (#1908)
  • realtime: handle null values in postgres changes filter comparison (#1918)

❤️ Thank You

  • Liam
  • Vaibhav @7ttp

2.87.0 (2025-12-08)

🚀 Features

  • storage: align analytics from method with { data, error } pattern (#1927)

🩹 Fixes

  • repo: update lock file after dependabot to use npm 11 (#1926)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.86.2 (2025-12-04)

🩹 Fixes

  • storage: correct QueryVectorsResponse to use vectors instead of matches (#1922)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.86.1 (2025-12-04)

🩹 Fixes

  • auth: suppress getsession warning when getuser is called first (#1898)
  • auth: code verifier remains in storage during edge cases (#1759)
  • postgrest: cross-schema rpc setof type inference (#1900)
  • repo: update lock file (#1910)
  • repo: lock file issues (#1919)
  • repo: update npm and install again (#1920)
  • supabase: add esm wrapper to resolve module not found error in nuxt (#1914)

❤️ Thank You

  • Katerina Skroumpelou @mandarini
  • Vaibhav @7ttp

2.86.0 (2025-11-26)

🚀 Features

  • storage: install iceberg-js and add from method (#1881)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.85.0 (2025-11-26)

🚀 Features

  • realtime: add metadata to realtime user broadcast push (#1894)

🩹 Fixes

  • auth: oauth minor fixes on types (#1891)

❤️ Thank You

  • Cemal Kılıç @cemalkilic
  • Eduardo Gurgel

2.84.0 (2025-11-20)

🚀 Features

  • postgrest: add isdistinct and regex pattern matching operators (#1875)

🩹 Fixes

  • postgrest: validate empty or invalid relation names in Postgrest… (#1863)
  • realtime: simplify serializer by removing unnecessary types of messages (#1871)

❤️ Thank You

  • Eduardo Gurgel
  • Katerina Skroumpelou @mandarini
  • Soufiane Radouane @sofmega

2.83.0 (2025-11-18)

🚀 Features

  • storage: rename StorageAnalyticsApi to StorageAnalyticsClient (#1869)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.82.0 (2025-11-18)

🚀 Features

  • auth: add OAuth grant listing and revocation endpoints (#1833)

🩹 Fixes

  • postgrest: bubble up fetch error causes and codes (#1856)
  • realtime: account for null refs when encoding messages (#1862)
  • storage: analytics bucket prop (#1852)

❤️ Thank You

  • Cemal Kılıç @cemalkilic
  • Eduardo Gurgel
  • Fabrizio @fenos
  • Katerina Skroumpelou @mandarini

2.81.1 (2025-11-11)

🩹 Fixes

  • auth: use Symbols for callback IDs to resolve Next.js 16 compatibility (#1847)
  • auth: add automatic browser redirect to signInWithSSO (#1849)
  • realtime: setAuth not required on custom jwt token (#1826)

❤️ Thank You

  • Filipe Cabaço @filipecabaco
  • Katerina Skroumpelou @mandarini

2.81.0 (2025-11-10)

🚀 Features

  • realtime: implement V2 serializer (#1829)

🩹 Fixes

  • auth: make webauthn param optional and move register params to webauthn (#1765)
  • auth: add providers type to UserAppMetadata interface (#1760)
  • auth: use direct attestation for registration/authentication (#1764)
  • functions: add configurable timeout and normalize abort/timeout errors as FunctionsFetchError (#1837)
  • realtime: ensure WebSocket connections are properly closed in teardown (#1841)

❤️ Thank You

  • Eduardo Gurgel
  • Katerina Skroumpelou @mandarini
  • Tanmay Sharma @tanmaysharma2001

2.80.0 (2025-11-06)

🚀 Features

  • auth: add TypeScript types for documented JWT claims fields (#1802)

🩹 Fixes

  • auth: only warn if multiple clients share a storage-key (#1767)

❤️ Thank You

  • Steve Hall @sh41
  • Sumit Kumar @Software-Engineering-Project-Team-Bob

2.79.0 (2025-11-04)

🚀 Features

  • auth: support throwing errors instead of returning them (#1766)
  • repo: remove node-fetch dependency, require Node.js 20+ (#1830)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.78.0 (2025-10-30)

🚀 Features

  • auth: add OAuth 2.1 authorization consent management API calls (#1793)
  • auth: add OAuth client update support (#1812)
  • auth: refactor getAuthenticatorAssuranceLevel method (#1822)

🩹 Fixes

  • auth: remove redirection in getAuthorizationDetails (#1811)
  • auth: move session warning proxy from session to user object (#1817)

❤️ Thank You

  • Cemal Kılıç @cemalkilic
  • Katerina Skroumpelou @mandarini
  • Stojan Dimitrovski @hf

2.77.0 (2025-10-29)

🚀 Features

  • auth: add OAuth 2.1 authorization consent management API calls (#1793)
  • auth: add OAuth client update support (#1812)
  • storage: add support for bucket pagination and sorting (#1790)

🩹 Fixes

  • auth: handle 204 No Content response in OAuth client delete (#1786)
  • auth: remove redirection in getAuthorizationDetails (#1811)
  • postgrest: add incoming major 14 support (#1807)
  • repo: add missing tslib dependency to core packages (#1789)
  • repo: cleanup package-lock.json and bun.lock (#1799)
  • storage: remove unnecessary filter (#1809)

🔥 Performance

  • precompile RegExp (#1806)

❤️ Thank You

  • Andrew Valleteau @avallete
  • Cemal Kılıç @cemalkilic
  • Fabrizio @fenos
  • Katerina Skroumpelou @mandarini
  • Kevin Grüneberg @kevcodez
  • Lenny @itslenny

2.76.1 (2025-10-21)

🩹 Fixes

  • repo: add missing tslib dependency to core packages (#1789)

❤️ Thank You

  • Katerina Skroumpelou @mandarini

2.76.0 (2025-10-20)

🚀 Features

  • realtime: realtime explicit REST call (#1751)
  • realtime: enhance RealtimeChannel type (#1747)
  • storage: storage vectors and analytics in storage-js (#1752)

🩹 Fixes

  • functions: missing body when Content-Type header supplied by dev (#1758)
  • functions: add application/pdf response parsing to FunctionsClient (#1757)
  • realtime: manipulate URLs using URL object (#1769)
  • repo: convert postbuild to explicit codegen (#1778)
  • storage: correct list v2 types to correctly match data returned from api (#1761)
  • storage: use backward compatible return type in download function (#1750)
  • storage: api types (#1784)

❤️ Thank You

  • Fabrizio @fenos
  • Filipe Cabaço @filipecabaco
  • Guilherme Souza
  • Katerina Skroumpelou @mandarini
  • Lenny @itslenny

2.75.1 (2025-10-17)

🩹 Fixes

  • storage: use backward compatible return type in download function (#1750)

❤️ Thank You

  • Lenny @itslenny

2.75.0 (2025-10-09)

🚀 Features

  • postgrest: add embeded functions type inference (#1632)

❤️ Thank You

  • Andrew Valleteau @avallete

2.74.0 (2025-10-07)

🚀 Features

  • auth: add deprecation notice to onAuthStateChange with async function (#1580)
  • auth: add OAuth 2.1 client admin endpoints (#1582)
  • docs: explicitly mark options as optional (#1622)
  • realtime: add support to configure Broadcast Replay (#1623)
  • release: enable trusted publishing (#1592)
  • storage: add support for sorting to list v2 (#1606)

🩹 Fixes

  • storage: remove trailing slash from baseUrl normalization (#1589)

❤️ Thank You

  • Cemal Kılıç @cemalkilic
  • Doğukan Akkaya
  • Eduardo Gurgel
  • Etienne Stalmans @staaldraad
  • Lenny @itslenny
  • Stojan Dimitrovski @hf
  • Taketo Yoshida