Package Exports
- @rubenvaneldik/nuxtjs-hbp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rubenvaneldik/nuxtjs-hbp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@rubenvaneldik/nuxtjs-hbp
Nuxt.js wrapper for nhost-js-sdk. This wrapper creates global $auth
and $storage
methods which make it possible to easily handle auth and storage with hasura-backend-plus from everywhere in the app.
Setup
Installation
$ npm install @rubenvaneldik/nuxtjs-hbp
or
$ yarn add @rubenvaneldik/nuxtjs-hbp
Nuxt.config
Add the module to the modules section and add any
// nuxt.config.js
export default {
modules: [
'@rubenvaneldik/nuxtjs-hbp',
],
hbp: {
base_url: '', // Required
use_cookies: true, // Optional, default is false
refresh_interval_time: 30 * 60 * 1000, // Optional
client_storage_type: 'web' // Optional
}
}
Usage
All nhost-js-sdk methods are gloabally available via this.$auth
and this.$storage
. For example, use this.$auth.login(email, password)
to login.
See the auth and storage section on the nhost-js-sdk site for all available methods.