Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dtfiedler opened this issue Sep 26, 2023 · 0 comments
Open

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

dtfiedler opened this issue Sep 26, 2023 · 0 comments
Labels
enhancement New feature or request web

Comments

@dtfiedler
Copy link
Collaborator

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 dtfiedler added the enhancement New feature or request label Sep 26, 2023
@dtfiedler dtfiedler changed the title feature: make Turbo accessible in the window object for web feat(web): make Turbo accessible in the window object for web Sep 26, 2023
@dtfiedler dtfiedler added the web label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request web
Projects
None yet
Development

No branches or pull requests

1 participant