awslabs / amazon-kinesis-video-streams-webrtc-sdk-js

JS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html
Apache License 2.0
287 stars 145 forks source link

Hidden peer dependency / process.env reference #321

Open fochlac opened 3 months ago

fochlac commented 3 months ago

Hi,

I'm trying to use your library as a npm package, bundle it for the browser and I'm importing from it as follows: import { Role, SignalingClient } from 'amazon-kinesis-video-streams-webrtc' If I want to compile my library I now need to do two things that are not documented, I need to add the dependency 'events' and add an alias for process.env.PACKAGE_VERSION. While this works, its not a nice DX and it would be better to ship the lib in a way that the entry point has all process.env.variables replaced and events is at least listed as peer dependency. If this is not possible it would be good to add a note on those requirements if bundling for the browser. See this code-sandbox and the following screenshots: image image