For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hello,
I'm trying to establish a websocket connection in the Checkout UI extension.
I tried with the library react-stomp-hooks
<StompSessionProvider url={"ws://localhost:8080/ws"}> Hello </StompSessionProvider>
I tried this code in a react app and i connected successfully but in checkout ui extension i get the following error
StompSessionProvider.tsx:34 Uncaught (in promise) ReferenceError: window is not defined at r.brokerURL.r.webSocketFactory.i.webSocketFactory (StompSessionProvider.tsx:34:40) at Client._createWebSocket (client.ts:522:24) at Client.<anonymous> (client.ts:447:28) at Generator.next (<anonymous>) at fulfilled (droner-checkout-extension.js:67:26)
Is there any example or documentation on how to connect to a websocket in a checkout ui extension?