Skip to content
Tycho Engberink edited this page Feb 19, 2026 · 3 revisions

Langfuse PHP

A PHP client for the Langfuse API. Requires PHP 8.3+.

Getting started

composer require dij-digital/langfuse-php
use DIJ\Langfuse\PHP\Langfuse;
use DIJ\Langfuse\PHP\Transporters\HttpTransporter;
use GuzzleHttp\Client;

$langfuse = new Langfuse(
    transporter: new HttpTransporter(new Client([
        'base_uri' => 'https://cloud.langfuse.com',
        'auth' => ['PUBLIC_KEY', 'SECRET_KEY'],
    ])),
    environment: 'production',
    label: 'latest',
);

Features

  • Prompts -- Fetch, create, list, update, and compile text and chat prompts with fallback support
  • Ingestion -- Send traces, spans, and generations with a fluent API
  • Scores -- Create, retrieve, list, and delete evaluation scores

Upgrade guides

Clone this wiki locally