@@ -182,6 +182,7 @@ def __init__(
182182 hooks : Optional [List [Hook ]] = None ,
183183 enable_event_compression : bool = False ,
184184 omit_anonymous_contexts : bool = False ,
185+ payload_filter_key : Optional [str ] = None ,
185186 ):
186187 """
187188 :param sdk_key: The SDK key for your LaunchDarkly account. This is always required.
@@ -250,6 +251,7 @@ def __init__(
250251 :param hooks: Hooks provide entrypoints which allow for observation of SDK functions.
251252 :param enable_event_compression: Whether or not to enable GZIP compression for outgoing events.
252253 :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.
253255 """
254256 self .__sdk_key = sdk_key
255257
@@ -285,6 +287,7 @@ def __init__(
285287 self .__hooks = [hook for hook in hooks if isinstance (hook , Hook )] if hooks else []
286288 self .__enable_event_compression = enable_event_compression
287289 self .__omit_anonymous_contexts = omit_anonymous_contexts
290+ self .__payload_filter_key = payload_filter_key
288291 self ._data_source_update_sink : Optional [DataSourceUpdateSink ] = None
289292
290293 def copy_with_new_sdk_key (self , new_sdk_key : str ) -> 'Config' :
@@ -484,6 +487,26 @@ def omit_anonymous_contexts(self) -> bool:
484487 """
485488 return self .__omit_anonymous_contexts
486489
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+
487510 @property
488511 def data_source_update_sink (self ) -> Optional [DataSourceUpdateSink ]:
489512 """
0 commit comments