Skip to content

feat(auth0-react): expose Experiment Center override params on AuthorizationParameters - #1253

Open
siddhikotak wants to merge 3 commits into
mainfrom
feat/exp-center-typed-params
Open

siddhikotak wants to merge 3 commits into
mainfrom
feat/exp-center-typed-params

Conversation

@siddhikotak

@siddhikotak siddhikotak commented Sep 23, 2026

Copy link
Copy Markdown

Summary

Adds support for forcing an Experiment Center variant via experiment_id, variation_id, and optional segment_id.

  • Adds experiment_id, variation_id, and segment_id as named, typed string fields on AuthorizationParameters.
    Fields come from @auth0/auth0-spa-js and are re-exported unchanged on AuthorizationParams.
  • Forwarded to /authorize through the existing authorizationParams pass-through - no runtime logic changes needed.
  • Adds unit tests + README.md/EXAMPLES.md docs.

Test plan

  • npm test — passes, 100% coverage held
  • New tests forward the params through loginWithRedirect (with and without segment_id)
  • README.md / EXAMPLES.md render correctly

Summary by CodeRabbit

  • Documentation
    • Added guidance for selecting an Experiment Center variant on an individual login request using experiment_id, variation_id, and an optional segment_id.
    • Includes examples for redirect and popup login, and notes that the selection applies only to that request.
    • Clarifies that parameters should be passed to the login call rather than configured on the provider, to avoid affecting silent token renewal. Experiment Center support is in Early Access.

@siddhikotak
siddhikotak requested a review from a team as a code owner September 23, 2026 11:46
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: auth0/auth0-react/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2b2ac259-ac9f-4a9e-8e41-71a73c7766d6

📥 Commits

Reviewing files that changed from the base of the PR and between e510874 and bea300c.

📒 Files selected for processing (1)
  • __tests__/auth-provider.test.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The README and examples document how to pass Experiment Center variant parameters on login calls. Tests verify parameter forwarding through loginWithRedirect and loginWithPopup.

Changes

Experiment Center variant overrides

Layer / File(s) Summary
Document per-call variant parameters
README.md, EXAMPLES.md
Documentation describes per-call experiment_id, variation_id, and optional segment_id parameters for redirect and popup login calls. It notes that provider-level parameters also reach silent renewal calls and that the override applies only to the request.
Verify login parameter forwarding
__tests__/auth-provider.test.tsx
Tests verify that redirect and popup login calls forward the required parameters, with and without segment_id.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: frederikprijck

Merge Risk: ⚪ Minimal · up to bea30

This change documents and tests existing per-call parameter forwarding. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: exposing Experiment Center override parameters through AuthorizationParameters in auth0-react.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread EXAMPLES.md Outdated
Comment thread EXAMPLES.md Outdated
Comment thread EXAMPLES.md Outdated
Comment thread __tests__/auth-provider.test.tsx Outdated
Comment thread __tests__/auth-provider.test.tsx

This branch has not been deployed

No deployments
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