From the error message: Error during WebSocket handshake: Unexpected response code: 403 you provided
It’s highly possible that the token you supplied in the WebSocket subprotocol is invalid or expired. Note there are two subprotocols you need to supply, jwt.token.{YOUR_LEDGER_PARTY_TOKEN} and daml.ws.auth.
The “Live Data” view on Project:DABL also use WebSocket connection to show the data, if you can see the data there, it’s very likely your app is using an invalid token.
You can fetch fresh ledger party tokens at Ledger Settings => Party JWT.
I noticed in my code, it is still using the same bearer token in the Network communication as my local environment, but the ledger id is now different nxhgy6yk92nxerri
I will regenerate the token and try again
The party token expires in 24 hours by default. For this specific use case check out “service-account” at https://docs.projectdabl.com/api/#authentication whcih provides a long-lived credential for token exchange.