Skip to content

Commit 101e6b7

Browse files
fix: Add RPCv2 endpoint to ws connection
* fix: Add RPCv2 endpoint to ws connection * fix: Spelling error --------- Co-authored-by: Vladimir Rangelov <vladimir.rangelov@gmail.com>
1 parent afe5479 commit 101e6b7

File tree

1 file changed

+6
-1
lines changed
  • languages/javascript/src/shared/Transport

1 file changed

+6
-1
lines changed

languages/javascript/src/shared/Transport/index.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ function getImplementation() {
5656
implementation = win.__firebolt.transport
5757
}
5858
else if (win.__firebolt.endpoint) {
59-
implementation = new WebsocketTransport(win.__firebolt.endpoint)
59+
// Only adds RPCv2=true query parameter when using bidirectional SDK.
60+
// This parameter will not be present when using unidirectional SDK.
61+
// Unidirectional endpoint is handled in Gateway/Unidirectional.mjs
62+
const endpoint = win.__firebolt.endpoint
63+
const url = endpoint + (endpoint.includes('?') ? '&' : '?') + 'RPCv2=true'
64+
implementation = new WebsocketTransport(url)
6065
}
6166
else {
6267
implementation = MockTransport

0 commit comments

Comments
 (0)