chore: add local evaluation example and start-local#191
Draft
duyhungtnn wants to merge 3 commits intomasterfrom
Draft
chore: add local evaluation example and start-local#191duyhungtnn wants to merge 3 commits intomasterfrom
duyhungtnn wants to merge 3 commits intomasterfrom
Conversation
Add a local evaluation example and Makefile target. Update README to document two example entry points (remote and local) and clarify how to configure the example source file. Add example/src/index-local-evaluation.ts demonstrating enableLocalEvaluation: true, a simple Express server, evaluation/track endpoints, and graceful shutdown. Add Makefile start-local target to run the local example.
Replace the incorrect example command in README: changed `make start-local` to `make start-local-evaluation` in the local evaluation instructions so the docs match the Makefile target.
There was a problem hiding this comment.
Pull request overview
This PR improves the developer experience for running the Node server SDK examples by adding a dedicated “local evaluation” entry point and updating documentation and tooling to support it.
Changes:
- Added a new example entry point demonstrating
enableLocalEvaluation: truewith an Express server and graceful shutdown. - Updated the example
Makefileto add a command for running the local evaluation build output. - Updated
README.mdto explain remote vs local evaluation examples and how to run each.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| README.md | Documents the two example entry points and how to run them (remote vs local evaluation). |
| example/src/index-local-evaluation.ts | New local-evaluation example server showing initialization, evaluation, tracking, and shutdown flow. |
| example/Makefile | Adds a make target intended to run the compiled local-evaluation entry point. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix several small issues in examples and docs: - README: reword to "evaluate users locally within the SDK". - example/Makefile: rename target start-local -> start-local-evaluation. - example/src/index.ts and index-local-evaluation.ts: correct misspelled function name (butotnClick -> buttonClick), update event listener, change fetch URL from 'http://localhost:3000' to '/', and fix spelling of "troubleshooting". These changes fix a runtime error in the example button handler and clarify the Makefile target and documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new example for local feature flag evaluation and improves the documentation and developer experience for running examples. The main changes include introducing a local evaluation example entry point, updating the
Makefileto support it, and enhancing theREADME.mdwith clearer instructions.Example enhancements:
example/src/index-local-evaluation.tsthat demonstrates how to use the SDK withenableLocalEvaluation: true, including a simple Express server and graceful shutdown logic.Makefileto add astart-localcommand for running the local evaluation example.Documentation improvements:
README.mdto clearly explain the difference between remote and local evaluation examples, how to configure and run each, and which entry point to use.