langchain-ai / langchain-ai/langsmith-java
enhancement: Improve Environment Variable Compatibility in LangSmith Java SDK
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_KEYLANGCHAIN_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
- Update environment variable resolution logic.
- Add support for legacy aliases where appropriate.
- Add unit tests covering all supported variables.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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