From c30b826e7fe4d9ba2c517ae3c6a056fb937dabf5 Mon Sep 17 00:00:00 2001 From: utkrishtS Date: Tue, 8 Sep 2026 08:12:06 +0530 Subject: [PATCH 1/3] docs(examples): add Experiment Center override example --- EXAMPLES.md | 1 + examples/experiment-center.md | 89 +++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 examples/experiment-center.md diff --git a/EXAMPLES.md b/EXAMPLES.md index 8704ae4a..f584f7e2 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -11,6 +11,7 @@ Each topic lives in its own file under [`examples/`](examples). - [Ephemeral Browsing](examples/ephemeral-browsing.md) - [Auth Tab](examples/auth-tab.md) - [DPoP](examples/dpop.md) +- [Experiment Center](examples/experiment-center.md) - [Handling Configuration Changes During Authentication](examples/configuration-changes.md) ## Authentication API diff --git a/examples/experiment-center.md b/examples/experiment-center.md new file mode 100644 index 00000000..faa2d3eb --- /dev/null +++ b/examples/experiment-center.md @@ -0,0 +1,89 @@ +# Experiment Center + +[Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. It lets you split traffic across variants, measure results, and promote the winner — all inside Auth0. + +Pass `experiment_id` and `variation_id` via `withParameters()` to force a user into a specific variation for the login request, bypassing the server-side deterministic assignment. Both IDs are obtained from your Auth0 Dashboard or the Management API. + +```kotlin +WebAuthProvider.login(account) + .withParameters(mapOf( + "experiment_id" to "", + "variation_id" to "" + )) + .start(this, callback) +``` + +
+ Using coroutines + +```kotlin +WebAuthProvider.login(account) + .withParameters(mapOf( + "experiment_id" to "", + "variation_id" to "" + )) + .await(this) +``` + +
+ +
+ Using Java + +```java +WebAuthProvider.login(account) + .withParameters(new HashMap() {{ + put("experiment_id", ""); + put("variation_id", ""); + }}) + .start(this, callback); +``` + +
+ +When the experiment uses segment targeting, also pass `segment_id`: + +```kotlin +WebAuthProvider.login(account) + .withParameters(mapOf( + "experiment_id" to "", + "variation_id" to "", + "segment_id" to "" + )) + .start(this, callback) +``` + +
+ Using coroutines + +```kotlin +WebAuthProvider.login(account) + .withParameters(mapOf( + "experiment_id" to "", + "variation_id" to "", + "segment_id" to "" + )) + .await(this) +``` + +
+ +
+ Using Java + +```java +WebAuthProvider.login(account) + .withParameters(new HashMap() {{ + put("experiment_id", ""); + put("variation_id", ""); + put("segment_id", ""); + }}) + .start(this, callback); +``` + +
+ +> [!NOTE] +> Experiment Center is an Enterprise feature. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions. +> +> Only `WebAuthProvider` login reaches Experiment Center. Embedded/native login and ROPG skip `/authorize` entirely and do not support experiment overrides. From 2731412cc0d98d0a656857783d7eebda590fa610 Mon Sep 17 00:00:00 2001 From: utkrishtS Date: Tue, 22 Sep 2026 15:50:11 +0530 Subject: [PATCH 2/3] docs: address review feedback for Experiment Center example - Simplify to single example with all 3 params (experiment_id, variation_id, segment_id) across Kotlin/coroutine/Java - Add param descriptions and mention segment_id in intro - Add Beta + development-tenant limitation to NOTE callout - Add Experiment Center section to README.md Co-Authored-By: Claude Sonnet 4.6 --- README.md | 17 ++++++++++++ examples/experiment-center.md | 51 ++++++----------------------------- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 440b99c8..b84c0022 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,23 @@ WebAuthProvider.login(account) .await(this) ``` +### Experiment Center + +[Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. Pass `experiment_id`, `variation_id`, and optionally `segment_id` via `withParameters()` to force a specific variation on a Web Auth login request: + +```kotlin +WebAuthProvider.login(account) + .withParameters(mapOf( + "experiment_id" to "", + "variation_id" to "", + "segment_id" to "" // optional + )) + .start(this, callback) +``` + +> [!NOTE] +> Experiment Center is currently in Beta and runs only on development tenants. See the [full usage example](examples/experiment-center.md) for coroutine and Java samples. + ## Credentials Manager This library ships with two additional classes that help you manage the Credentials received during authentication. diff --git a/examples/experiment-center.md b/examples/experiment-center.md index faa2d3eb..aa42c726 100644 --- a/examples/experiment-center.md +++ b/examples/experiment-center.md @@ -2,53 +2,18 @@ [Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. It lets you split traffic across variants, measure results, and promote the winner — all inside Auth0. -Pass `experiment_id` and `variation_id` via `withParameters()` to force a user into a specific variation for the login request, bypassing the server-side deterministic assignment. Both IDs are obtained from your Auth0 Dashboard or the Management API. +Pass `experiment_id`, `variation_id`, and optionally `segment_id` via `withParameters()` to force a user into a specific variation for the login request, bypassing the server-side deterministic assignment. All three IDs are obtained from your Auth0 Dashboard or the Management API: -```kotlin -WebAuthProvider.login(account) - .withParameters(mapOf( - "experiment_id" to "", - "variation_id" to "" - )) - .start(this, callback) -``` - -
- Using coroutines - -```kotlin -WebAuthProvider.login(account) - .withParameters(mapOf( - "experiment_id" to "", - "variation_id" to "" - )) - .await(this) -``` - -
- -
- Using Java - -```java -WebAuthProvider.login(account) - .withParameters(new HashMap() {{ - put("experiment_id", ""); - put("variation_id", ""); - }}) - .start(this, callback); -``` - -
- -When the experiment uses segment targeting, also pass `segment_id`: +- `experiment_id` — the ID of the experiment to target +- `variation_id` — the specific variation to assign to this user +- `segment_id` — _(optional)_ restricts the override to a particular audience segment within the experiment ```kotlin WebAuthProvider.login(account) .withParameters(mapOf( "experiment_id" to "", "variation_id" to "", - "segment_id" to "" + "segment_id" to "" // optional )) .start(this, callback) ``` @@ -61,7 +26,7 @@ WebAuthProvider.login(account) .withParameters(mapOf( "experiment_id" to "", "variation_id" to "", - "segment_id" to "" + "segment_id" to "" // optional )) .await(this) ``` @@ -76,7 +41,7 @@ WebAuthProvider.login(account) .withParameters(new HashMap() {{ put("experiment_id", ""); put("variation_id", ""); - put("segment_id", ""); + put("segment_id", ""); // optional }}) .start(this, callback); ``` @@ -84,6 +49,6 @@ WebAuthProvider.login(account) > [!NOTE] -> Experiment Center is an Enterprise feature. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions. +> Experiment Center is currently in Beta and runs only on **development tenants**. Production tenants are not supported during the Beta period. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions. > > Only `WebAuthProvider` login reaches Experiment Center. Embedded/native login and ROPG skip `/authorize` entirely and do not support experiment overrides. From aae9962fdaa720548e7c636c6ee8e76f6cf68639 Mon Sep 17 00:00:00 2001 From: utkrishtS Date: Fri, 25 Sep 2026 11:07:02 +0530 Subject: [PATCH 3/3] docs: use Early Access tag for Experiment Center --- README.md | 6 ++++-- examples/experiment-center.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b84c0022..e6fc96e8 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,9 @@ WebAuthProvider.login(account) ### Experiment Center +> [!NOTE] +> Experiment Center support via SDKs is currently in Early Access. To request access to this feature, contact your Auth0 representative. + [Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. Pass `experiment_id`, `variation_id`, and optionally `segment_id` via `withParameters()` to force a specific variation on a Web Auth login request: ```kotlin @@ -330,8 +333,7 @@ WebAuthProvider.login(account) .start(this, callback) ``` -> [!NOTE] -> Experiment Center is currently in Beta and runs only on development tenants. See the [full usage example](examples/experiment-center.md) for coroutine and Java samples. +See the [full usage example](examples/experiment-center.md) for coroutine and Java samples. ## Credentials Manager diff --git a/examples/experiment-center.md b/examples/experiment-center.md index aa42c726..2096ef9e 100644 --- a/examples/experiment-center.md +++ b/examples/experiment-center.md @@ -49,6 +49,6 @@ WebAuthProvider.login(account) > [!NOTE] -> Experiment Center is currently in Beta and runs only on **development tenants**. Production tenants are not supported during the Beta period. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions. +> Experiment Center is an Enterprise feature, and support via SDKs is currently in Early Access. To request access to this feature, contact your Auth0 representative. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions. > > Only `WebAuthProvider` login reaches Experiment Center. Embedded/native login and ROPG skip `/authorize` entirely and do not support experiment overrides.