token.place Integration
- The chat client calls
tokenPlaceChat(seefrontend/src/utils/tokenPlace.js), which posts to${baseUrl}/chatand returns thereplyfield from the JSON response. If the feature is disabled, the helper throws with a message that points back to the opt-in options. - The default base URL is
https://token.place/api(the value ofDEFAULT_URLinfrontend/src/utils/tokenPlace.js). - The integration is enabled only when an explicit opt-in flag is set via
isTokenPlaceEnabled(seegetEnabledOverrideandisTokenPlaceEnabledinfrontend/src/utils/tokenPlace.js). - The OpenAI API key chat integration is configured separately (see
frontend/src/pages/chat/svelte/OpenAIChat.svelte), so leaving token.place disabled keeps chat on the OpenAI-backed flow. - Environment variable: set
VITE_TOKEN_PLACE_ENABLED=true. You can also point to a custom URL withVITE_TOKEN_PLACE_URL. - Game state: persist
tokenPlace.enabled=truein saved game state. Optionally pair this with a customtokenPlace.url.
DSPACE ships with a token.place integration for in-game chat, but it is disabled by default. In v3, the reason is simple: the token.place API v1 is not yet implemented or live in production, so DSPACE v3 ships with OpenAI-only chat while token.place is deferred to v3.1. After v3 is in production, we will finish the token.place API v1 and deploy it; only then does DSPACE v3.1 complete and enable the integration.
Once token.place API v1 is in production, DSPACE v3.1 will complete the integration and enable the opt-in path described below.
How it works
Opt-in options
Token.place can be enabled in two ways (once the v1 API is live in production):
VITE_TOKEN_PLACE_ENABLED=true VITE_TOKEN_PLACE_URL=$TOKEN_PLACE_API_URL npm run dev
The environment flag takes precedence over game state (see getEnabledOverride and
isTokenPlaceEnabled in frontend/src/utils/tokenPlace.js). If you set
VITE_TOKEN_PLACE_ENABLED=false, token.place stays disabled even if game state is enabled. When
enabled, the URL preference order in tokenPlaceChat is tokenPlace.url (game state), then
VITE_TOKEN_PLACE_URL, then the default URL.
You can clear the saved URL (or the opt-in flag) by resetting your game state.
