---
title: Langfuse
icon: chart-line
description: Mount Langfuse traces and observations as a Mirage filesystem.
---

`LangfuseResource` exposes Langfuse projects and traces as a read-only tree.

Setup steps for the public/secret keys live at [Langfuse Credentials](/home/setup/langfuse).

## Node

```bash
pnpm add @struktoai/mirage-node
```

```ts
import { LangfuseResource, MountMode, Workspace } from '@struktoai/mirage-node'

const lf = new LangfuseResource({
  publicKey: process.env.LANGFUSE_PUBLIC_KEY!,
  secretKey: process.env.LANGFUSE_SECRET_KEY!,
  host: process.env.LANGFUSE_HOST,
})

const ws = new Workspace({ '/lf': lf }, { mode: MountMode.READ })
await ws.execute('ls /lf/traces/')
```

## Browser

```bash
pnpm add @struktoai/mirage-browser
```

```ts
import { LangfuseResource, MountMode, Workspace } from '@struktoai/mirage-browser'

const lf = new LangfuseResource({
  publicKey: LANGFUSE_PUBLIC_KEY,
  secretKey: LANGFUSE_SECRET_KEY,
})
```

## Config

| Field | Default | Notes |
| --- | --- | --- |
| `publicKey` | required | Langfuse public key. |
| `secretKey` | required | Langfuse secret key. Redacted in snapshots. |
| `host` | `https://cloud.langfuse.com` | Override for self-hosted Langfuse. |
| `defaultTraceLimit` | `100` | Default page size for trace listings. |
| `defaultSearchLimit` | `100` | Default page size for search. |

## Mount mode

`read`.

For the layout and search behavior see the [Python Langfuse docs](/python/resource/langfuse).
