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

can i use walletconnect on browser(pure javascript) #671

Open
arlong87 opened this issue Aug 7, 2024 · 3 comments
Open

can i use walletconnect on browser(pure javascript) #671

arlong87 opened this issue Aug 7, 2024 · 3 comments

Comments

@arlong87
Copy link

arlong87 commented Aug 7, 2024

hello.
can i use on browser? Are there any examples?
I tried to import the packages but I failed.


<script type="module">
  import { Core } from 'https://unpkg.com/@walletconnect/core'
</script>

<script type="module">
  import { Web3Wallet } from 'https://unpkg.com/@walletconnect/web3wallet'
</script>

<script type="text/javascript">
const core = new Core({
  projectId: 'ggggggggggggggggggggggg'
})

const metadata = {
  name: 'gggggg-3',
  description: 'AppKit Example',
  url: 'https://web3modal.com', // origin must match your domain & subdomain
  icons: ['https://avatars.githubusercontent.com/u/37784886']
}

const web3wallet = await Web3Wallet.init({
  core, // <- pass the shared 'core' instance
  metadata
})

</script>

error on console:

Uncaught SyntaxError: The requested module 'https://unpkg.com/@walletconnect/core' does not provide an export named 'Core' (at test.html:2:12)
Uncaught SyntaxError: The requested module 'https://unpkg.com/@walletconnect/web3wallet' does not provide an export named 'Web3Wallet' (at test.html:6:12)
@glitch-txs
Copy link
Contributor

We don't officially support CDN ATM

@arlong87
Copy link
Author

arlong87 commented Aug 8, 2024

too bad.

@glitch-txs
Copy link
Contributor

You can use Vite which supports HTML projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants