Skip to main content

Vue

The Nhost Vue client exports a Nhost client that can be installed as a Vue plugin, and composables that make it easier to work with Nhost in your Vue app.

Installation

Install the Nhost Vue client together with GraphQL:

npm install @nhost/vue graphql

Initializing

Initialize a single nhost instance, and install it as a plugin in your Vue app.

src/main.js
import { createApp } from 'vue'
import { NhostClient } from '@nhost/vue'

import App from './App.vue'

const nhost = new NhostClient({
subdomain: '<your-subdomain>',
region: '<your-region>'
})

createApp(App).use(nhost).mount('#app')