You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-4Lines changed: 67 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,10 +47,13 @@ A simple HTML5 application that provides a visual interface for viewing and mana
47
47
https://your-github-username.github.io/repo-name/
48
48
```
49
49
50
-
2.**Enter your LaunchDarkly Client-Side ID**
51
-
- Paste your client-side ID in the configuration form
52
-
- Click "Load SDK"
53
-
- The SDK will initialize and display all your flags
50
+
2.**Configure the Application**
51
+
-**Client-Side ID**: Paste your LaunchDarkly client-side ID
52
+
-**Override Behavior**: Choose how URL overrides interact with local storage:
53
+
-*Auto* (default) - When the URL contains overrides, clear any overrides not present in the URL
54
+
-*Explicit* - Only clear existing local overrides when URL includes `ld_override__clear`.
55
+
-*Always* - Always clears local storage and then loads overrides from the URL. Effectively ignores local storage.
56
+
- Click "Load SDK" to initialize
54
57
55
58
3.**View and Override Flags**
56
59
- All flags are displayed with their current values
@@ -80,6 +83,66 @@ Values are JSON-encoded, supporting:
80
83
- Strings: `"hello"`
81
84
- JSON objects: `{"key":"value"}`
82
85
86
+
### Advanced Override Control
87
+
88
+
**Automatic localStorage clearing** (default behavior): When you share a URL with override parameters, existing overrides from localStorage are **automatically cleared** first. This ensures shared URLs work reliably - recipients see exactly the flag configuration you intended.
When someone opens this URL, their existing localStorage overrides are cleared first, then your overrides are applied. This prevents conflicts and ensures predictable behavior.
95
+
96
+
**Additional control options:**
97
+
98
+
**Explicit clear flag:**
99
+
```
100
+
?ld_override__clear&ld_override_my-flag=value
101
+
```
102
+
Add `ld_override__clear` (just needs to be present) to explicitly signal clearing. This works regardless of clear mode settings.
103
+
104
+
**Remove specific overrides:**
105
+
```
106
+
?ld_override_old-flag=&ld_override_new-flag=value
107
+
```
108
+
Use an empty value (e.g., `ld_override_flagname=`) to explicitly remove a specific flag's override while keeping others.
109
+
110
+
**Configuring clear behavior:**
111
+
112
+
Clear mode can be set in two ways:
113
+
114
+
1.**Via UI Dropdown** (easiest): Select the "Override Behavior" option in the configuration form
115
+
- Changes are saved to the URL as `?clearMode=auto/explicit/always`
116
+
- Click "Load SDK" to apply changes
117
+
118
+
2.**Via URL Parameter**: Add `?clearMode=auto` to the URL
**Note:** The plugin API requires symbol values (`CLEAR_MODE_AUTO`), not strings. The application automatically converts URL string parameters to symbols.
143
+
144
+
**Note:** The double underscore in `_clear` prevents conflicts with flag names (flags cannot start with underscore).
0 commit comments