


























We're pleased to announce the release of our server-side Python SDK!
With this launch, Python developers can more easily interface with the Clerk Backend API to manage users, organizations, and sessions.
import asyncio
from clerk_backend_api import Clerk
async def main():
sdk = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = await sdk.email_addresses.get_async(
email_address_id="email_address_id_example"
)
if res is not None:
# handle response
pass
asyncio.run(main())This release also makes it straightforward to authenticate backend requests in Django, Flask, and other Python web frameworks:
import os
import httpx
from clerk_backend_api import Clerk
from clerk_backend_api.jwks_helpers import AuthenticateRequestOptions
def is_signed_in(request: httpx.Request):
sdk = Clerk(bearer_auth=os.getenv('CLERK_SECRET_KEY'))
request_state = sdk.authenticate_request(
request,
AuthenticateRequestOptions(
authorized_parties=['https://example.com']
)
)
return request_state.is_signed_in此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。