Skip to content

Commit 9692ee9

Browse files
committed
feat(repo): remove node-fetch dependency, require Node.js 20+
1 parent 7511686 commit 9692ee9

File tree

26 files changed

+191
-179
lines changed

26 files changed

+191
-179
lines changed

.github/workflows/ci-auth-js-node18.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@
4141

4242
This monorepo contains the complete suite of Supabase JavaScript SDK:
4343

44-
| Library | Description |
45-
| ---------------------------------------------------------- | ---------------------------------------- |
44+
| Library | Description |
45+
| ---------------------------------------------------------- | ------------------------------------- |
4646
| **[@supabase/supabase-js](./packages/core/supabase-js)** | Main isomorphic SDK for Supabase |
4747
| **[@supabase/auth-js](./packages/core/auth-js)** | Authentication SDK |
4848
| **[@supabase/postgrest-js](./packages/core/postgrest-js)** | PostgREST SDK for database operations |
4949
| **[@supabase/realtime-js](./packages/core/realtime-js)** | Real-time subscriptions SDK |
5050
| **[@supabase/storage-js](./packages/core/storage-js)** | File storage SDK |
5151
| **[@supabase/functions-js](./packages/core/functions-js)** | Edge Functions SDK |
5252

53+
## Requirements
54+
55+
- **Node.js 20 or later** (Node.js 18 support was dropped as of October 31, 2025)
56+
- For browser support, all modern browsers are supported
57+
58+
> ⚠️ **Node.js 18 Deprecation Notice**
59+
>
60+
> Node.js 18 reached end-of-life on April 30, 2025. As announced in [our deprecation notice](https://github.com/supabase/supabase-js/discussions/37217), support for Node.js 18 was dropped on October 31, 2025.
61+
>
62+
> If you must use Node.js 18, please use version `2.x.x` of these libraries where `x` is the last version that supported Node.js 18.
63+
5364
> **💡 Note for Package Users:** If you install and use these packages, **nothing has changed**. Continue installing packages normally:
5465
>
5566
> ```bash

docs/MIGRATION.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,91 @@
44
55
> **📦 Note for Package Users:** If you install and use these packages via npm, **nothing changed**. This guide is for contributors who develop and maintain these libraries.
66
7+
---
8+
9+
## 🔴 Node.js 18 Support Dropped
10+
11+
**Effective Date:** October 31, 2025
12+
13+
### What Changed
14+
15+
Starting with version `2.XX.0` (where XX is the version where this change is released), all Supabase JavaScript libraries require **Node.js 20 or later**. The `@supabase/node-fetch` polyfill has been removed, and native fetch support is now required.
16+
17+
### Why?
18+
19+
Node.js 18 reached end-of-life on April 30, 2025, and no longer receives security updates or critical fixes. Node.js 20+ includes native fetch support, eliminating the need for polyfills and reducing bundle size.
20+
21+
### Affected Libraries
22+
23+
- `@supabase/supabase-js`
24+
- `@supabase/auth-js`
25+
- `@supabase/postgrest-js`
26+
- `@supabase/realtime-js`
27+
- `@supabase/storage-js`
28+
- `@supabase/functions-js`
29+
30+
### Migration Guide
31+
32+
**1. Upgrade Node.js** to version 20 or later:
33+
34+
```bash
35+
# Check your current version
36+
node --version
37+
38+
# If < 20.0.0, upgrade Node.js
39+
# Via nvm (recommended):
40+
nvm install 20
41+
nvm use 20
42+
43+
# Or download from https://nodejs.org/
44+
```
45+
46+
**2. Update your package.json** to use the latest version:
47+
48+
```bash
49+
npm install @supabase/supabase-js@latest
50+
# Or for individual packages:
51+
npm install @supabase/auth-js@latest
52+
```
53+
54+
**3. No code changes required** - The APIs remain unchanged. Your existing code will work as-is once you upgrade Node.js.
55+
56+
### Supported Environments
57+
58+
**Node.js 20+** - Native fetch support
59+
**Modern browsers** - Chrome 42+, Firefox 39+, Safari 10.1+, Edge 14+
60+
**Deno 1.0+** - Native fetch built-in
61+
**Bun 0.1+** - Native fetch built-in
62+
**React Native** - With fetch polyfill provided by the framework
63+
**Expo** - With fetch polyfill provided by the framework
64+
65+
### Troubleshooting
66+
67+
**Error: `fetch is not defined`**
68+
69+
This means you're running Node.js < 20. Solutions:
70+
71+
1. Upgrade to Node.js 20+ (recommended)
72+
2. If you absolutely cannot upgrade, use an older version of the libraries (see below)
73+
74+
**Using Node.js 18 (Not Recommended)**
75+
76+
If you must use Node.js 18, install the last version that supported it:
77+
78+
```bash
79+
# Find the last version that supported Node.js 18
80+
# (This will be version 2.XX.X where XX is one less than the version with this change)
81+
npm install @supabase/[email protected]
82+
```
83+
84+
⚠️ **Warning:** Using Node.js 18 is not recommended as it no longer receives security updates.
85+
86+
### Discussion
87+
88+
For more details, see the [deprecation announcement](https://github.com/supabase/supabase-js/discussions/37217).
89+
90+
---
91+
792
## 🎯 Who This Guide Is For
893

994
**This guide is for contributors**, including:

package-lock.json

Lines changed: 21 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@
3030
"@nx/vite": "21.6.2",
3131
"@nx/web": "21.6.2",
3232
"@nx/webpack": "21.6.2",
33-
"@supabase/node-fetch": "2.6.15",
3433
"@swc/core": "~1.5.7",
3534
"@swc/helpers": "~0.5.11",
3635
"@types/faker": "^5.1.6",
3736
"@types/jest": "^29.5.14",
3837
"@types/jsonwebtoken": "^8.5.8",
3938
"@types/node": "20.19.9",
40-
"@types/node-fetch": "^2.6.4",
4139
"@typescript-eslint/eslint-plugin": "^7.18.0",
4240
"@typescript-eslint/parser": "^7.18.0",
4341
"@vitest/ui": "^3.0.0",

packages/core/auth-js/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030

3131
</div>
3232

33+
## Requirements
34+
35+
- **Node.js 20 or later** (Node.js 18 support dropped as of October 31, 2025)
36+
- For browser support, all modern browsers are supported
37+
38+
> ⚠️ **Node.js 18 Deprecation Notice**
39+
>
40+
> Node.js 18 reached end-of-life on April 30, 2025. As announced in [our deprecation notice](https://github.com/supabase/supabase-js/discussions/37217), support for Node.js 18 was dropped on October 31, 2025.
41+
3342
## Quick start
3443

3544
Install

packages/core/auth-js/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"directory": "packages/core/auth-js"
2727
},
2828
"scripts": {
29-
"build:node18": "npm run build:main && npm run build:module",
3029
"build": "npm run build:main && npm run build:module",
3130
"build:main": "tsc -p tsconfig.json",
3231
"build:module": "tsc -p tsconfig.module.json",
@@ -38,10 +37,12 @@
3837
"docs:json": "typedoc --json docs/v2/spec.json --excludeExternals --excludePrivate --excludeProtected src/index.ts"
3938
},
4039
"dependencies": {
41-
"@supabase/node-fetch": "2.6.15",
4240
"tslib": "2.8.1"
4341
},
4442
"devDependencies": {
4543
"prettier": "^2.8.8"
44+
},
45+
"engines": {
46+
"node": ">=20.0.0"
4647
}
4748
}

0 commit comments

Comments
 (0)