Skip to content

feat: read the service token from SEAMLESS_SERVICE_TOKEN in server starters - #122

Merged
Bccorb merged 1 commit into
mainfrom
feat/seamless-service-token-env
Oct 13, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/seamless-service-token-env

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

The Express, Fastify, Gin, Axum, FastAPI and Next.js starters read their service token from SEAMLESS_SERVICE_TOKEN instead of API_SERVICE_TOKEN, the name the managed portal's snippet already uses. Renamed in the app code, startup env checks and hints, tests, .env.example, READMEs, AGENTS.md files and template.json env declarations. The internal config fields follow (service_token, ServiceToken). The .env.example comments note that a local auth server holds the same value as API_SERVICE_TOKEN, which the auth API keeps reading. The web-only and mobile starters never read it.

Why requires.cliMin moves to 0.24.0 (no fallback)

The CLI writes the app's .env from template.json, so renaming the key there covers init. But the CLI also hardcodes the name in two places that matter: the compose file's app service and managed connect, which writes a freshly rotated token into api/.env. On CLI 0.23.x, connecting a managed app would put that token in API_SERVICE_TOKEN, which these starters no longer read, after invalidating the old one. CLI 0.24.0 (fells-code/seamless-cli#278) writes the new name. Since the CLI is the only writer, this uses a clean cliMin bump rather than an old-name fallback in every starter.

Merge and release order

This PR goes second.

  1. Merge and release feat: write the app service token as SEAMLESS_SERVICE_TOKEN seamless-cli#278 first, as 0.24.0. That PR also gives the verify stack's Next.js service SEAMLESS_SERVICE_TOKEN; the conformance run on this PR uses seamless-cli main, so the Next.js pass fails here until it lands.
  2. Then merge this PR and release templates (minor changeset).
  3. Then bump the CLI's SEAMLESS_TEMPLATES_REF / SEAMLESS_TEMPLATES_COMMIT to that tag. Until then no released CLI scaffolds these starters.

Verification

  • npm run validate and npm run format:check: pass.
  • npm run check in api/express (22 tests), api/fastify (22 tests), fullstack/nextjs (55 tests): all exit 0.
  • api/gin: gofmt -l . clean, go vet ./..., go test ./... ok.
  • api/axum: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (11 passed).
  • api/fastapi: ruff check, ruff format --check, mypy, pytest (15 passed).
  • Scaffolded with the CLI branch built as 0.24.0 and SEAMLESS_TEMPLATES_DIR at this branch: the Express api/.env has SEAMLESS_SERVICE_TOKEN, npm run check passes in it, and assertEnvironment() passes on that .env (and names SEAMLESS_SERVICE_TOKEN as missing when only the old name is there). CLI 0.23.0 refuses the starter with "requires seamless-cli >= 0.24.0".

…arters

Rename the app-side service token variable from API_SERVICE_TOKEN to
SEAMLESS_SERVICE_TOKEN in the Express, Fastify, Gin, Axum, FastAPI and
Next.js starters, matching the managed portal. The local auth server keeps
reading API_SERVICE_TOKEN. The starters require seamless-cli 0.24.0, which
writes the new name.
@Bccorb
Bccorb merged commit 52e472c into main Oct 13, 2026
4 of 5 checks passed
@Bccorb
Bccorb deleted the feat/seamless-service-token-env branch October 15, 2026 03:16
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