Skip to content

chore: add local evaluation example and start-local#191

Draft
duyhungtnn wants to merge 3 commits intomasterfrom
chore/update-example-app
Draft

chore: add local evaluation example and start-local#191
duyhungtnn wants to merge 3 commits intomasterfrom
chore/update-example-app

Conversation

@duyhungtnn
Copy link
Copy Markdown
Collaborator

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 Makefile to support it, and enhancing the README.md with clearer instructions.

Example enhancements:

  • Added a new example entry point example/src/index-local-evaluation.ts that demonstrates how to use the SDK with enableLocalEvaluation: true, including a simple Express server and graceful shutdown logic.
  • Updated the Makefile to add a start-local command for running the local evaluation example.

Documentation improvements:

  • Revised the README.md to clearly explain the difference between remote and local evaluation examples, how to configure and run each, and which entry point to use.

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: true with an Express server and graceful shutdown.
  • Updated the example Makefile to add a command for running the local evaluation build output.
  • Updated README.md to 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.

Comment thread README.md
Comment thread example/Makefile
Comment thread example/src/index-local-evaluation.ts Outdated
Comment thread README.md Outdated
Comment thread example/src/index-local-evaluation.ts Outdated
Comment thread example/src/index-local-evaluation.ts Outdated
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants