langchain-ai / langchain-ai/langsmith-java

enhancement: Improve Environment Variable Compatibility in LangSmith Java SDK

Open
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
33
Forks
8
Avg merge
8d 3h
Merged PRs (30d)
3

Description

Summary

The Java SDK currently appears to support a limited set of environment variables for authentication and configuration. Other LangSmith SDKs (Python/JavaScript) support additional environment variable names, including legacy aliases and workspace configuration variables.

Current Behavior

The SDK only recognizes a subset of environment variables for configuration.

Example:

LANGCHAIN_API_KEY=<key>
LANGSMITH_WORKSPACE_ID=<workspace>

The client may fail to initialize correctly or ignore these values.

Desired Behavior

The Java SDK should provide parity with other LangSmith SDKs by supporting:

  • LANGSMITH_API_KEY
  • LANGCHAIN_API_KEY (legacy compatibility)
  • LANGSMITH_WORKSPACE_ID

The SDK should document the precedence order when multiple variables are present.

Benefits

  • Consistent behavior across LangSmith SDKs.
  • Easier migration from Python and JavaScript implementations.
  • Reduced configuration errors for users operating in multi-language environments.

Proposed Implementation

  1. Update environment variable resolution logic.
  2. Add support for legacy aliases where appropriate.
  3. Add unit tests covering all supported variables.
  4. Update documentation with supported configuration options and precedence rules.

Additional Context

This change would improve developer experience and align the Java SDK with behavior already familiar to users of other LangSmith SDKs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Java SDK's environment-variable resolution logic and compare its supported names with the issue requirements. Add unit tests for LANGSMITH_API_KEY, LANGCHAIN_API_KEY, and LANGSMITH_WORKSPACE_ID, then update the configuration documentation with the precedence rules. Done means the variables initialize configuration consistently and the supported behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.