Skip to content

chore(js): make [email protected] the minimum supported version#535

Merged
rhamzeh merged 3 commits into
mainfrom
chore/js-drop-node-16-18
Feb 11, 2026
Merged

chore(js): make [email protected] the minimum supported version#535
rhamzeh merged 3 commits into
mainfrom
chore/js-drop-node-16-18

Conversation

@rhamzeh

@rhamzeh rhamzeh commented Feb 11, 2026

Copy link
Copy Markdown
Member

Description

Drop support for Node.js v16 & 18. We recommend updating to a node-runtime that is supported upstream - currently 20 (maintenance), 22 (maintenance), 24 (LTS) and 25 (current).

The minimum supported version of Node.js is now v20

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added comprehensive Node.js version support documentation with current status for each version.
    • Updated changelog noting Node.js v16 and v18 are no longer supported; minimum required version is v20.
  • Chores

    • Expanded CI test matrix to include Node.js v25.x.
    • Updated package.json to enforce Node.js v20.19.0 or higher as the minimum requirement.
    • Enhanced release workflow with automated tag validation and improved npm distribution tagging.

Copilot AI review requested due to automatic review settings February 11, 2026 14:36
@rhamzeh
rhamzeh requested review from a team as code owners February 11, 2026 14:36
@dosubot

dosubot Bot commented Feb 11, 2026

Copy link
Copy Markdown

Documentation Updates

1 document(s) were updated by changes in this PR:

Retry-After Header and Retry Strategy
View Changes
@@ -1,11 +1,9 @@
 ## Retry Strategy Enhancements
-
 OpenFGA SDKs implement a robust, configurable retry strategy to improve reliability and handle rate limiting and transient server errors. The enhancements include support for the RFC 9110 `Retry-After` header, exponential backoff with jitter as a fallback, strict enforcement of retry limits, and improved error reporting. This documentation details the retry strategy across the JavaScript, Java, Go, Python, and .NET SDKs, including configuration options and migration guidance for breaking changes.
 
 ---
 
 ### Common Principles
-
 All OpenFGA SDKs now:
 
 - Parse and respect the RFC 9110 `Retry-After` header (integer seconds or HTTP-date) for 429 and 5xx (except 501) responses, using the server-specified delay if valid (1–1800 seconds).
@@ -18,22 +16,25 @@
 ---
 
 ## SDK-Specific Details
