From 95969456f6d99068b26288ff733518ea0b414c7c Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Thu, 19 Sep 2024 15:03:03 +0300 Subject: [PATCH] chore: finalize python sdk example (#8186) Fix Python example and add isEnabled example. --- frontend/src/component/onboarding/sdkSnippets.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/onboarding/sdkSnippets.ts b/frontend/src/component/onboarding/sdkSnippets.ts index f573c76a8e..a761bc667a 100644 --- a/frontend/src/component/onboarding/sdkSnippets.ts +++ b/frontend/src/component/onboarding/sdkSnippets.ts @@ -99,11 +99,13 @@ var settings = new UnleashSettings() Unleash unleash = new DefaultUnleash(config);`, Python: `from UnleashClient import UnleashClient +import asyncio client = UnleashClient( url="", app_name="unleash-onboarding-python", - custom_headers={'Authorization': '"'}) + refresh_interval=5, + custom_headers={'Authorization': ''}) client.initialize_client()`, JavaScript: `import { UnleashClient } from 'unleash-proxy-client'; @@ -217,7 +219,9 @@ export const checkFlagCodeSnippets: Record = { Rust: ``, '.NET': ``, Java: ``, - Python: ``, + Python: `while True: + print(client.is_enabled("")) + asyncio.run(asyncio.sleep(1))`, JavaScript: ``, React: ``, Vue: ``,