Skip to content

Commit

Permalink
docs: add CDNJS example (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf authored Feb 7, 2024
1 parent e67cad8 commit 100fa93
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
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.

```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

0 comments on commit 100fa93

Please sign in to comment.