---
title: "Async client"
description: "Use asynchronous SDK calls in JavaScript and Python."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.stackmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Async client

JavaScript SDK calls return promises. Python includes a native async client with the same resource layout as the sync SDK. Both support asynchronous iteration over paginated resources.


```javascript
import StackMachine from "stackmachine";

const client = new StackMachine(process.env.STACKMACHINE_API_TOKEN);
for await (const app of client.apps.list({ limit: 10 })) {
  console.log(app.id, app.name);
}
```

```python
import asyncio
import os
from stackmachine import AsyncStackMachine

async def main():
    async with AsyncStackMachine(os.environ["STACKMACHINE_API_TOKEN"]) as client:
        async for app in client.apps.list(limit=10):
            print(app.id, app.name)

asyncio.run(main())
```

> Source: [stackmachine/sdks](https://github.com/stackmachine/sdks/tree/main) examples.

Source: https://docs.stackmachine.com/getting-started/async/index.mdx
