Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: finalize python sdk example #8186

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 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 time

client = UnleashClient(
url="<YOUR_API_URL>",
app_name="unleash-onboarding-python",
custom_headers={'Authorization': '<YOUR_API_TOKEN>"'})
refresh_interval=5,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align with other SDKs

custom_headers={'Authorization': '<YOUR_API_TOKEN>'})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo


client.initialize_client()`,
JavaScript: `import { UnleashClient } from 'unleash-proxy-client';
Expand Down Expand Up @@ -217,7 +219,12 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
Rust: ``,
'.NET': ``,
Java: ``,
Python: ``,
Python: `try:
while True:
print(client.is_enabled("dEE"))
time.sleep(1)
except KeyboardInterrupt:
client.destroy()`,
JavaScript: ``,
React: ``,
Vue: ``,
Expand Down
Loading