Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/docs/integrating-with-flagsmith/sdks/server-side.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ pip install flagsmith
npm install @flagsmith/nodejs
```

:::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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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 || true

Repository: 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:


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.

Suggested change
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.


:::

</TabItem>
<TabItem value="ruby" label="Ruby">

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/flagsmith-versions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default async function fetchFlagsmithVersions(context, options) {
const [js, nodejs, java, android, swiftpm, cocoapods, dotnet, rust, elixir, flutter] = await Promise.all(
[
fetchNpmVersions('@flagsmith/flagsmith'),
fetchNpmVersions('flagsmith-nodejs'),
fetchNpmVersions('@flagsmith/nodejs'),
fetchJavaVersions(),
fetchAndroidVersions(),
fetchSwiftPMVersions(),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/SdkVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export const DotnetVersion = ({ spec = '~8' }) => Version({ sdk: 'dotnet', spec
export const ElixirVersion = ({ spec = '~2' }) => Version({ sdk: 'elixir', spec });
export const RustVersion = ({ spec = '~2' }) => Version({ sdk: 'rust', spec });
export const JsVersion = ({ spec = '^12' }) => Version({ sdk: 'js', spec });
export const NodejsVersion = ({ spec } = { spec: '~6' }) => Version({ sdk: 'nodejs', spec });
export const NodejsVersion = ({ spec = '^9' } = {}) => Version({ sdk: 'nodejs', spec });
export const FlutterVersion = ({ spec = '~6' }) => Version({ sdk: 'flutter', spec });
Loading