ably-js
ably-js copied to clipboard
Provide a ESM bundle
I wish to simply import this sdk without the need of using npm... just a cdn, with:
<script type=module>
import alby from 'https://cdn.xyz/alby.js'
</script>
Hi @jimmywarting,
As well as NPM, we currently distribute ably-js through our CDN, (usage instructions are in the README here). The CDN distribution is a UMD module, so you can use it with AMD/requireJS or CommonJS if you want but by default it will just add the Ably library to the window. Here's a working example that you can use to create an ably client using the CDN:
<script src="https://cdn.ably.com/lib/ably.min-1.js"></script>
<script type="module>
const realtime = new Ably.Realtime({ key: '<YOUR_API_KEY>' });
</script>
Please let us know more about your use case if this doesn't work as a solution for you.
Closing this issue as stale please re-open this issue if you need further support.