Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/docs/integrating-with-flagsmith/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workflows.
Install globally:

```bash
npm install -g flagsmith-cli
npm install -g @flagsmith/cli
```

## Sample Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
22 changes: 11 additions & 11 deletions docs/docs/integrating-with-flagsmith/sdks/server-side.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pip install flagsmith
<TabItem value="nodejs" label="Node.js">

```bash
npm install flagsmith-nodejs
npm install @flagsmith/nodejs
```

</TabItem>
Expand Down Expand Up @@ -254,7 +254,7 @@ var flagsmithClient = new FlagsmithClient(
<TabItem value="nodejs" label="Node.js">

```javascript
import { Flagsmith } from 'flagsmith-nodejs';
import { Flagsmith } from '@flagsmith/nodejs';

const flagsmith = new Flagsmith({
environmentKey: 'FLAGSMITH_SERVER_SIDE_ENVIRONMENT_KEY',
Expand Down Expand Up @@ -863,11 +863,11 @@ public class MyCustomOfflineHandler: BaseOfflineHandler
<TabItem value="nodejs" label="Node.js">

Use <a
href={`https://www.tsdocs.dev/docs/flagsmith-nodejs/${NodejsVersion()}/classes/LocalFileHandler.html`}>LocalFileHandler</a>
href={`https://www.tsdocs.dev/docs/@flagsmith/nodejs/${NodejsVersion()}/classes/LocalFileHandler.html`}>LocalFileHandler</a>
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,
Expand All @@ -876,11 +876,11 @@ const flagsmith = new Flagsmith({
```

To create your own offline handler, implement the `BaseOfflineHandler` interface. It must return an
{/* prettier-ignore */}<a target="_blank" href={`https://www.tsdocs.dev/docs/flagsmith-nodejs/${NodejsVersion()}/classes/EnvironmentModel.html`}>EnvironmentModel</a>
{/* prettier-ignore */}<a target="_blank" href={`https://www.tsdocs.dev/docs/@flagsmith/nodejs/${NodejsVersion()}/classes/EnvironmentModel.html`}>EnvironmentModel</a>
object:

```typescript
import type { BaseOfflineHandler, EnvironmentModel } from 'flagsmith-nodejs';
import type { BaseOfflineHandler, EnvironmentModel } from '@flagsmith/nodejs';

class CustomOfflineHandler implements BaseOfflineHandler {
getEnvironment(): EnvironmentModel {
Expand Down Expand Up @@ -1350,8 +1350,8 @@ $flagsmith = Flagsmith::Client.new(
<TabItem value="nodejs" label="Node.js">

```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({
/*
Expand Down Expand Up @@ -1824,14 +1824,14 @@ final FlagsAndTraits flags = cache.getIfPresent(projectLevelCacheKey);
<TabItem value="nodejs" label="Node.js">

The `cache` option in the `Flagsmith` constructor accepts a cache implementation. This cache must implement the
{/* prettier-ignore */}<a href={`https://www.tsdocs.dev/docs/flagsmith-nodejs/${NodejsVersion()}/interfaces/FlagsmithCache.html`}>FlagsmithCache</a>
{/* prettier-ignore */}<a href={`https://www.tsdocs.dev/docs/@flagsmith/nodejs/${NodejsVersion()}/interfaces/FlagsmithCache.html`}>FlagsmithCache</a>
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({
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'),
fetchNpmVersions('flagsmith-nodejs'),
fetchNpmVersions('@flagsmith/nodejs'),
fetchJavaVersions(),
fetchAndroidVersions(),
fetchSwiftPMVersions(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default (envId) => `
npm i flagsmith-cli -g
npm i @flagsmith/cli -g
export FLAGSMITH_ENVIRONMENT=${envId}
flagsmith get
`
Original file line number Diff line number Diff line change
@@ -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
`
2 changes: 1 addition & 1 deletion frontend/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading