@superinterface/react 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3007,11 +3007,17 @@ var useMessageAudio = function(param) {
3007
3007
  latestMessageProps.latestMessage
3008
3008
  ]);
3009
3009
  });
3010
- audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?input=").concat(input2), {
3010
+ var searchParams = new URLSearchParams(_object_spread({
3011
+ input: input2
3012
+ }, isHtmlAudioSupported && superinterfaceContext.publicApiKey ? {
3013
+ publicApiKey: superinterfaceContext.publicApiKey
3014
+ } : {}));
3015
+ audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(searchParams), _object_spread({
3011
3016
  format: "mp3",
3012
3017
  autoplay: true,
3013
3018
  html5: isHtmlAudioSupported,
3014
- onend: onEnd,
3019
+ onend: onEnd
3020
+ }, isHtmlAudioSupported ? {} : {
3015
3021
  xhr: _object_spread_props(_object_spread({}, superinterfaceContext.publicApiKey ? {
3016
3022
  headers: {
3017
3023
  Authorization: "Bearer ".concat(superinterfaceContext.publicApiKey)
@@ -3019,7 +3025,7 @@ var useMessageAudio = function(param) {
3019
3025
  } : {}), {
3020
3026
  withCredentials: true
3021
3027
  })
3022
- });
3028
+ }));
3023
3029
  }, [
3024
3030
  superinterfaceContext,
3025
3031
  latestMessageProps,