Skip to content

Move feature flags to middleware from the client#20

Merged
CahidArda merged 5 commits into
mainfrom
feat/19-ff-to-backend
Feb 27, 2026
Merged

Move feature flags to middleware from the client#20
CahidArda merged 5 commits into
mainfrom
feat/19-ff-to-backend

Conversation

@CahidArda

Copy link
Copy Markdown
Collaborator

Fixes #19

Upstash Box and others added 5 commits February 27, 2026 09:12
Feature flags are no longer passed from the client during createSession.
Instead, middleware on the backend can return featureFlags in its result,
which are merged across middleware chain and forwarded to session creation.
This gives the backend full control over flag assignment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- API route now uses middleware to assign feature flags via weighted
  random distributions on createSession requests
- Removed client-side featureFlags config from createAnalyticsHook
- Updated home page to remove manual flag override buttons; added
  "New Session" button that re-rolls flags via backend
- Updated docs to reflect middleware-based flag assignment, including
  new sections for feature flags via middleware and multiple middlewares
- Updated README with middleware-based examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CahidArda
CahidArda merged commit 5d579c8 into main Feb 27, 2026
1 check passed
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.

Add a way to set feature flags in the backend

1 participant