Connect a Metamask Account to a Svelte Application

Share this video with your friends

Send Tweet

The first step in this part of the journey, will be to setup a simple UI that allow you to connect the current user to the blockchain through it's wallet.

To do this, let's write some code.

Sveltekit applications works by using a file system routing method, meaning that you need to create files under the src/routes/ folder and those will be then reflected as routes (urls) in your app. Let's keep ti simple and just use the default route here, open src/routes/index.svelte and delete the content of it.

You're first step will be create a button that allow the user to "sing-in" to your new dapp and allow the UI to react to that showing a different content if the authorization process was successful.