docs: point Node.js SDK versions and migration note to @flagsmith/nodejs - #8490
docs: point Node.js SDK versions and migration note to @flagsmith/nodejs#8490Zaimwa9 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe documentation identifies Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: 🔵 Low · up to The documentation correctly directs users to the renamed Node.js package, but existing integrations may still need the precise import replacement to complete migration safely. This is a bounded documentation risk. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 43c8dd2b-fc1c-4193-8628-6a14c91469b0
📒 Files selected for processing (2)
docs/docs/integrating-with-flagsmith/sdks/server-side.mdxdocs/plugins/flagsmith-versions/index.js
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
| :::warning | ||
|
|
||
| The Node.js SDK moved from `flagsmith-nodejs` to `@flagsmith/nodejs` in version 9.0.0. The `flagsmith-nodejs` package is | ||
| deprecated and no longer receives updates. Replace it in your `package.json` and update your imports. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge Flagsmith/flagsmith /tmp/coderabbit-repo-knowledge/flagsmith-flagsmith-a74d157a/architecture /tmp/coderabbit-repo-knowledge/flagsmith-flagsmith-a74d157a/learnings /tmp/coderabbit-repo-knowledge/flagsmith-flagsmith-a74d157a/conventions
Length of output: 46649
🏁 Script executed:
#!/bin/bash
set -e
file='docs/docs/integrating-with-flagsmith/sdks/server-side.mdx'
sed -n '140,170p' "$file"
printf '\nRelevant package/import references:\n'
rg -n -C 2 'flagsmith-nodejs|`@flagsmith/nodejs`' docs package.json yarn.lock package-lock.json pnpm-lock.yaml 2>/dev/null || trueRepository: Flagsmith/flagsmith
Length of output: 7507
🌐 Web query:
@flagsmith/nodejs version 9.0.0 official documentation CommonJS require import module format
💡 Result:
In @flagsmith/nodejs version 9.0.0 and later, the SDK is provided as an ESM-only package [1][2]. As of version 4.0.0, the package transitioned away from CommonJS (CJS) as the primary format and introduced named exports [2][3]. Because version 9.0.0 is an ESM-only release, it does not support the traditional CommonJS require syntax [1]. You must use the import statement in an ESM context (e.g., using "type": "module" in your package.json or utilizing .mjs file extensions) [1]. To use the Flagsmith client in version 9.0.0, use the following ESM named import: import { Flagsmith } from '@flagsmith/nodejs'; The official documentation for the Flagsmith Node.js SDK can be found at https://docs.flagsmith.com/clients/server-side [4][5][6].
Citations:
- 1: GitHub pull request 163 in Flagsmith/flagsmith-nodejs-client (link omitted to avoid creating a cross-reference)
- 2: https://github.com/Flagsmith/flagsmith-nodejs-client/blob/refs/heads/main/CHANGELOG.md
- 3: https://github.com/Flagsmith/flagsmith-nodejs-client/releases/tag/v4.0.0
- 4: https://www.npmjs.com/package/flagsmith-nodejs
- 5: https://github.com/Flagsmith/flagsmith-nodejs-client
- 6: https://github.com/Flagsmith/flagsmith-nodejs-client/blob/refs/heads/main/README.md
State the package replacement and ESM requirement.
The warning must state that users must replace flagsmith-nodejs with @flagsmith/nodejs. Version 9.0.0 and later are ESM-only, so CommonJS require calls must be replaced with ESM import statements.
Suggested wording
-The `flagsmith-nodejs` package is deprecated and no longer receives updates. Replace it in your `package.json` and update your imports.
+The `flagsmith-nodejs` package is deprecated and no longer receives updates. Replace `flagsmith-nodejs` with `@flagsmith/nodejs` in your `package.json`. Version 9.0.0 and later are ESM-only, so replace CommonJS `require` calls with ESM `import` statements.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| deprecated and no longer receives updates. Replace it in your `package.json` and update your imports. | |
| The `flagsmith-nodejs` package is deprecated and no longer receives updates. Replace `flagsmith-nodejs` with `@flagsmith/nodejs` in your `package.json`. Version 9.0.0 and later are ESM-only, so replace CommonJS `require` calls with ESM `import` statements. |
Summary
The Node.js SDK moved to
@flagsmith/nodejsat 9.0.0, but the docs still resolved versions from the oldflagsmith-nodejspackage, soNodejsVersion()and every tsdocs link on the server-side page pointed at 8.1.2.@flagsmith/nodejsin theflagsmith-versionsplugin.flagsmith-nodejs.Context
flagsmith-nodejscurrently carries no npm deprecation notice (unlikeflagsmith→@flagsmith/flagsmith), and it still gets ~25x the weekly downloads of@flagsmith/nodejs. Every publishedflagsmith-nodejsversion sends an unusable user agent, so that install base is invisible in SDK usage analytics. This PR should land alongside an npm owner running: