# Store switcher

> How users with several stores move between them inside the embed, how to open a given store, and the store.changed event.

Source: https://docs.nexafone.so/v1/partners/store-switcher/

A user whose token lists several stores gets a **store switcher** inside `<nexafon-app>`: each store with its unread
chats and ringing calls, so they see at a glance where they are needed. Calls from any of their stores ring them
wherever they are.

## Opening a store

Pass `store` (the store’s `externalRef` or its workspace id) to open it first:

```html
<nexafon-app store="shop-2"></nexafon-app>
<nexafon-inbox store="shop-2"></nexafon-inbox>
```

The React, Vue and Angular wrappers take the same `store` prop. Changing it reloads the component on that store.
`Nexafon.call(phone)` calls from the store the user viewed most recently.

## Following the switch

```js
Nexafon.on('store.changed', ({ workspaceId }) => {
  // For example, show that store's orders next to the embed.
})
```

`session.ready` lists the session’s stores (`{ workspaceId, name }`) once the session starts.
