@@ -182,6 +182,7 @@ def __init__(
182
182
hooks : Optional [List [Hook ]] = None ,
183
183
enable_event_compression : bool = False ,
184
184
omit_anonymous_contexts : bool = False ,
185
+ payload_filter_key : Optional [str ] = None ,
185
186
):
186
187
"""
187
188
:param sdk_key: The SDK key for your LaunchDarkly account. This is always required.
@@ -250,6 +251,7 @@ def __init__(
250
251
:param hooks: Hooks provide entrypoints which allow for observation of SDK functions.
251
252
:param enable_event_compression: Whether or not to enable GZIP compression for outgoing events.
252
253
:param omit_anonymous_contexts: Sets whether anonymous contexts should be omitted from index and identify events.
254
+ :param payload_filter_key: The payload filter is used to selectively limited the flags and segments delivered in the data source payload.
253
255
"""
254
256
self .__sdk_key = sdk_key
255
257
@@ -285,6 +287,7 @@ def __init__(
285
287
self .__hooks = [hook for hook in hooks if isinstance (hook , Hook )] if hooks else []
286
288
self .__enable_event_compression = enable_event_compression
287
289
self .__omit_anonymous_contexts = omit_anonymous_contexts
290
+ self .__payload_filter_key = payload_filter_key
288
291
self ._data_source_update_sink : Optional [DataSourceUpdateSink ] = None
289
292
290
293
def copy_with_new_sdk_key (self , new_sdk_key : str ) -> 'Config' :
@@ -484,6 +487,26 @@ def omit_anonymous_contexts(self) -> bool:
484
487
"""
485
488
return self .__omit_anonymous_contexts
486
489
490
+ @property
491
+ def payload_filter_key (self ) -> Optional [str ]:
492
+ """
493
+ LaunchDarkly Server SDKs historically downloaded all flag configuration
494
+ and segments for a particular environment during initialization.
495
+
496
+ For some customers, this is an unacceptably large amount of data, and
497
+ has contributed to performance issues within their products.
498
+
499
+ Filtered environments aim to solve this problem. By allowing customers
500
+ to specify subsets of an environment's flags using a filter key, SDKs
501
+ will initialize faster and use less memory.
502
+
503
+ This payload filter key only applies to the default streaming and
504
+ polling data sources. It will not affect TestData or FileData data
505
+ sources, nor will it be applied to any data source provided through the
506
+ {#data_source} config property.
507
+ """
508
+ return self .__payload_filter_key
509
+
487
510
@property
488
511
def data_source_update_sink (self ) -> Optional [DataSourceUpdateSink ]:
489
512
"""
0 commit comments