feat: Support environment variables for personal access token auth - #605
Merged
Conversation
The JavaScript SDK resolves a personal access token and workspace id from the environment, while this SDK only resolved SEAM_API_KEY. Match its precedence rules: an option always wins over the environment, SEAM_API_KEY is skipped when a personal access token is passed, SEAM_PERSONAL_ACCESS_TOKEN is skipped when an api key is set, and defining both raises. SeamWithoutWorkspace now takes an optional personal access token and falls back to SEAM_PERSONAL_ACCESS_TOKEN. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y6AAdyu2f6Z1PfDf3tnF3J
razor-x
marked this pull request as ready for review
August 13, 2026 00:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for reading personal access token authentication credentials from environment variables, making it easier to configure the Seam SDK without passing credentials directly to constructors.
Key Changes
SEAM_PERSONAL_ACCESS_TOKENandSEAM_WORKSPACE_IDenvironment variables for theSeamclass, andSEAM_PERSONAL_ACCESS_TOKENforSeamWithoutWorkspacepersonal_access_tokenoptional inSeamWithoutWorkspace(previously required), allowing it to be read from environment variablesSEAM_API_KEYandSEAM_PERSONAL_ACCESS_TOKENfrom being set simultaneouslyparse_without_workspace_options()to handle environment variable resolution forSeamWithoutWorkspaceget_api_key_from_env()andget_personal_access_token_from_env()to manage precedence between constructor options and environment variablesImplementation Details
SEAM_WORKSPACE_IDis also read from the environment if not provided as an optionSeamWithoutWorkspacenow raisesSeamInvalidOptionsErrorif neither a personal access token option nor theSEAM_PERSONAL_ACCESS_TOKENenvironment variable is providedhttps://claude.ai/code/session_01Y6AAdyu2f6Z1PfDf3tnF3J