Skip to content

fix: use the multitenant gateway for the REST API - #9

Open
andinux wants to merge 1 commit into
mainfrom
docs/gateway-url
Open

fix: use the multitenant gateway for the REST API#9
andinux wants to merge 1 commit into
mainfrom
docs/gateway-url

Conversation

@andinux

@andinux andinux commented Sep 8, 2026

Copy link
Copy Markdown

Context

The HTTPS server moved off the per-node address (<project-id>.<hosted-zone>.sqlite.cloud) onto the multitenant gateway (<project-id>.<hosted-zone>.gateway.sqlite.cloud). The dashboard's Weblite and Edge Functions pages already point there. Companion to sqlitecloud/docs#148.

access-tokens-and-social-login — was broken at runtime

src/index.ts derived the REST base URL from the hostname in the connection string:

const SQLITECLOUD_URL = `https://${sqlitecloudConnectionString.hostname}`;

The connection string legitimately points at the node on 8860, so /v2/tokens, /v2/tokens/details and /v2/weblite/sql were all being sent to the node's HTTPS server. Against a migrated project this example does not work.

It now reads an explicit SQLITECLOUD_GATEWAY_URL, with the same "not set" guard as the other required variables, and keeps the connection string for the API key and the node connection. An explicit variable was chosen over deriving the gateway host from the connection string so the example does not hard-code the host naming convention.

.env.example gains the new variable, and the README's setup steps mention copying the gateway base URL from the Weblite panel.

react-components/useDocsSearch

The README's example searchUrl used the node host and the old node HTTPS port :8090; the gateway answers on 443. README-only — the hook takes searchUrl as a parameter with no baked-in default.

Not changed

object-storage-interface/README.md uses sqlitecloud://{HOST}.sqlite.cloud:8860/... — a node connection string, correctly unaffected by this move.

Verification

npx tsc --noEmit passes on access-tokens-and-social-login. The example was not run end to end: that needs a live project and Google OAuth credentials.

🤖 Generated with Claude Code

https://claude.ai/code/session_01259fQ5Dg5Ax68zHLrje6QA

The HTTPS server moved off the per-node address onto the multitenant
gateway at <project-id>.<hosted-zone>.gateway.sqlite.cloud, so the REST
API no longer answers on the host the connection string points to.

access-tokens-and-social-login was deriving its REST base URL from the
connection string hostname, which sent /v2/tokens, /v2/tokens/details
and /v2/weblite/sql to the node. It now reads an explicit
SQLITECLOUD_GATEWAY_URL, keeping the connection string for the node.

useDocsSearch documented its search URL on the node host and the old
node HTTPS port 8090; the gateway answers on 443.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01259fQ5Dg5Ax68zHLrje6QA
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.

2 participants