Skip to content

Commit

Permalink
chore: finalize python sdk example (#8186)
Browse files Browse the repository at this point in the history
Fix Python example and add isEnabled example.
  • Loading branch information
sjaanus authored Sep 19, 2024
1 parent 205b59d commit 9596945
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/component/onboarding/sdkSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ var settings = new UnleashSettings()
Unleash unleash = new DefaultUnleash(config);`,
Python: `from UnleashClient import UnleashClient
import asyncio
client = UnleashClient(
url="<YOUR_API_URL>",
app_name="unleash-onboarding-python",
custom_headers={'Authorization': '<YOUR_API_TOKEN>"'})
refresh_interval=5,
custom_headers={'Authorization': '<YOUR_API_TOKEN>'})
client.initialize_client()`,
JavaScript: `import { UnleashClient } from 'unleash-proxy-client';
Expand Down Expand Up @@ -217,7 +219,9 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
Rust: ``,
'.NET': ``,
Java: ``,
Python: ``,
Python: `while True:
print(client.is_enabled("<YOUR_FLAG>"))
asyncio.run(asyncio.sleep(1))`,
JavaScript: ``,
React: ``,
Vue: ``,
Expand Down

0 comments on commit 9596945

Please sign in to comment.