N
Nuxt2y ago
toni

How to auto-import composables from a plugin?

Specifically interested in using the vagmi plugin (https://github.com/wobsoriano/vagmi) in Nuxt. The plugin works with this setup:
import { VagmiPlugin, chain, configureChains, createClient } from 'vagmi'
import { publicProvider } from 'vagmi/providers/public'
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin((nuxtApp) => {
const { provider, webSocketProvider } = configureChains(
[
chain.mainnet,
chain.optimism,
chain.arbitrum,
chain.polygon,
],
[publicProvider()],
)
const client = createClient({
autoConnect: true,
provider,
webSocketProvider,
})
const vagmi = VagmiPlugin(client)
nuxtApp.vueApp.use(vagmi)
})
import { VagmiPlugin, chain, configureChains, createClient } from 'vagmi'
import { publicProvider } from 'vagmi/providers/public'
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin((nuxtApp) => {
const { provider, webSocketProvider } = configureChains(
[
chain.mainnet,
chain.optimism,
chain.arbitrum,
chain.polygon,
],
[publicProvider()],
)
const client = createClient({
autoConnect: true,
provider,
webSocketProvider,
})
const vagmi = VagmiPlugin(client)
nuxtApp.vueApp.use(vagmi)
})
But I would like to auto-import all the composables from the plugin, is that possible? And if yes, how?
GitHub
GitHub - wobsoriano/vagmi: Vue composables for Ethereum
Vue composables for Ethereum. Contribute to wobsoriano/vagmi development by creating an account on GitHub.
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
toni
toniOP2y ago
That sounds like a good solution!
Fabian B.
Fabian B.2y ago
This is the recommended way😊
Want results from more Discord servers?
Add your server