Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 712 Bytes

USAGE.md

File metadata and controls

36 lines (29 loc) · 712 Bytes
# Synchronous Example
from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    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
from unkey_py import Unkey

async def main():
    async with Unkey(
        bearer_auth="UNKEY_ROOT_KEY",
    ) as s:
        res = await s.liveness.check_async()

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

asyncio.run(main())