Skip to content

Commit 76c4010

Browse files
committed
Update unleash pkg version and sample code
1 parent 2402fdf commit 76c4010

File tree

1 file changed

+8
-6
lines changed
  • docs/platforms/python/integrations/feature-flags

1 file changed

+8
-6
lines changed

docs/platforms/python/integrations/feature-flags/unleash.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The [Unleash](https://www.getunleash.io/) integration tracks feature flag evalua
99

1010
## Install
1111

12-
Install `sentry-sdk` (>=2.19.3) and `UnleashClient` (>=6.0.1) from PyPI.
12+
Install `sentry-sdk` (>=2.20.0) and `UnleashClient` (>=6.0.1) from PyPI.
1313

1414
```bash
1515
pip install --upgrade sentry-sdk UnleashClient
@@ -39,20 +39,22 @@ Test the integration by evaluating a feature flag using your Unleash SDK before
3939
import sentry_sdk
4040
from UnleashClient import UnleashClient
4141

42-
unleash_client = UnleashClient(...) # See Unleash quickstart.
43-
test_flag_enabled = unleash_client.is_enabled("test-flag")
42+
unleash = UnleashClient(...) # See Unleash quickstart.
43+
unleash.initialize_client()
4444

45+
test_flag_enabled = unleash.is_enabled("test-flag")
4546
sentry_sdk.capture_exception(Exception("Something went wrong!"))
4647
```
4748

4849
```python {tabTitle: Python, using get_variant}
4950
import sentry_sdk
5051
from UnleashClient import UnleashClient
5152

52-
unleash_client = UnleashClient(...) # See Unleash quickstart.
53-
test_flag_variant = unleash_client.get_variant("test-flag")
54-
test_flag_enabled = test_flag_variant["enabled"]
53+
unleash = UnleashClient(...) # See Unleash quickstart.
54+
unleash.initialize_client()
5555

56+
test_flag_variant = unleash.get_variant("test-flag")
57+
test_flag_enabled = test_flag_variant["enabled"]
5658
sentry_sdk.capture_exception(Exception("Something went wrong!"))
5759
```
5860

0 commit comments

Comments
 (0)