Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 716 Bytes

USAGE.md

File metadata and controls

38 lines (31 loc) · 716 Bytes
# Synchronous Example
import os
from unkey_py import Unkey

s = Unkey(
    bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)

res = s.liveness.check()

if res.object is not None:
    # handle response
    pass

The same SDK client can also be used to make asychronous requests by importing asyncio.

# Asynchronous Example
import asyncio
import os
from unkey_py import Unkey

async def main():
    s = Unkey(
        bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
    )
    res = await s.liveness.check_async()
    if res.object is not None:
        # handle response
        pass

asyncio.run(main())