Skip to content

Commit aff0c7b

Browse files
committed
feat(provider): unleash specify environment when initializing client
Signed-off-by: Kiki L Hakiem <[email protected]>
1 parent f3ade95 commit aff0c7b

File tree

1 file changed

+4
-0
lines changed
  • providers/openfeature-provider-unleash/src/openfeature/contrib/provider/unleash

1 file changed

+4
-0
lines changed

providers/openfeature-provider-unleash/src/openfeature/contrib/provider/unleash/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@ def __init__(
2222
url: str,
2323
app_name: str,
2424
api_token: str,
25+
environment: str = "development",
2526
) -> None:
2627
"""Initialize the Unleash provider.
2728
2829
Args:
2930
url: The Unleash API URL
3031
app_name: The application name
3132
api_token: The API token for authentication
33+
environment: The environment to connect to (default: "development")
3234
"""
3335
self.url = url
3436
self.app_name = app_name
3537
self.api_token = api_token
38+
self.environment = environment
3639
self.client: Optional[UnleashClient] = None
3740
self._status = ProviderStatus.NOT_READY
3841
self._last_context: Optional[EvaluationContext] = None
@@ -58,6 +61,7 @@ def initialize(
5861
self.client = UnleashClient(
5962
url=self.url,
6063
app_name=self.app_name,
64+
environment=self.environment,
6165
custom_headers={"Authorization": self.api_token},
6266
event_callback=self._unleash_event_callback,
6367
)

0 commit comments

Comments
 (0)