0.2.1 • Published 3 years ago

@platyplus/vue-hasura-backend-plus v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

@platyplus/vue-hasura-backend-plus

Vue plugin for Hasura Backend Plus. Works either with Vue 3 or the Vue Composition API, thanks to Vue Demi.

Installation

yarn add @platyplus/vue-hasura-backend-plus

Edit your main Vue file:

import { createHasuraBackendPlus } from '@platyplus/vue-hasura-backend-plus'
import { createApp } from 'vue'

import App from './App.vue'

const hbp = createHasuraBackendPlus({
  endpoint: 'https://hasura-backend-plus.endpoint.com',
  refreshInSeconds: 600, // Defaults to 600 (10 minutes)
  router // Optional: vue-router instance. When set, will make sure the authentication is know prior to any routing
})

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

Usage

Vue compositions:

  • useRegister
  • useLogin
  • useLogout
  • useStatus
  • useHasuraClaims
  • useAllowedRoles
  • useDefaultRole