---
title: "Current viewer"
description: "Read the authenticated namespace user."
---

> 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.

# Current viewer

```javascript
const viewer = await client.viewer();
// Should return: {
//   "username": "your-namespace"
// }
console.log(viewer?.username);
```

```python
viewer = client.viewer()
# Should return: {
#   "username": "your-namespace"
# }
print(viewer.username if viewer else None)
```

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

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