A guide on how to use viem with Vanilla Javascript #3670
jpiabrantes
started this conversation in
General
Replies: 1 comment 1 reply
-
Here: <script type="importmap">
{
"imports": {
"viem": "https://esm.sh/viem",
"viem/chains": "https://esm.sh/viem/chains",
}
}
</script>
<script type="module">
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({
chain: mainnet,
transport: http(),
})
</script> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The only thing keeping me on Ethers.js is that their documentation explain how to use it with Vanilla JS: just add this script tag on the head of the index.html and you're done.
It seems
viem
does not distributed a bundled version ready to be imported into Javascript right? Is there a recommended way to do this?Is
viem
mainly for people who are using Javascript Frameworks and is not meant for vanilla js?Beta Was this translation helpful? Give feedback.
All reactions