From 98fbba1343789c7a7d611a0ed0d70c64eca45035 Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Fri, 22 May 2026 17:10:02 +0100 Subject: [PATCH 1/4] docs(npm-scope): update flagsmith-cli and flagsmith-nodejs references Point install snippets, code-help templates, imports, and the npm version fetcher at the new scoped package names @flagsmith/cli and @flagsmith/nodejs. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/docs/integrating-with-flagsmith/CLI.md | 2 +- .../sdks/client-side-sdks/javascript.md | 2 +- .../sdks/server-side.mdx | 22 +++++++++---------- docs/plugins/flagsmith-versions/index.js | 2 +- .../offline_client/offline-client-cli.js | 2 +- .../offline_server/offline-server-cli.js | 3 +-- frontend/common/constants.ts | 2 +- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docs/docs/integrating-with-flagsmith/CLI.md b/docs/docs/integrating-with-flagsmith/CLI.md index 058885876f64..b6fe9de48829 100644 --- a/docs/docs/integrating-with-flagsmith/CLI.md +++ b/docs/docs/integrating-with-flagsmith/CLI.md @@ -14,7 +14,7 @@ workflows. Install globally: ```bash -npm install -g flagsmith-cli +npm install -g @flagsmith/cli ``` ## Sample Usage diff --git a/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/javascript.md b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/javascript.md index e2c2455fef54..01869c596e01 100644 --- a/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/javascript.md +++ b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/javascript.md @@ -107,7 +107,7 @@ You can automatically set default flags for your frontend application as part of The main steps to achieving this are as follows: -1. Install the [CLI](/integrating-with-flagsmith/CLI) `npm i flagsmith-cli --save-dev` +1. Install the [CLI](/integrating-with-flagsmith/CLI) `npm i @flagsmith/cli --save-dev` 2. Call the CLI as part of npm postinstall to create a `flagsmith.json` file each time you run `npm install`. This can be done by either: diff --git a/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx b/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx index d3631be8319c..a350ea7a327b 100644 --- a/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx +++ b/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx @@ -148,7 +148,7 @@ pip install flagsmith ```bash -npm install flagsmith-nodejs +npm install @flagsmith/nodejs ``` @@ -254,7 +254,7 @@ var flagsmithClient = new FlagsmithClient( ```javascript -import { Flagsmith } from 'flagsmith-nodejs'; +import { Flagsmith } from '@flagsmith/nodejs'; const flagsmith = new Flagsmith({ environmentKey: 'FLAGSMITH_SERVER_SIDE_ENVIRONMENT_KEY', @@ -863,11 +863,11 @@ public class MyCustomOfflineHandler: BaseOfflineHandler Use LocalFileHandler +href={`https://www.tsdocs.dev/docs/@flagsmith/nodejs/${NodejsVersion()}/classes/LocalFileHandler.html`}>LocalFileHandler to read an environment file generated by the [Flagsmith CLI](/integrating-with-flagsmith/CLI): ```typescript -import { Flagsmith, LocalFileHandler } from 'flagsmith-nodejs'; +import { Flagsmith, LocalFileHandler } from '@flagsmith/nodejs'; const flagsmith = new Flagsmith({ offlineMode: true, @@ -876,11 +876,11 @@ const flagsmith = new Flagsmith({ ``` To create your own offline handler, implement the `BaseOfflineHandler` interface. It must return an -{/* prettier-ignore */}EnvironmentModel +{/* prettier-ignore */}EnvironmentModel object: ```typescript -import type { BaseOfflineHandler, EnvironmentModel } from 'flagsmith-nodejs'; +import type { BaseOfflineHandler, EnvironmentModel } from '@flagsmith/nodejs'; class CustomOfflineHandler implements BaseOfflineHandler { getEnvironment(): EnvironmentModel { @@ -1350,8 +1350,8 @@ $flagsmith = Flagsmith::Client.new( ```typescript -import { Flagsmith } from 'flagsmith-nodejs'; -import type { EnvironmentModel } from 'flagsmith-nodejs'; +import { Flagsmith } from '@flagsmith/nodejs'; +import type { EnvironmentModel } from '@flagsmith/nodejs'; const flagsmith = new Flagsmith({ /* @@ -1824,14 +1824,14 @@ final FlagsAndTraits flags = cache.getIfPresent(projectLevelCacheKey); The `cache` option in the `Flagsmith` constructor accepts a cache implementation. This cache must implement the -{/* prettier-ignore */}FlagsmithCache +{/* prettier-ignore */}FlagsmithCache interface. For example, this cache implementation uses Redis as a backing store: ```typescript -import { Flagsmith, Flags } from 'flagsmith-nodejs'; -import type { BaseOfflineHandler, EnvironmentModel, FlagsmithCache } from 'flagsmith-nodejs'; +import { Flagsmith, Flags } from '@flagsmith/nodejs'; +import type { BaseOfflineHandler, EnvironmentModel, FlagsmithCache } from '@flagsmith/nodejs'; import * as redis from 'redis'; const redisClient = redis.createClient({ diff --git a/docs/plugins/flagsmith-versions/index.js b/docs/plugins/flagsmith-versions/index.js index fff6a7261f95..ceab490a7d96 100644 --- a/docs/plugins/flagsmith-versions/index.js +++ b/docs/plugins/flagsmith-versions/index.js @@ -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'), - fetchNpmVersions('flagsmith-nodejs'), + fetchNpmVersions('@flagsmith/nodejs'), fetchJavaVersions(), fetchAndroidVersions(), fetchSwiftPMVersions(), diff --git a/frontend/common/code-help/offline_client/offline-client-cli.js b/frontend/common/code-help/offline_client/offline-client-cli.js index ea1ea644cfcb..906e46bbd0f3 100644 --- a/frontend/common/code-help/offline_client/offline-client-cli.js +++ b/frontend/common/code-help/offline_client/offline-client-cli.js @@ -1,5 +1,5 @@ export default (envId) => ` -npm i flagsmith-cli -g +npm i @flagsmith/cli -g export FLAGSMITH_ENVIRONMENT=${envId} flagsmith get ` diff --git a/frontend/common/code-help/offline_server/offline-server-cli.js b/frontend/common/code-help/offline_server/offline-server-cli.js index e7956e2ea395..41eac8efeb4f 100644 --- a/frontend/common/code-help/offline_server/offline-server-cli.js +++ b/frontend/common/code-help/offline_server/offline-server-cli.js @@ -1,6 +1,5 @@ -import _data from 'common/data/base/_data' export default (serversideEnvironmentKey) => ` -npm i flagsmith-cli -g +npm i @flagsmith/cli -g export FLAGSMITH_ENVIRONMENT=${serversideEnvironmentKey} flagsmith get -e document ` diff --git a/frontend/common/constants.ts b/frontend/common/constants.ts index 404eea10c5b3..f59dec4d62d2 100644 --- a/frontend/common/constants.ts +++ b/frontend/common/constants.ts @@ -79,7 +79,7 @@ const keywords = { LIB_NAME: 'flagsmith', LIB_NAME_JAVA: 'FlagsmithClient', NPM_CLIENT: '@flagsmith/flagsmith', - NPM_NODE_CLIENT: 'flagsmith-nodejs', + NPM_NODE_CLIENT: '@flagsmith/nodejs', SEGMENT_NAME: 'superUsers', TRAIT_NAME: 'age', USER_FEATURE_FUNCTION: 'myEvenCoolerFeature', From b021a20de14e4c2198310488f6d3619f0a910b75 Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Fri, 22 May 2026 17:12:21 +0100 Subject: [PATCH 2/4] docs(npm-scope): align flagsmith JS client refs with @flagsmith/flagsmith The flagsmith web SDK already moved to @flagsmith/flagsmith on npm; this catches the last two consumer-facing refs (warehouse code-help snippet and the npm version fetcher). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/plugins/flagsmith-versions/index.js | 2 +- .../tabs/warehouse-tab/WarehouseEventCodeHelp.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/plugins/flagsmith-versions/index.js b/docs/plugins/flagsmith-versions/index.js index ceab490a7d96..14d98b8a669c 100644 --- a/docs/plugins/flagsmith-versions/index.js +++ b/docs/plugins/flagsmith-versions/index.js @@ -87,7 +87,7 @@ export default async function fetchFlagsmithVersions(context, options) { async loadContent() { const [js, nodejs, java, android, swiftpm, cocoapods, dotnet, rust, elixir, flutter] = await Promise.all( [ - fetchNpmVersions('flagsmith'), + fetchNpmVersions('@flagsmith/flagsmith'), fetchNpmVersions('@flagsmith/nodejs'), fetchJavaVersions(), fetchAndroidVersions(), diff --git a/frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseEventCodeHelp.tsx b/frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseEventCodeHelp.tsx index 096eea47f787..a55600fb7128 100644 --- a/frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseEventCodeHelp.tsx +++ b/frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseEventCodeHelp.tsx @@ -41,14 +41,14 @@ System.out.println("Hello, Flagsmith Warehouse!");`, enabled: false, }, 'JavaScript': { - code: `import flagsmith from 'flagsmith'; + code: `import flagsmith from '@flagsmith/flagsmith'; flagsmith.init({ environmentID: 'YOUR_ENVIRONMENT_KEY' }); console.log('Hello, Flagsmith Warehouse!');`, enabled: true, }, 'Node JS': { - code: `import Flagsmith from 'flagsmith-nodejs'; + code: `import Flagsmith from '@flagsmith/nodejs'; const flagsmith = new Flagsmith({ environmentKey: 'YOUR_ENVIRONMENT_KEY' }); console.log('Hello, Flagsmith Warehouse!');`, From f47251715bb9a163bb27b1aa4edeab956a2fde34 Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Fri, 22 May 2026 17:13:34 +0100 Subject: [PATCH 3/4] docs(npm-scope): keep flagsmith-nodejs in version fetcher until publish @flagsmith/nodejs is not on npm yet (the SDK PR has not merged), so the version fetcher 404s and breaks the Vercel build. Revert just that line back to the unscoped name for now; flip it after the SDK publishes. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/plugins/flagsmith-versions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/flagsmith-versions/index.js b/docs/plugins/flagsmith-versions/index.js index 14d98b8a669c..ab3c78d82589 100644 --- a/docs/plugins/flagsmith-versions/index.js +++ b/docs/plugins/flagsmith-versions/index.js @@ -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(), From a154be008860b980f289afcd3070deeb831950b0 Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Fri, 22 May 2026 17:16:54 +0100 Subject: [PATCH 4/4] docs(npm-scope): update JS SDK version pin and CDN URLs @flagsmith/flagsmith starts at 11.0.0 so the JsVersion ~9 default no longer resolves and the Docusaurus SSG step errors out. Bump the default spec to ^12 and switch the jsdelivr URLs in quick-start to the scoped package path. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/docs/getting-started/quick-start.md | 4 ++-- docs/src/components/SdkVersions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/getting-started/quick-start.md b/docs/docs/getting-started/quick-start.md index bd7cfa2c6e47..c10d96b1e2b6 100644 --- a/docs/docs/getting-started/quick-start.md +++ b/docs/docs/getting-started/quick-start.md @@ -72,7 +72,7 @@ The page looks like this: For the purposes of this quickstart tutorial, we will import the SDK inline into our web page: -{ `` } +{ `` } ## 3. Connect to the Flagsmith API @@ -127,7 +127,7 @@ Our entire web page now reads like this: Flagsmith Quickstart Guide - +