@rubenvaneldik/nuxtjs-hbp

3.1.0 • Public • Published

@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

Package Sidebar

Install

npm i @rubenvaneldik/nuxtjs-hbp

Weekly Downloads

1

Version

3.1.0

License

MIT

Unpacked Size

2.69 kB

Total Files

5

Last publish

Collaborators

  • rubenvaneldik