langfuse-client-base
Auto-generated Rust client for the Langfuse API, based on the official OpenAPI specification.
[!WARNING] Important: most users should use langfuse-ergonomic instead.
This is a low-level, auto-generated client intended as a building block for higher-level abstractions. The ergonomic wrapper provides:
- Simplified APIs with builder patterns
- Automatic batching and retries
- Environment-based configuration
- Improved error handling
- Built-in OpenTelemetry integration
Only use this crate directly if you need:
- Raw access to all OpenAPI endpoints
- Custom retry/batching logic
- Minimal dependencies
Features
- Complete API coverage from OpenAPI specification
- Async/await support with Tokio
- Choice of TLS backend (rustls or native-tls)
- Strong typing with serde
Installation
[]
= "*" # See https://crates.io/crates/langfuse-client-base for latest version
Usage
This crate provides low-level API bindings. Most users should use the ergonomic wrapper instead.
Basic Configuration
use Configuration;
use ingestion_api;
let config = Configuration ;
// Use the API...
Using Environment Variables
use env;
use Configuration;
let config = Configuration ;
Self-Hosted Instances
For self-hosted Langfuse instances:
use Configuration;
let config = Configuration ;
Platform Notes
TLS Backend
By default, this crate uses rustls for TLS, which provides:
- A pure Rust implementation
- Smaller binary size
- Better cross-platform compatibility
For native TLS (OpenSSL on Linux, Schannel on Windows, Security Framework on macOS):
[]
= { = "*", = false, = ["native-tls"] }
Alpine Linux / musl
When building for Alpine Linux or other musl-based systems with native-tls:
RUN apk add --no-cache openssl-dev musl-dev
Static Linking
For fully static binaries with rustls:
RUSTFLAGS="-C target-feature=+crt-static"
Generation
This client is generated from the OpenAPI specification using Docker for reproducible builds.
# Generate client (always uses Docker)
# Update to latest OpenAPI spec and regenerate
UPDATE_SPEC=true
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
Contributing
This is auto-generated code. To make changes, please update the generation process or contribute to the main repository.