Skip to content

feat: add token refresh via @assembly-js/app-bridge#1148

Open
foleyatwork wants to merge 15 commits intofeature/client-associationfrom
feature/app-bridge-token-refresh
Open

feat: add token refresh via @assembly-js/app-bridge#1148
foleyatwork wants to merge 15 commits intofeature/client-associationfrom
feature/app-bridge-token-refresh

Conversation

@foleyatwork
Copy link
Contributor

@foleyatwork foleyatwork commented Mar 2, 2026

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

  • Adds @assembly-js/app-bridge (v1.1.0) to subscribe to automatic token refresh events from the parent Copilot dashboard
  • Creates useTokenRefresh hook that configures the bridge with the portal URL and dispatches updated tokens to Redux
  • Wires the hook into ClientSideStateUpdate so it runs on every page

Test plan

  • npx tsc --noEmit passes with no type errors
  • In browser dev tools, verify the postMessage listener is active after page load
  • When the parent dashboard sends a sessionToken.update message, confirm Redux state taskBoard.token updates

🤖 Generated with Claude Code

Comment on lines +21 to +23
const unsubscribe = AssemblyBridge.sessionToken.onTokenUpdate((data) => {
store.dispatch(setToken(data.token))
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@foleyatwork Assuming a long user session, does onTokenUpdate fire events for multiple token refreshes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it's a pretty self-explanatory implementation, any time the frame receives a new token that callback is fired.

@arpandhakal arpandhakal force-pushed the feature/client-association branch from 84f76cf to ee5c688 Compare March 13, 2026 09:23
@aschwartz91 aschwartz91 removed their request for review March 13, 2026 15:29
@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview, Comment Mar 17, 2026 8:51am

Request Review

@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

Deployment failed with the following error:

Deploying Serverless Functions to multiple regions is restricted to the Pro and Enterprise plans.

Learn More: https://vercel.link/multiple-function-regions

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.

5 participants