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

docs: add CDNJS example #1724

Merged
merged 6 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/thin-bobcats-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions apps/docs/spell-check-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,4 @@ WalletLocked
AbstractAddress
ContractFactory
ScriptTransactionRequest
CDN
27 changes: 27 additions & 0 deletions apps/docs/src/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<script setup>
import { data } from './versions.data'
const { fuels } = data
</script>

# Getting Started with Fuels-ts

This guide will walk you through the process of setting up and using the Fuels-ts library in your front-end project.
Expand Down Expand Up @@ -62,6 +67,28 @@ function App() {
export default App;
```

## CDN Usage (browser only)

For a quick test or just playing around, you can load it in your Web Apps straight from our CDN.
danielbate marked this conversation as resolved.
Show resolved Hide resolved

```html-vue
<script type="module">
import {
Wallet,
Provider,
} from "https://cdnjs.cloudflare.com/ajax/libs/fuels/{{fuels}}/browser.mjs";

const exec = async () => {
const provider = await Provider.create(
"https://beta-5.fuel.network/graphql",
);
const { name } = provider.getChain();
console.log(name);
};
exec();
</script>
```

## Further Resources and Next Steps

For a more in-depth, step-by-step guide on working with the Fuels ecosystem, check out the [Developer Quickstart guide](https://fuelbook.fuel.network/master/quickstart/developer-quickstart.html). This guide covers:
Expand Down
Loading