SCAL-339768 Reuse token between REST API SDK & Visual Embed SDK - #71
Merged
Merged
Conversation
ts-nk-github-cplot
force-pushed
the
SCAL-339768
branch
from
September 29, 2026 07:15
4a250da to
58e32d3
Compare
sastaachar
requested changes
Sep 29, 2026
sastaachar
requested changes
Sep 29, 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.
Create an application using REST API SDK - Typescript & Liveboard Embed and let them share the same token for cookieless and manage it.
Application should have Liveboard list pages which uses REST API SDK and clicking on the item open the liveboard embed for that liveboard
Approach
getCachedAuthTokenfunction is shared as the token source for both the REST API SDK's bearer auth config and the Embed SDK's cookielessgetAuthToken. It caches the resolved token in memory and reuses it while it has more than 30s left before expiry, refetching from/api/thoughtspot-tokenotherwise. Concurrent callers during a refetch (e.g. the initial liveboard list fetch and the embed's auth init firing near-simultaneously) share the same in-flight request instead of each triggering a separate token fetch.