Skip to content

feat: support API key authentication via environment variable#4

Open
mcampo wants to merge 1 commit into
barronlroth:mainfrom
mcampo:feature/api-key-auth
Open

feat: support API key authentication via environment variable#4
mcampo wants to merge 1 commit into
barronlroth:mainfrom
mcampo:feature/api-key-auth

Conversation

@mcampo
Copy link
Copy Markdown

@mcampo mcampo commented May 16, 2026

Description

This PR introduces support for authenticating with the Splitwise API using a static API key, providing an alternative to the interactive OAuth flow. This is particularly useful for automated environments, CI/CD pipelines, or scripts where an interactive prompt is not feasible.

Changes

  • Updated internal/auth/auth.go to check for the SPLITWISE_API_KEY environment variable before falling back to the standard token file.
  • Modified the 401 Unauthorized error message in the API client to suggest setting the API key.
  • Updated README.md to document the new environment variable usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant