本页还没有译文
本页 14 段还没译成한국어,下面显示的是英文原文。Headless Initialization (self-hosted)
还没翻译译自英文(langfuse.com)本页 14 段都还没译
Headless Initialization
By default, you need to create a user account, organization and project via the Langfuse UI before being able to use the API. You can find the API keys in the project settings within the UI.
If you want to automatically initialize these resources, you can optionally use the following LANGFUSE_INIT_* environment variables. When these variables are set, Langfuse will automatically create the specified resources on startup if they don't already exist. This allows for easy integration with infrastructure-as-code and automated deployment pipelines.
Note
For more programmatic control over the provisioning process, you can also use the Instance Management API.
Resource Dependencies
The different resources depend on each other.
You can e.g. initialize an organization and a user without having to also initialize a project and API keys, but you cannot initialize a project or user without also initializing an organization.
Organization
├── Project (part of organization)
│ └── API Keys (set for project)
└── User (owner of organization)
Environment Variables
| Environment Variable | Description | Required to Create Resource | Example |
|---|---|---|---|
LANGFUSE_INIT_ORG_ID | Unique identifier for the organization | Yes | my-org |
LANGFUSE_INIT_ORG_NAME | Name of the organization | No | My Org |
LANGFUSE_INIT_PROJECT_ID | Unique identifier for the project | Yes | my-project |
LANGFUSE_INIT_PROJECT_NAME | Name of the project | No | My Project |
LANGFUSE_INIT_PROJECT_RETENTION | Data Retention in days for project. Leave blank to retain data forever | No | 30 |
LANGFUSE_INIT_PROJECT_PUBLIC_KEY | Public API key for the project | Yes | pk-lf-1234567890 |
LANGFUSE_INIT_PROJECT_SECRET_KEY | Secret API key for the project | Yes | sk-lf-1234567890 |
LANGFUSE_INIT_USER_EMAIL | Email address of the initial user | Yes | user@example.com |
LANGFUSE_INIT_USER_NAME | Name of the initial user | No | John Doe |
LANGFUSE_INIT_USER_PASSWORD | Password for the initial user | Yes | password123 |
The initial user signs in without signing up, so they never see the newsletter step that new users get after sign-up. To get the self-hosting updates, subscribe here:
Note
Langfuse OSS updates — get an email when we ship important features and new releases for self-hosted (open source) Langfuse. Self-hosting updates only, no spam.
Troubleshooting
- If you use
LANGFUSE_INIT_*in Docker Compose, do not double-quote the values (GitHub issue). - The resources depend on one another (see note above). For example, you must create an organization to initialize a project.