| name | langfuse-install-auth |
| description | Install and configure Langfuse SDK authentication for LLM observability.
Use when setting up a new Langfuse integration, configuring API keys,
or initializing Langfuse tracing in your project.
Trigger with phrases like "install langfuse", "setup langfuse",
"langfuse auth", "configure langfuse API key", "langfuse tracing setup".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*), Bash(pnpm:*), Grep |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","langfuse","api","observability","llm"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Langfuse Install & Auth
Overview
Install the Langfuse SDK and configure authentication for LLM observability. Covers both the legacy langfuse package (v3) and the modern modular SDK (v4+/v5) built on OpenTelemetry.
Prerequisites
- Node.js 18+ or Python 3.9+
- Package manager (npm, pnpm, or pip)
- Langfuse account (cloud at https://cloud.langfuse.com or self-hosted)
- Public Key (
pk-lf-...) and Secret Key (sk-lf-...) from project settings
Instructions
Step 1: Install SDK
TypeScript/JavaScript (v4+ modular SDK -- recommended):
set -euo pipefail
npm install @langfuse/client
npm install @langfuse/tracing @langfuse/otel @opentelemetry/sdk-node
npm install @langfuse/openai
npm install @langfuse/langchain
TypeScript/JavaScript (v3 legacy -- single package):
npm install langfuse
Python:
pip install langfuse
Step 2: Get API Keys
- Open Langfuse dashboard (https://cloud.langfuse.com or your self-hosted URL)
- Go to Settings > API Keys
- Click Create new API key pair
- Copy both keys:
- Public Key:
pk-lf-... (identifies your project)
- Secret Key:
sk-lf-... (grants write access -- keep secret)
- Note the host URL (cloud default:
https://cloud.langfuse.com)
Step 3: Configure Environment Variables
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
LANGFUSE_BASE_URL=
>> . <<
LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key
LANGFUSE_SECRET_KEY=sk-lf-your-secret-key
LANGFUSE_BASE_URL=https://cloud.langfuse.com
EOF