diff --git a/README.md b/README.md index 7aef87d..f15c0ce 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You can also set credentials with environment variables: ```bash export LANGFUSE_PUBLIC_KEY="pk-lf-..." export LANGFUSE_SECRET_KEY="sk-lf-..." -export LANGFUSE_BASEURL="https://cloud.langfuse.com" +export LANGFUSE_BASE_URL="https://cloud.langfuse.com" export LANGFUSE_ENVIRONMENT="development" export LANGFUSE_USER_ID="your-user-id" ``` diff --git a/src/index.ts b/src/index.ts index d840940..1f57922 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,7 +100,8 @@ const loadLangfuseCredentials = Effect.gen(function* () { return { publicKey, secretKey, - baseUrl: process.env.LANGFUSE_BASEURL, + // Prefer the canonical name while retaining the legacy name for semver compatibility. + baseUrl: process.env.LANGFUSE_BASE_URL ?? process.env.LANGFUSE_BASEURL, environment: process.env.LANGFUSE_ENVIRONMENT, userId: process.env.LANGFUSE_USER_ID, } satisfies LangfuseCredentials; @@ -281,6 +282,8 @@ const main = Effect.gen(function* () { const baseUrl = credentials.baseUrl ?? + // Prefer the canonical name while retaining the legacy name for semver compatibility. + process.env.LANGFUSE_BASE_URL ?? process.env.LANGFUSE_BASEURL ?? "https://cloud.langfuse.com";