-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[feature] Example for sveltekit based projects #3468
Comments
Hey - thanks for this request 🙏 |
@souvikmishra We don't have fully support for SvelteKit but plain JS approach is working perfect on SvelteKit. I've added an example app to our repo as you can check how to listen state changes: #3469 In the example you'll see all the state listeners printed to the screen and you can do conditional things as you wish. |
Hey @enesozturk, the example helped quite a bit. We're able to listen to state changes and update stuff based on conditionals. Apart from that we were looking to interact with smart contracts as well, so if there can be some guidance on how to achieve that i.e. get the wallet provider like we do in the react version ( |
@souvikmishra Hello, Initialize your modal in +layout.svelte. |
@SerhiiKirik how do you get the provider object from it? Also if your library is open source it would be really helpful if you can share it here. |
@souvikmishra You can use Here is the example code piece that you can check: let eip155Provider = null;
modal.subscribeProviders((state) => {
eip155Provider = state["eip155"]
});
eip155Provider.request({
method: 'personal_sign',
params: ['Hello from AppKit!', accountState.address]
}) |
What problem does this new feature solve?
There is no straightforward way to integrate appkit with sveltekit based projects.
I tried initializing the AppKit by following the HTML + ethers example and wrap the return object given by
createAppKit()
inside a svelte store but the reactivity that I expected wasn't there.Eg.
In
appKitController.ts
Then in
stores.ts
Then in
+page.svelte
Describe the solution you'd like
If there were an example that could guide us to use all the goodness that AppKit has to offer in sveltekit (the same way you guys have it for react and vue) that would be awesome.
The text was updated successfully, but these errors were encountered: