turbo-sdk
turbo-sdk copied to clipboard
feat(web): make Turbo accessible in the window object for web
Currently, TurboFactory is only available through imports. Make it accessible on the window object for the web.
Example:
<script type="module" src="https://unpkg.com/@ardrive/turbo-sdk"></script> // injects TurboFactory into window object
<script type="module">
// import is not required to access TurboFactory
const turbo = TurboFactory.unauthenticated();
const rates = await turbo.getRates();
console.log(rates);
</script>
The script would require setting something like
window.TurboFactory = TurboFactory
or
window.Turbo = TurboFactory