Vue 3 Store Events Migration Guide
As part of our upcoming Vue 3 migration, we've introduced a new and safer way for Marketplace apps to listen for store changes. Direct access to the Vue instance (__vue__
, $store
, $router
) will no longer be available in Vue 3.
To ensure your apps continue to function seamlessly, please migrate to the new StoreEvents API for store subscriptions.
✅ How to Register for Store Updates
Use window.AppUtils.StoreEvents.register()
to subscribe to the store modules your app depends on.
Example:
// Register for store updates
const subscriptionId = window.AppUtils.StoreEvents.register(
["auth", "user"], // list of store modules
({ module, state, mutation }) => {
console.log("Update from:", module, state, mutation);
}
);
// Unregister when not needed
window.AppUtils.StoreEvents.unregister(subscriptionId);
Important Notes:
- Each app subscribes only to the modules it needs.
- On every mutation, your callback will be triggered with
{ module, state[module], mutation }
. - Apps should unregister subscriptions when no longer needed to avoid memory leaks.
🔄 Route Change Events
For route navigation, please use the routeChangeEvent
provided in AppUtils instead of router.beforeEach
.
Example:
document.addEventListener("routeChangeEvent", (e) => {
console.log("Route changed:", e.detail);
});
📁 Available Store Modules
You can subscribe to any of the following modules:
auth
user
company
reputation
reviewAggregate
reviewRequestAggregate
imagePreview
contactsPage
locations
teams
calendarProviders
calendars
numbers
users
agencyUsers
campaigns
workflows
pipelines
agencyTwilio
twilioAccount
phoneCall
funnel
contacts
oauth2
conversation
conversationV2
affiliate
opportunities
filters
defaultEmailService
trigger_folder
campaign_folder
smtpServices
mailgunServices
membership
locationCustomFields
customValues
manualCallStatus
iframe
products
stripeConnect
integrations
LevelUpDayFlag
sidebarv2
whatsApp
featureFlags
customObjectsStore
tasks
conversationChannels
labsFeatures
communities
onboarding
launchpad
phoneIntegration
whatsAppSettings
clientPortal
locationNumbers
locationSetting
conversationAi
aiAgents
aiCompanyPlan
aiLocationPlan
scoreProfiles
affiliateManager
yext
wordpress
freshchat
customPages
adPublishing
notification
regulatoryBundle
prospecting
customMenuLinks
locationsMapSearch
seo
marketplace
supportPreferences
📺 Additional Resources
For a detailed walkthrough of the migration process, check out this video tutorial:
👉 Vue 3 Store Events Migration Video Guide
⚠️ Action Required
- Update your apps to use
StoreEvents.register
androuteChangeEvent
- Test against the beta-vue environment
- Share any issues or feedback with us before the final rollout
Thanks for your cooperation in ensuring a smooth migration to Vue 3! 🚀