The Dart WebSocket client template doesn't extract or use query parameters defined in channel bindings, unlike the Python template. This prevents authentication tokens and other important parameters from being passed to WebSocket connections.
When a channel defines query parameters in its bindings (e.g., auth_token for authentication), the generated JavaScript client should:
- Accept these parameters in the constructor
- Automatically append them to the WebSocket URL as query strings
// Expected generated code
ExampleClient({String? url, String? auth_token})
: _url = _buildUrl(url ?? 'wss://default-url', auth_token);
static String _buildUrl(String baseUrl, String? authToken) {
if (authToken == null) return baseUrl;
return '$baseUrl?auth_token=$authToken';
}
The Dart WebSocket client template doesn't extract or use query parameters defined in channel bindings, unlike the Python template. This prevents authentication tokens and other important parameters from being passed to WebSocket connections.
When a channel defines query parameters in its bindings (e.g.,
auth_tokenfor authentication), the generated JavaScript client should: