Search code examples
spartacus-storefront

AsmSelectors not working with getCustomerSupportAgentTokenState


import { AsmSelectors } from '@spartacus/core';
this.customerSupportAgentTokenStateSubscription = this.store
      .select(AsmSelectors.getCustomerSupportAgentTokenState)
      .subscribe((data) => {//code here}

Property 'getCustomerSupportAgentTokenState' does not exist on type 'typeof import("/storefront/node_modules/@spartacus/core/src/asm/store/selectors/asm-group.selectors")'.ts(2339)

Checked the official docs, didn't find anything useful


Solution

  • Selector getCustomerSupportAgentTokenState is no longer part of public API. To get token use AuthStorageService.getToken or AsmAuthStorageService.getTokenTarget to check if it belongs to CS agent.