diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f0176d..fb6115b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ Format based on [Keep a Changelog](https://keepachangelog.com/). Versioning foll ## [Unreleased] +### Changed + +- Default API base is now `https://app.voicethere.io/api/v1` (production). Staging/custom hosts via `VOICETHERE_API_BASE` or `login --api-base`. + ## [0.10.0] - 2026-08-09 ### Added diff --git a/README.md b/README.md index 24bf27c..6f2330d 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ voicethere login --api-key vth_… --user-api-key vthu_… voicethere login --api-key "$VOICETHERE_API_KEY" --api-base https://app.voicethere.dev/api/v1 ``` -Default API base: `https://app.voicethere.dev/api/v1` +Default API base: `https://app.voicethere.io/api/v1` **Credentials & environment precedence** (env wins over the credentials file): diff --git a/src/lib/api.test.ts b/src/lib/api.test.ts index ec0b23c..3c4e231 100644 --- a/src/lib/api.test.ts +++ b/src/lib/api.test.ts @@ -7,6 +7,7 @@ import { DEFAULT_API_BASE, getCredentialsPath, readCredentials, + resolveEffectiveCredentials, writeCredentials, } from "./config.js"; import { slugifyName } from "../commands/projects/create.js"; @@ -26,6 +27,7 @@ describe("config", () => { afterEach(async () => { delete process.env.VOICETHERE_CREDENTIALS_PATH; + delete process.env.VOICETHERE_API_BASE; await rm(tempDir, { recursive: true, force: true }); }); @@ -34,7 +36,23 @@ describe("config", () => { }); it("defaults api_base to production URL", () => { - expect(DEFAULT_API_BASE).toBe("https://app.voicethere.dev/api/v1"); + expect(DEFAULT_API_BASE).toBe("https://app.voicethere.io/api/v1"); + }); + + it("VOICETHERE_API_BASE env overrides file and DEFAULT_API_BASE", async () => { + await writeCredentials({ + api_key: "vth_env_override", + api_base: "https://file.example.com/api/v1", + }); + process.env.VOICETHERE_API_BASE = + "https://app.voicethere.dev/api/v1"; + + const effective = await resolveEffectiveCredentials(); + expect(effective).toMatchObject({ + api_key: "vth_env_override", + api_base: "https://app.voicethere.dev/api/v1", + apiBaseFromEnv: true, + }); }); it("writes and reads credentials with mode 0600", async () => { diff --git a/src/lib/config.ts b/src/lib/config.ts index abbf331..c0fac38 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -10,7 +10,7 @@ import { import { homedir } from "node:os"; import { dirname, join } from "node:path"; -export const DEFAULT_API_BASE = "https://app.voicethere.dev/api/v1"; +export const DEFAULT_API_BASE = "https://app.voicethere.io/api/v1"; export interface Credentials { /**