turbo-sdk icon indicating copy to clipboard operation
turbo-sdk copied to clipboard

feat(web): make Turbo accessible in the window object for web

Open dtfiedler opened this issue 2 years ago • 0 comments

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

dtfiedler avatar Sep 26 '23 22:09 dtfiedler