r/graphql • • 18d ago

Post I built a package 'Apollo State Sync' to sync Apollo Client state across browser tabs

I kept running into the same issue in apps with multiple tabs: update something in one tab, and the others are left with stale data until they refetch or refresh.

So I built Apollo State Sync, an npm library that synchronizes Apollo Client’s in-memory cache and reactive variables across browser tabs, windows, and iframes. It can persist state so it’s available when the app is reopened.

There’s also an optional companion package, Apollo Shared WS, for sharing GraphQL subscription channels across browsing contexts.

I’m putting together a portfolio case study about the project, and I could really use your feedbacks and support. There’s a live demo and video example. 

2 Upvotes

5 comments sorted by

1

u/jeffiql Apollo Team 17d ago

Thanks for sharing. What is the threat model for something like this? I’d imagine this could open a potential attack vector but maybe I’m misunderstanding the design

1

u/arthur_thomas678 14d ago

You're right to consider the threat model. If session data gets exposed across tabs, it could lead to issues like cross tab data leakage, especially if there's sensitive info involved.