Repository navigation
feat: read the service token from SEAMLESS_SERVICE_TOKEN in server starters - #122
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Express, Fastify, Gin, Axum, FastAPI and Next.js starters read their service token from
SEAMLESS_SERVICE_TOKENinstead ofAPI_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 andtemplate.jsonenv declarations. The internal config fields follow (service_token,ServiceToken). The.env.examplecomments note that a local auth server holds the same value asAPI_SERVICE_TOKEN, which the auth API keeps reading. The web-only and mobile starters never read it.Why
requires.cliMinmoves to 0.24.0 (no fallback)The CLI writes the app's
.envfromtemplate.json, so renaming the key there coversinit. 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 intoapi/.env. On CLI 0.23.x, connecting a managed app would put that token inAPI_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 cleancliMinbump rather than an old-name fallback in every starter.Merge and release order
This PR goes second.
SEAMLESS_SERVICE_TOKEN; the conformance run on this PR usesseamless-climain, so the Next.js pass fails here until it lands.SEAMLESS_TEMPLATES_REF/SEAMLESS_TEMPLATES_COMMITto that tag. Until then no released CLI scaffolds these starters.Verification
npm run validateandnpm run format:check: pass.npm run checkinapi/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).SEAMLESS_TEMPLATES_DIRat this branch: the Expressapi/.envhasSEAMLESS_SERVICE_TOKEN,npm run checkpasses in it, andassertEnvironment()passes on that.env(and namesSEAMLESS_SERVICE_TOKENas missing when only the old name is there). CLI 0.23.0 refuses the starter with "requires seamless-cli >= 0.24.0".