Skip to content

Add configurable api_url for proxy support#291

Open
kenliu wants to merge 3 commits intomasterfrom
feat/configurable-api-url
Open

Add configurable api_url for proxy support#291
kenliu wants to merge 3 commits intomasterfrom
feat/configurable-api-url

Conversation

@kenliu
Copy link
Collaborator

@kenliu kenliu commented Mar 1, 2026

Closes #290

Changes

  • Added BaseURL field to Config struct in lib/todoist.go
  • Added baseURL() helper on Client that falls back to the hardcoded Server constant when BaseURL is not set
  • Both doApi and doRestApi now use c.baseURL() instead of Server directly
  • Reads api_url from config/env in main.go and passes it to Config

Usage

In ~/.config/todoist/config.json:

{
  "token": "your-token",
  "api_url": "https://your-proxy.example.com/api/v1/"
}

Or via environment variable:

TODOIST_API_URL=https://your-proxy.example.com/api/v1/ todoist list

No change in behavior when api_url is not set.

kenliu and others added 3 commits March 1, 2026 00:11
Adds a base_url config option (api_url key) that overrides the default
Todoist API URL. Useful for routing requests through a proxy.

Closes #290

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kenliu kenliu added the AI-generated label for any issue or PR that is either explicitly or looks like AI-generated content label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-generated label for any issue or PR that is either explicitly or looks like AI-generated content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add configurable base URL for proxy support

1 participant