TS Quickstart: Store different auth tokens for different servers/modules#3252
Merged
cloutiertyler merged 1 commit intomasterfrom Feb 16, 2026
Merged
TS Quickstart: Store different auth tokens for different servers/modules#3252cloutiertyler merged 1 commit intomasterfrom
cloutiertyler merged 1 commit intomasterfrom
Conversation
cloutiertyler
requested changes
Oct 3, 2025
Contributor
cloutiertyler
left a comment
There was a problem hiding this comment.
You need to update the tutorial as well. We are keeping the quickstart in sync exactly with the tutorial: https://spacetimedb.com/docs/sdks/typescript/quickstart
Use a localStorage key that includes the server URI and database name
(`${HOST}/${DB_NAME}/auth_token`) so that different servers and modules
don't overwrite each other's tokens.
Applied to all templates (react, vue, svelte, nuxt, nextjs, remix,
tanstack, chat-react) and updated docs (tutorial, quickstarts,
connection reference).
Also fixes withModuleName -> withDatabaseName in nuxt, nextjs, remix,
and tanstack templates.
Closes #3252
724e39f to
ea6c1f1
Compare
Collaborator
|
Rebased onto master and expanded the scope — the original file (
Token key format: Addresses the review feedback about updating the tutorial. |
cloutiertyler
approved these changes
Feb 16, 2026
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.
Description of Changes
In the typescript quickstart example, this includes the server and module name in the local storage variable name that we use for the auth token.
This fixes an otherwise annoying issue people run into if they start running the quickstart locally, then try to run it on maincloud. If they have already run the app with a local server, their browser will store the locally signed token, which will get rejected by maincloud.
Expected complexity level and risk
Testing
I was able to connect to my local quickstart, then change the variables to point to a module on maincloud, and I didn't get any errors.