A helper utility to simplify the use of REST APIs with Vuex 2.x, using axios for HTTP requests. The current stable version is 2.16.0. It provides a fluent API to define actions, mutations, and state for Vuex stores with minimal boilerplate. Key differentiators: integrates seamlessly with Vuex 2, supports dynamic path parameters via functions, and works with websanova/vue-auth. Does not support Vuex 3+ (Vue 3). Release cadence is low; no updates since 2019.
npm install vuex-rest-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Vuex store with a REST API endpoint using vuex-rest-api.
Use Vuex 2.x or migrate to alternative library like Pinia with vuex-rest-api replacements.
Evaluate alternatives like vuex-smart-module or Pinia for active development.
Use path: ({ id }) => '/posts/' + id instead of string interpolation with ES6 template literals (though they work too, but consistency matters).Always define initial state for each property, e.g., state: { posts: [] }.Dispatch actions as store.dispatch('listPosts') or with mapActions.Ensure import: import Vapi from 'vuex-rest-api'. Then: const v = new Vapi({baseURL: '...'}).get({...})Check that you called .get({action: 'listPosts', ...}) before .getStore() and dispatch exactly 'listPosts'.Run npm install vuex-rest-api
Add state: { posts: [] } when creating new Vapi.