diff --git a/CHANGELOG.md b/CHANGELOG.md index da1e171..644b717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.1.1 - 2026-10-27 + +`s1 login` adds `utm_source=search1api-cli` to the browser authorization URL, so Search1API can tell sign-ups that start from the CLI. No other behavior changes. + ## 2.1.0 - 2026-10-26 Add `s1 feedback` to report wrong results, errors and missing capabilities to the Search1API team, built on the public Agentback SDK. Supports `--category`, `--intent`, `--request-id`, `--model`, `--json` and `-` for stdin. When logged in, the report carries the signed account. diff --git a/package-lock.json b/package-lock.json index 67a71c1..41d0ba9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "search1api-cli", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "search1api-cli", - "version": "2.1.0", + "version": "2.1.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 7078bf1..758cd13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search1api-cli", - "version": "2.1.0", + "version": "2.1.1", "description": "CLI tool for Search1API - web search, news, crawl, sitemap, and trending", "type": "module", "exports": { diff --git a/src/auth.ts b/src/auth.ts index f144f4c..45e26db 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -15,6 +15,8 @@ import { const CALLBACK_PATH = "/callback"; const DEFAULT_TIMEOUT_MS = 5 * 60 * 1000; const OAUTH_SCOPES = "openid profile email offline_access"; +// Names the CLI as the source of sign-ups that start from `s1 login`. +const OAUTH_SOURCE = "search1api-cli"; const EXPIRY_SKEW_MS = 60_000; const SUCCESS_HTML = ` @@ -306,6 +308,7 @@ function buildAuthorizationUrl( url.searchParams.set("state", state); url.searchParams.set("code_challenge", codeChallenge); url.searchParams.set("code_challenge_method", "S256"); + url.searchParams.set("utm_source", OAUTH_SOURCE); return url.toString(); } diff --git a/tests/oauth-e2e.test.mjs b/tests/oauth-e2e.test.mjs index 2eaf7de..9e3f792 100644 --- a/tests/oauth-e2e.test.mjs +++ b/tests/oauth-e2e.test.mjs @@ -214,6 +214,7 @@ test("runs browser OAuth, PKCE, refresh, retry, and API-key fallback end to end" /^http:\/\/127\.0\.0\.1:\d+\/callback$/ ); assert.equal(fixture.calls.authorization[0].code_challenge_method, "S256"); + assert.equal(fixture.calls.authorization[0].utm_source, "search1api-cli"); assert.equal(fixture.calls.codeExchange.length, 1); assert.equal( fixture.calls.codeExchange[0].redirect_uri,