@@ -91,26 +91,23 @@ export default class UpgradeClient {
9191 * const upgradeClient: UpgradeClient[] = new UpgradeClient(hostURL, userId, context, options);
9292 * ```
9393 *
94- * **Scenario 1: Session-only groups (Ephemeral user request)**
95- * - `groupsForSession`: provided
96- * - `includeStoredUserGroups`: explicitly `false`
97- * - Behavior: Uses ONLY the provided session groups, ignoring any stored user groups
98- * - Use case: Contexts where complete group information is preferred to be provided at runtime,
99- * rather reading from stored user groups.
100- *
101- * **Scenario 2: Merged groups (Merged stored/ephemeral groups request mode)**
102- * - `groupsForSession`: provided
103- * - `includeStoredUserGroups`: `true`
104- * - Behavior: Merges session groups with stored user groups, if they don't already exist
105- * - Use case: Adding temporary context while preserving existing user groups
106- * - Note: This will 404 if user does not exist, as use cases would only exist for application
107- * contexts that are 'dependent' on another context to set complete user data.
108- *
109- * **Scenario 3: Default behavior (Standard mode)**
110- * - `groupsForSession`: not provided or undefined
111- * - `includeStoredUserGroups`: not provided or undefined
112- * - Behavior: Uses standard user lookup with stored groups only
113- * - Use case: Normal feature flag evaluation without session context
94+ * **Stored-user Mode** (Standard stored user lookup):
95+ * - Omit both `groupsForSession` and `includeStoredUserGroups` parameters
96+ * - Uses only stored user groups from the database
97+ * - User must already have been initialized, will 404 if user does not exist
98+ *
99+ * **Ephemeral Mode** (Session-only groups):
100+ * - Set `includeStoredUserGroups` to `false` and provide `groupsForSession`
101+ * - Uses only the groups provided in the session, ignoring any stored user groups.
102+ * - Does not require the user to be initialized (it will bypass stored user lookup)
103+ * - Useful when complete group information is always provided at runtime.
104+ *
105+ * **Merged Mode** (Stored + Session groups):
106+ * - Set `includeStoredUserGroups` to `true` and provide `groupsForSession`
107+ * - User must already have been initialized, will 404 if user does not exist.
108+ * - Session groups are merged with stored groups if they don't already exist for stored user.
109+ * - Session groups are never persisted.
110+ * - Useful for adding context-specific ephemeral groups to an existing user.
114111 */
115112
116113 constructor ( userId : string , hostUrl : string , context : string , options ?: UpGradeClientInterfaces . IConfigOptions ) {
0 commit comments