feat: add token refresh via @assembly-js/app-bridge#1148
Open
foleyatwork wants to merge 1 commit intofeature/client-associationfrom
Open
feat: add token refresh via @assembly-js/app-bridge#1148foleyatwork wants to merge 1 commit intofeature/client-associationfrom
foleyatwork wants to merge 1 commit intofeature/client-associationfrom
Conversation
Subscribe to automatic token refresh events from the parent Copilot dashboard so API calls don't fail when tokens expire mid-session. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rrojan
reviewed
Mar 3, 2026
Comment on lines
+21
to
+23
| const unsubscribe = AssemblyBridge.sessionToken.onTokenUpdate((data) => { | ||
| store.dispatch(setToken(data.token)) | ||
| }) |
Collaborator
There was a problem hiding this comment.
@foleyatwork Assuming a long user session, does onTokenUpdate fire events for multiple token refreshes?
Contributor
Author
There was a problem hiding this comment.
Yes, I think it's a pretty self-explanatory implementation, any time the frame receives a new token that callback is fired.
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.
Kevin's Notes:
I forgot to add the app bridge last time, hopefully this solves any expiring token issues.
Eventually you guys can replace all your postMessages with function calls from this new package.
AI Description:
Summary
@assembly-js/app-bridge(v1.1.0) to subscribe to automatic token refresh events from the parent Copilot dashboarduseTokenRefreshhook that configures the bridge with the portal URL and dispatches updated tokens to ReduxClientSideStateUpdateso it runs on every pageTest plan
npx tsc --noEmitpasses with no type errorspostMessagelistener is active after page loadsessionToken.updatemessage, confirm Redux statetaskBoard.tokenupdates🤖 Generated with Claude Code