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: openfeature-provider/js/README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,44 @@ The provider periodically:
78
78
79
79
---
80
80
81
+
## Sticky Assignments
82
+
83
+
Confidence supports "sticky" flag assignments to ensure users receive consistent variant assignments even when their context changes or flag configurations are updated. This SDK falls back to a cloud resolve in these cases.
84
+
85
+
> **ℹ️ Latency Considerations**
86
+
>
87
+
> When a sticky assignment is needed, the provider makes a **network call to Confidence's cloud resolvers**. This introduces additional latency (typically 50-200ms depending on your location) compared to local WASM evaluation.
88
+
>
89
+
> **Coming soon**: We're developing support for custom materialization storage (Redis, database, etc.) that will eliminate this network call and keep evaluation latency consistently low.
90
+
91
+
### How it works
92
+
93
+
When a flag is evaluated for a user, Confidence creates a "materialization" - a snapshot of which variant that user was assigned. On subsequent evaluations, the same variant is returned even if:
94
+
- The user's context attributes change (e.g., different country, device type)
95
+
- The flag's targeting rules are modified
96
+
- New assignments are paused
97
+
98
+
### Implementation
99
+
100
+
The provider uses a **remote resolver fallback** for sticky assignments:
101
+
- First, the local WASM resolver attempts to resolve the flag
102
+
- If sticky assignment data is needed, the provider makes a network call to Confidence's cloud resolvers
103
+
- Materializations are stored on Confidence servers with a **90-day TTL** (automatically renewed on access)
104
+
- No local storage or database setup required
105
+
106
+
### Benefits
107
+
108
+
-**Zero configuration**: Works out of the box with no additional setup
109
+
-**Managed storage**: Confidence handles all storage, TTL, and consistency
110
+
-**Automatic renewal**: TTL is refreshed on each access
111
+
-**Global availability**: Materializations are available across all your services
112
+
113
+
### Coming Soon: Custom Materialization Storage
114
+
115
+
We're working on support for connecting your own materialization storage repository (Redis, database, file system, etc.) to eliminate network calls for sticky assignments and have full control over storage. This feature is currently in development.
116
+
117
+
---
118
+
81
119
## Logging (optional)
82
120
83
121
Logging uses the `debug` library if present; otherwise, all log calls are no-ops.
0 commit comments