-
 ### JavaScript SDK (`@openfga/sdk`)
 
 **Version Introduced:** v0.9.1 (2025-11-05)  
 **[Changelog](https://github.com/openfga/js-sdk/blob/ca4b9fcf9eaed35170d44a4b3697f439b81187f6/CHANGELOG.md#L8-L10)**
 
-#### Retry-After Handling
-
+# SDK-Specific Details
+#### Node.js Version Support (JavaScript SDK)
+
+The minimum supported Node.js version for the JavaScript SDK is **v20.19.0**. Node.js v16 and v18 are no longer supported. For a detailed support policy and a list of tested Node.js versions, see [SUPPORTED_RUNTIMES.md](https://github.com/openfga/language/blob/main/pkg/js/SUPPORTED_RUNTIMES.md).
+
+We recommend using a Node.js version that is currently supported upstream (see [Node.js release schedule](https://nodejs.org/en/about/previous-releases)), such as 20 (maintenance), 22 (maintenance), 24 (LTS), or 25 (current).
+
+#### Retry-After Handling
 The SDK parses the `Retry-After` header as either an integer (seconds) or HTTP-date. If the value is between 1 second and 30 minutes (1800 seconds), it waits for the specified delay before retrying. If the header is missing, invalid, or out of bounds, the SDK falls back to exponential backoff with jitter.
 
 #### Exponential Backoff with Jitter
-
 The delay is randomized between `2^retryAttempt * minWaitInMs` and `2^(retryAttempt+1) * minWaitInMs`, capped at 120 seconds. For example, with the default `minWaitInMs` of 100ms, the sequence is approximately 100ms, 200ms, 400ms, 800ms, 1.6s, 3.2s, 6.4s, 12.8s, 25.6s, 51.2s, 102.4s, and then capped at 120s for subsequent retries.
 
 #### Configuration
-
 Set retry parameters via the `retryParams` option when initializing the client:
 
 ```js
@@ -48,35 +49,28 @@
 [See README for details](https://github.com/openfga/js-sdk/blob/ca4b9fcf9eaed35170d44a4b3697f439b81187f6/README.md#L857-L875)
 
 #### Error Exposure
-
 When retries are exhausted or not applicable, errors are thrown as specific classes: `FgaApiRateLimitExceededError` for 429, `FgaApiInternalError` for 5xx, and `FgaApiError` for other cases. These errors do not directly expose the `Retry-After` value, but the retry logic respects it internally.
 
 #### Migration Guidance
-
 - Upgrade to v0.9.1+ to use `Retry-After` support.
 - If you previously relied on custom retry logic, review the new defaults and configuration.
-- The minimum Node.js version is now v16.15.0.
+- The minimum supported Node.js version is now **v20.19.0**. Update your runtime accordingly.
 - The maximum allowed `maxRetry` is now enforced at 15.
 - No retries are performed for 501 errors, even if a `Retry-After` header is present.
 - If you used the old `batchCheck` method, migrate to `clientBatchCheck` as per the [changelog](https://github.com/openfga/js-sdk/blob/ca4b9fcf9eaed35170d44a4b3697f439b81187f6/CHANGELOG.md#L8-L44).
-
----
+- For details on supported Node.js versions and our support policy, see [SUPPORTED_RUNTIMES.md](https://github.com/openfga/language/blob/main/pkg/js/SUPPORTED_RUNTIMES.md).
 
 ### Java SDK
-
 **Version Introduced:** v0.9.0  
 **[Changelog](https://github.com/openfga/java-sdk/blob/33a85203ec0af0935b0fa265a469a1851870fff7/CHANGELOG.md#L40-L52)**
 
 #### Retry-After Handling
-
 The SDK parses the `Retry-After` header as either an integer (seconds) or HTTP-date. If the value is between 1 and 1800 seconds, it is used as the retry delay. Otherwise, the SDK falls back to exponential backoff with jitter.
 
 #### Exponential Backoff with Jitter
-
 The delay is calculated as `2^retryCount * minimumRetryDelay` (default 100ms), with jitter randomized between this value and twice this value, capped at 120 seconds.
 
 #### Configuration
-
 Configure retries via `ClientConfiguration`:
 
 ```java
@@ -88,11 +82,9 @@
 [See README for details](https://github.com/openfga/java-sdk/blob/33a85203ec0af0935b0fa265a469a1851870fff7/README.md#L1103-L1168)
 
 #### Error Exposure
-
 The `FgaError` exception exposes the `Retry-After` header value via `getRetryAfterHeader()`, allowing users to inspect the server-specified delay for debugging or custom logic.
 
 #### Migration Guidance
-
 - The maximum allowed `maxRetries` is now enforced at 15.
 - `minimumRetryDelay` must be non-null and non-negative.
 - Update error handling to use `getRetryAfterHeader()` if you need access to the `Retry-After` value.
@@ -101,20 +93,16 @@
 ---
 
 ### Go SDK
-
 **Version Introduced:** v0.7.0  
 **[Changelog](https://github.com/openfga/go-sdk/blob/c52ca06c03934b954d50ca34845b73076b6fa9eb/CHANGELOG.md#L36-L51)**
 
 #### Retry-After Handling
-
 The SDK parses the `Retry-After` header (and related headers) as either integer seconds or HTTP-date. If the value is between 1 and 1800 seconds, it is used as the retry delay. Otherwise, the SDK falls back to exponential backoff with jitter.
 
 #### Exponential Backoff with Jitter
-
 The delay is randomized between `2^loopCount * minWaitInMs` and `2^(loopCount+1) * minWaitInMs`, capped at 120 seconds.
 
 #### Configuration
-
 Set retry parameters via the `RetryParams` struct in `ClientConfiguration`:
 
 ```go
@@ -129,11 +117,9 @@
 [See README for details](https://github.com/openfga/go-sdk/blob/c52ca06c03934b954d50ca34845b73076b6fa9eb/README.md#L1099-L1127)
 
 #### Error Exposure
-
 Error types such as `FgaApiInternalError` and `FgaApiRateLimitExceededError` expose retry delay information via `RetryAfterDurationInMs()` and `RetryAfterEpoc()` methods.
 
 #### Migration Guidance
-
 - Upgrade to v0.7.0+ for improved retry and rate limit handling.
 - The maximum allowed `MaxRetry` is now enforced at 15.
 - The `BatchCheck` method was renamed to `ClientBatchCheck` (not directly related to retry logic).
@@ -141,20 +127,16 @@
 ---
 
 ### Python SDK
-
 **Version Introduced:** v0.9.4 (2025-04-30)  
 **[Changelog](https://github.com/openfga/python-sdk/pull/189)**
 
 #### Retry-After Handling
-
 The SDK parses the `Retry-After` header as either integer seconds or HTTP-date. If the value is between 1 and 1800 seconds, it is used as the retry delay. Otherwise, the SDK falls back to exponential backoff with jitter, capped at a maximum wait time (default 120 seconds).
 
 #### Exponential Backoff with Jitter
-
 The delay is randomized between `2^retryAttempt * min_wait_in_ms` and `2^(retryAttempt+1) * min_wait_in_ms`, converted to seconds, and capped at `max_wait_in_sec` (default 120s).
 
 #### Configuration
-
 Set retry parameters via the `RetryParams` class in the client configuration:
 
 ```python
@@ -168,11 +150,9 @@
 ```
 
 #### Error Exposure
-
 If the `Retry-After` header is invalid or missing, a `ValueError` is raised and the SDK falls back to exponential backoff. Retry-related errors are surfaced through exceptions.
 
 #### Migration Guidance
-
 - The default `max_retry` is now 3 (was previously 15).
 - Ensure any custom retry logic or error handling is updated to use the new configuration and error exposure patterns.
 - Upgrade to v0.9.4+ for full `Retry-After` support.
@@ -180,20 +160,16 @@
 ---
 
 ### .NET SDK
-
 **Version Introduced:** v0.8.0 (2025-10-22)  
 **[Changelog](https://github.com/openfga/dotnet-sdk/pull/142)**
 
 #### Retry-After Handling
-
 The SDK parses the `Retry-After` header as either integer seconds or HTTP-date. If the value is between 1 and 1800 seconds, it is used as the retry delay. Otherwise, the SDK falls back to exponential backoff with jitter.
 
 #### Exponential Backoff with Jitter
-
 The delay is randomized between `2^loopCount * 500ms` and `2^(loopCount+1) * 500ms`, capped at 120 seconds.
 
 #### Configuration
-
 Set retry parameters via the `RetryParams` object in `ClientConfiguration`:
 
 ```csharp
@@ -210,11 +186,9 @@
 ```
 
 #### Error Exposure
-
 When retries are exhausted, `FgaApiRateLimitExceededError` exposes the parsed `RetryAfter` delay in seconds, the raw header value, and the number of retry attempts made.
 
 #### Migration Guidance
-
 - All `OpenFgaApi` methods now accept an optional `IRequestOptions` parameter. Update direct API calls accordingly.
 - The base client request options interface was renamed from `ClientRequestOptions` to `IClientRequestOptions`. Update any references or implementations.
 - The maximum allowed `MaxRetry` is now enforced at 15.
@@ -223,7 +197,6 @@
 ---
 
 ## Comparison Table
-
 | SDK         | Retry-After Support | Exponential Backoff (Default) | Max Retries (Default/Max) | Min Retry Delay (Default) | Error Exposure | Version Introduced |
 |-------------|--------------------|-------------------------------|---------------------------|--------------------------|---------------|-------------------|
 | JavaScript  | Yes (int/date, 1–1800s) | 2^n * minWaitInMs, jitter, cap 120s | 3 / 15                   | 100ms                   | Error classes  | v0.9.1            |
@@ -235,7 +208,6 @@
 ---
 
 ## References
-
 - [JavaScript SDK Changelog](https://github.com/openfga/js-sdk/blob/ca4b9fcf9eaed35170d44a4b3697f439b81187f6/CHANGELOG.md#L8-L44)
 - [Java SDK Changelog](https://github.com/openfga/java-sdk/blob/33a85203ec0af0935b0fa265a469a1851870fff7/CHANGELOG.md#L40-L52)
 - [Go SDK Changelog](https://github.com/openfga/go-sdk/blob/c52ca06c03934b954d50ca34845b73076b6fa9eb/CHANGELOG.md#L36-L51)

How did I do? Any feedback?  Join Discord

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Updates Node.js support requirements from v16/v18 to minimum v20.19.0, expands CI test matrix to include Node 25.x, introduces git tag validation and improved npm publishing workflow, and documents the updated support policy in new and existing documentation files.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/pkg-js-build.yaml, .github/workflows/pkg-js-release.yaml
Expands Node.js test matrix to v20.x, 22.x, 24.x, 25.x. Removes always-auth flag. Introduces TARGET_NODE_VERSION environment variable. Adds tag validation step to extract and validate vX.Y.Z format (with optional -alpha/-beta/-rc suffixes) and determine npm dist-tag. Changes publishing to use npx [email protected] with determined dist-tag instead of direct npm publish.
Documentation & Changelog
pkg/js/README.md, pkg/js/CHANGELOG.md, pkg/js/SUPPORTED_RUNTIMES.md
Adds "Supported Node.js Versions" section to README. Documents Node v16/v18 EOL in CHANGELOG. Introduces new SUPPORTED_RUNTIMES.md file detailing Node.js support policy, upstream release adoption, support table with CI/test status, and future runtime plans.
Package Configuration
pkg/js/package.json
Adds engines field specifying Node.js >= 20.19.0 as minimum required version.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as GitHub Actions Workflow
    participant Validation as Tag Validation Step
    participant NPM as NPM Registry
    
    Workflow->>Validation: Extract git tag from ref
    Validation->>Validation: Validate format (vX.Y.Z with optional pre-release)
    alt Valid Tag Format
        Validation->>Validation: Determine dist-tag (alpha/beta/rc/latest)
        Validation-->>Workflow: Output determined tag
        Workflow->>NPM: Publish via npx [email protected]<br/>with determined dist-tag
        NPM-->>Workflow: Publish successful
    else Invalid Tag Format
        Validation-->>Workflow: Exit with error and guidance
    end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • release(js): v0.2.0 #466: Modifies JavaScript GitHub Actions workflows to update supported Node.js versions and CI setup, with direct alignment to these changes.

Suggested Reviewers

  • jimmyjames
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main objective: setting Node.js 20.19.0 as the minimum supported version, which aligns with the primary changes across the codebase (package.json engines field, workflow updates, and documentation).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/js-drop-node-16-18

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR drops Node.js 16/18 support for the JS package and updates package metadata and CI/release automation to reflect a Node.js v20+ baseline.

Changes:

  • Add engines.node constraint to pkg/js/package.json.
  • Document supported Node.js runtimes and link that policy from the JS package README/changelog.
  • Update GitHub Actions workflows to test against Node 25 and adjust the npm publish flow.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/js/package.json Enforces a minimum Node version via engines.
pkg/js/SUPPORTED_RUNTIMES.md Adds a Node.js support policy document.
pkg/js/README.md Links to the support policy from the package README.
pkg/js/CHANGELOG.md Notes the breaking change / Node support drop in Unreleased.
.github/workflows/pkg-js-release.yaml Refactors Node setup and adds tag→npm-dist-tag logic for publishing.
.github/workflows/pkg-js-build.yaml Expands the test matrix to include Node 25 and minor config cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pkg-js-release.yaml
Comment thread .github/workflows/pkg-js-release.yaml
Comment thread .github/workflows/pkg-js-release.yaml
Comment thread pkg/js/SUPPORTED_RUNTIMES.md
Comment thread pkg/js/README.md
Comment thread pkg/js/package.json
Comment thread .github/workflows/pkg-js-release.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/pkg-js-release.yaml (1)

93-96: ⚠️ Potential issue | 🟡 Minor

Note: rc pre-releases won't be marked as prerelease GitHub releases.

The prerelease_regex on line 96 only matches alpha|beta suffixes. Tags like v1.2.3-rc.1 will be treated as full releases by the GitHub release action. If this is intentional (rc ≈ near-stable), no action needed — just flagging for awareness.

🤖 Fix all issues with AI agents
In @.github/workflows/pkg-js-release.yaml:
- Around line 51-77: The TAG extracted in the npm-tag step (variable TAG from
GITHUB_REF) can contain a leading path like "pkg/js/" so the current regex ^v...
will always fail; update the npm-tag step to strip any prefix path (e.g., remove
"pkg/js/" or anything before the last slash) from TAG after removing refs/tags/
and before running the regex/validation and npm-tag determination, ensuring the
regex is applied to the bare version string (refer to the npm-tag step and the
TAG/GITHUB_REF handling and the version regex).

In `@pkg/js/SUPPORTED_RUNTIMES.md`:
- Around line 3-12: The policy header in SUPPORTED_RUNTIMES.md says we support
Node.js versions in "LTS or Maintenance" but the table includes Node.js 25 as
"Current"; update the policy statement to accurately reflect what's listed in
the table (e.g., change the header sentence to "We support Node.js versions that
are currently in LTS, Maintenance, or Current status" or add a note that
"Current" is supported on a best-effort basis) so the description and the table
(specifically the entry for Node 25) are consistent.

Comment thread .github/workflows/pkg-js-release.yaml
Comment thread pkg/js/SUPPORTED_RUNTIMES.md
@rhamzeh
rhamzeh added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 55e4d5a Feb 11, 2026
15 checks passed
@rhamzeh
rhamzeh deleted the chore/js-drop-node-16-18 branch February 11, 2026 15:57
@coderabbitai coderabbitai Bot mentioned this pull request Feb 11, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants