Skip to content

fix: align README with env-var setup and restore missing client-side ID guard - #19

Merged
kinyoklion merged 2 commits into
mainfrom
devin/1786957430-readme-env-vars
Sep 15, 2026
Merged

kinyoklion merged 2 commits into
mainfrom
devin/1786957430-readme-env-vars

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes a stale README and a dead client-side-ID guard in this example, and makes the SDK constraint float within its current major instead of across majors.

  • README told users to edit index.js variables (environmentId) that do not exist; it now documents LAUNCHDARKLY_CLIENT_SIDE_ID / LAUNCHDARKLY_FLAG_KEY and the output the app actually prints, matching hello-node-server.
  • The "please set your client-side ID" guard was unreachable, since the default was the truthy placeholder 'your-client-side-id'; without the env var the example failed with an opaque SDK error instead.
-const clientSideId = process.env.LAUNCHDARKLY_CLIENT_SIDE_ID ?? 'your-client-side-id';
+const clientSideId = process.env.LAUNCHDARKLY_CLIENT_SIDE_ID ?? '';
 ...
 if (!clientSideId) { /* now reachable */ }
  • launchdarkly-node-client-sdk constraint now floats within major 3 rather than across all future majors, so patch/minor releases need no PR while a 4.x release still requires a deliberate change:
-    "launchdarkly-node-client-sdk": ">= 3.4.0"
+    "launchdarkly-node-client-sdk": "^3.4.0"
  • Floor stays at 3.4.0 and there is no committed lock file (package-lock.json is gitignored), so npm install still resolves to the latest 3.x (currently 3.4.3). No SDK version bump was needed and no deprecated SDK APIs are used.
  • Titled fix: because it touches shipped example code.
Implementation details

GitHub Actions pins in .github/workflows are deliberately left alone (SHA/major pins for supply-chain reasons), and the README documents no version requirement, so it was not touched for the constraint change. launchdarkly-node-client-sdk is the repo's only dependency.

Verification on the branch:

$ npm install                                   # found 0 vulnerabilities
$ npm ls launchdarkly-node-client-sdk
hello-node-client@1.0.0
└── launchdarkly-node-client-sdk@3.4.3          # ^3.4.0 resolves to latest 3.x

$ LAUNCHDARKLY_CLIENT_SIDE_ID=<hello-apps client-side id> \
  LAUNCHDARKLY_FLAG_KEY=hello-boolean CI=1 node index.js
*** SDK successfully initialized!
*** The 'hello-boolean' feature flag evaluates to true.
(exit 0)

$ node index.js                                 # no env vars
*** Please set LAUNCHDARKLY_CLIENT_SIDE_ID to your client-side ID, or edit index.js to use your client-side ID.
(exit 1)

Re-running the success case under node --trace-deprecation --pending-deprecation produced no deprecation warnings. Node console app, so no screenshots.

Link to Devin session: https://app.devin.ai/sessions/122470ac980d492a860e21c8062ac5c7
Open in Devin Desktop: https://app.devin.ai/desktop/session/122470ac980d492a860e21c8062ac5c7?variant=devin

…ID guard

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

@kinyoklion
kinyoklion marked this pull request as ready for review September 15, 2026 16:39
@kinyoklion
kinyoklion requested a review from a team as a code owner September 15, 2026 16:39
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

@kinyoklion
kinyoklion merged commit 214a437 into main Sep 15, 2026
4 checks passed
@kinyoklion
kinyoklion deleted the devin/1786957430-readme-env-vars branch September 15, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants