{"id":42280,"library":"vuex-orm-localforage","title":"Vuex ORM LocalForage","description":"A Vuex-ORM plugin (v0.3.2) that syncs Vuex Store data with IndexedDB via LocalForage. It adds Vuex actions ($fetch, $create, $update, $delete, etc.) to load and persist model data from/to IndexedDB. Supports per-model LocalForage configuration and action name customization to avoid conflicts with other Vuex-ORM plugins. Requires @vuex-orm/core ^0.36.3. Stable but rarely updated; last release 2017.","status":"maintenance","version":"0.3.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","vue","vuex","vuex-plugin","vuex-orm","vuex-orm-plugin","localforage","localstorage"],"install":[{"cmd":"npm install vuex-orm-localforage","lang":"bash","label":"npm"},{"cmd":"yarn add vuex-orm-localforage","lang":"bash","label":"yarn"},{"cmd":"pnpm add vuex-orm-localforage","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Plugin is designed to extend VuexORM's database and is tightly coupled to its core API.","package":"@vuex-orm/core","optional":false}],"imports":[{"note":"Default import of the plugin. No named exports. CommonJS require works but is less common in modern Vue projects.","wrong":"const VuexORMLocalForage = require('vuex-orm-localforage')","symbol":"VuexORMLocalForage","correct":"import VuexORMLocalForage from 'vuex-orm-localforage'"},{"note":"Options must be wrapped in an object; passing database directly will fail because VuexORM expects a config object.","wrong":"VuexORM.use(VuexORMLocalForage, database)","symbol":"Plugin usage","correct":"VuexORM.use(VuexORMLocalForage, { database })"},{"note":"All actions return promises and should be awaited. They are added to Model instances, not the global store.","wrong":"Todo.$fetch() // missing await – returns a promise, but without await the store may not be populated when you expect","symbol":"Model actions (e.g., $fetch)","correct":"await Todo.$fetch()"}],"quickstart":{"code":"import Vue from 'vue'\nimport Vuex from 'vuex'\nimport VuexORM from '@vuex-orm/core'\nimport VuexORMLocalForage from 'vuex-orm-localforage'\n\nVue.use(Vuex)\n\nclass Todo extends VuexORM.Model {\n  static entity = 'todos'\n  static fields() {\n    return {\n      id: this.increment(),\n      title: this.string(''),\n      done: this.boolean(false)\n    }\n  }\n}\n\nconst database = new VuexORM.Database()\ndatabase.register(Todo)\n\nVuexORM.use(VuexORMLocalForage, {\n  database,\n  localforage: {\n    name: 'vuex-example'\n  }\n})\n\nconst store = new Vuex.Store({\n  plugins: [VuexORM.install(database)]\n})\n\nexport default { store, Todo }","lang":"javascript","description":"Sets up VuexORM with the LocalForage plugin, registers a Todo model, and configures IndexedDB database name."},"warnings":[{"fix":"Use a modern alternative like Pinia ORM with persistence or update manually.","message":"Package has not been updated since 2017 and may be incompatible with newer versions of @vuex-orm/core.","severity":"deprecated","affected_versions":">=0.36.3"},{"fix":"Customize action names via the 'actions' option when calling VuexORM.use().","message":"Action names ($fetch, $create, etc.) may conflict with other Vuex-ORM plugins that introduce the same actions.","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Explicitly set localforage driver: e.g., localforage: { driver: localforage.INDEXEDDB }.","message":"The plugin uses localforage defaults; if not configured, it may fall back to localStorage which has size limits.","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Pin @vuex-orm/core to 0.36.x or check compatibility with newer versions.","message":"Requires @vuex-orm/core version ^0.36.3. Using a newer major version may break API compatibility.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'/core':59 '0.36.3':60 '2017':67 'action':22,43 'add':20 'avoid':47 'configur':41 'conflict':48 'creat':24 'custom':45 'data':14,33 'delet':26 'etc':27 'fetch':23 'from/to':34 'indexeddb':16,35 'javascript':68 'last':65 'load':29 'localforag':3,18,40,81 'localstorag':82 'model':32,39 'name':44 'orm':2,7,53,58,76,79 'per':38 'per-model':37 'persist':31 'plugin':8,54,73,80 'rare':63 'releas':66 'requir':55 'stabl':61 'store':13 'support':36 'sync':11 'updat':25,64 'v0.3.2':9 'via':17 'vue':69 'vuex':1,6,12,21,52,57,70,72,75,78 'vuex-orm':5,51,56,74 'vuex-orm-plugin':77 'vuex-plugin':71","created_at":"2026-06-04T18:56:29.675418+00:00","updated_at":"2026-06-04T18:56:29.675418+00:00","problems":[{"fix":"Ensure you have @vuex-orm/core installed and imported: import VuexORM from '@vuex-orm/core'","cause":"VuexORM is not imported correctly or is an older version without the .use() method.","error":"VuexORM.use is not a function"},{"fix":"Make sure to call VuexORM.use(VuexORMLocalForage, { database }) and register the model with database.register() before creating the store.","cause":"The Model class does not have actions because the plugin was not applied or database was not registered.","error":"Cannot read property '$fetch' of undefined"},{"fix":"Use the built-in localforage via import localforage from 'localforage' if needed for driver constants.","cause":"localforage is not a peer dependency and is bundled with the plugin, but if using a custom driver reference, it may be undefined.","error":"localforage is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"vuex-orm-localforage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}