Customising localStorage option to work with Capacitor JS Storage plugin #1631
Unanswered
sts-ryan-holton
asked this question in
Support Requests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
👋 I'm using @nuxtjs/auth-next, more specificatly the v5 version on version
5.0.0-1624817847.21691f1
and need the ability to essentially replace thelocalStorage.setItem()
andlocalStorage.getItem()
references within the module with a custom storage option in order to make this plugin work with Nuxt JS where the Capacitor JS storage plugin is used so that I can persist state of a logged in user on the phone's storage, falling back tolocalStorage
in a web browser.Describe the solution you'd like to see
Currently, I'm not sure how I'd go about doing this, I feel like there should be some kind of configuration whereby the plugin exposes two or three functions which I can parse my integration into.
Describe alternatives you've considered
Regular
localStorage
does not work particuarly well in an app, I've previously tried this with Cordova, and whilst it's fine for the most part, when the app is updated or the phone crashes, the data is lost completely, where as this plugin works a treat when installed following a guide like this one for installing a Capacitor pluginAlso see below...
Additional context
In my Nuxt project where the Auth module is installed, this is how I'm currently using the Capacitor plugin, and wondered how I can get the Auth module to utilise the set & gets...
plugins/capacitor/storage.js
nuxt.config.js
file...nuxt.config.js
I think it would be great if someone is able to provide some snippet for how to customise the data storage under the hood for the Auth module to make it adaptable to other storage options like Capacitor, building hybrid apps with tools like this works wonders so I'm sure others will appriciate this enhancement! ❤️
Beta Was this translation helpful? Give feedback.
All reactions