JSPM

@rubenvaneldik/nuxtjs-hbp

3.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q42600F
  • License MIT

Nuxt.js wrapper for nhost-js-sdk

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.

Documentation

https://docs.nhost.io/libraries/nhost-js-sdk